Class DnsResource
- Namespace
- AppleTvControlLibrary.Discovery.Dns
- Assembly
- AppleTvControlLibrary.Discovery.dll
Represents a DNS resource record.
public sealed class DnsResource
- Inheritance
-
DnsResource
- Inherited Members
Remarks
Initializes a new instance of the DnsResource class.
Constructors
DnsResource(string, QueryType, ushort, uint, ushort, object)
Represents a DNS resource record.
public DnsResource(string qname, QueryType qtype, ushort qclass, uint ttl, ushort rdLength, object rd)
Parameters
qnamestringThe DNS record name.
qtypeQueryTypeThe DNS record type.
qclassushortThe DNS record class.
ttluintThe record time-to-live in seconds.
rdLengthushortThe length of the resource data in bytes.
rdobjectThe decoded resource data.
Remarks
Initializes a new instance of the DnsResource class.
Properties
QClass
Gets the record class.
public ushort QClass { get; }
Property Value
- ushort
The record class.
QName
Gets the record name.
public string QName { get; }
Property Value
- string
The record name.
QType
Gets the record type.
public QueryType QType { get; }
Property Value
- QueryType
The record type.
Rd
Gets the parsed RDATA. The runtime type depends on QType: a string for A/PTR, a Dictionary<TKey, TValue> of string to byte[] for TXT, a SrvRecord for SRV, or raw byte[] otherwise.
public object Rd { get; }
Property Value
- object
The parsed RDATA. The runtime type depends on QType: a string for A/PTR, a Dictionary<TKey, TValue> of string to byte[] for TXT, a SrvRecord for SRV, or raw byte[] otherwise.
RdLength
Gets the RDATA byte length as read from the wire.
public ushort RdLength { get; }
Property Value
- ushort
The RDATA byte length as read from the wire.
Ttl
Gets the record time-to-live.
public uint Ttl { get; }
Property Value
- uint
The record time-to-live.
Methods
UnpackRead(DnsBufferReader)
Creates a DnsResource from data in a data stream.
public static DnsResource UnpackRead(DnsBufferReader buffer)
Parameters
bufferDnsBufferReaderThe buffer to read from.
Returns
- DnsResource
The parsed resource record.