Class DnsMessage
- Namespace
- AppleTvControlLibrary.Discovery.Dns
- Assembly
- AppleTvControlLibrary.Discovery.dll
Represents a DNS message (query or response).
public sealed class DnsMessage
- Inheritance
-
DnsMessage
- Inherited Members
Remarks
Initializes a new instance of the DnsMessage class.
Constructors
DnsMessage(ushort, ushort)
Represents a DNS message (query or response).
public DnsMessage(ushort msgId = 0, ushort flags = 288)
Parameters
Remarks
Initializes a new instance of the DnsMessage class.
Properties
Answers
Gets the answer resource records in this message.
public List<DnsResource> Answers { get; }
Property Value
Authorities
Gets the authority resource records in this message.
public List<DnsResource> Authorities { get; }
Property Value
Flags
Gets or sets the message flags.
public ushort Flags { get; set; }
Property Value
MsgId
Gets or sets the message id.
public ushort MsgId { get; set; }
Property Value
Questions
Gets the questions in this message.
public List<DnsQuestion> Questions { get; }
Property Value
Resources
Gets the additional resource records in this message.
public List<DnsResource> Resources { get; }
Property Value
Methods
Pack()
Packs this message into bytes.
public byte[] Pack()
Returns
- byte[]
The packed message bytes.
Remarks
Only the question section is packed for outgoing queries, matching the only usage
pyatv makes of this method (create_service_queries); answer/authority/resource
packing is not needed by a discovery client and is therefore not implemented.
Unpack(byte[])
Unpacks bytes into this DnsMessage.
public DnsMessage Unpack(byte[] msg)
Parameters
msgbyte[]The raw message bytes.
Returns
- DnsMessage
This instance, for chaining.