Structs§
- A domain name is a sequence of labels, where each label is a length octet followed by that number of octets.
- Common header type for all messages.
- A label is just a sequence of octets, which are compared as case-insensitive ASCII. A label can be no longer than 63 octets.
- Basic DNS message format, used for both queries and responses.
- A struct with a private constructor, to ensure invalid
Opcode
s cannot be created. - The question section has a list of questions (usually 1 but possibly more) being asked. This is the structure for a single question.
- A struct with a private constructor, to ensure invalid
Rcode
s cannot be created. - A struct with a private constructor, to ensure invalid
RecordClass
es cannot be created. - A struct with a private constructor, to ensure invalid
RecordType
s cannot be created. - The answer, authority, and additional sections are all the same format: a variable number of resource records. This is the structure for a single resource record.
Enums§
- Errors that can arise when converting a
&str
into aDomainName
. - Errors that can arise when converting a
[u8]
into aLabel
. - What sort of query this is.
- Query classes are a superset of record classes.
- Query types are a superset of record types.
- What sort of response this is.
- Record classes are used by resource records and by queries.
- Errors that can arise when converting a
&str
into aRecordClass
. - Record types are used by resource records and by queries.
- Errors that can arise when converting a
&str
into aRecordType
. - A record type with its associated, deserialised, data.
Constants§
- Maximum encoded length of a domain name. The number of labels plus sum of the lengths of the labels.
- Octet mask for the AA flag being set (authoritative)
- Octet mask for the opcode field.
- Octet mask for the QR flag being set (response).
- Octet mask for the RA flag being set (available)
- Octet mask for the rcode field.
- Octet mask for the RD flag being set (desired)
- Octet mask for the TC flag being set (truncated)
- Offset for the opcode field.
- Offset for the rcode field.
- Maximum length of a single label in a domain name.