Struct simple_dns::PacketHeader [−][src]
pub struct PacketHeader {}Show 14 fields
pub id: u16, pub query: bool, pub opcode: OPCODE, pub authoritative_answer: bool, pub truncated: bool, pub recursion_desired: bool, pub recursion_available: bool, pub response_code: RCODE, pub questions_count: u16, pub answers_count: u16, pub name_servers_count: u16, pub additional_records_count: u16, pub authentic_data: bool, pub checking_disabled: bool,
Expand description
Contains general information about the packet
Fields
id: u16
The identification of the packet, must be defined when querying
query: bool
Indicates if this packet is a query or a response.
opcode: OPCODE
Indicates the type of query in this packet
Authoritative Answer - this bit is valid in responses,
and specifies that the responding name server is an authority for the domain name in question section.
truncated: bool
TrunCation - specifies that this message was truncated due to
length greater than that permitted on the transmission channel.
recursion_desired: bool
Recursion Desired may be set in a query andis copied into the response.
If RD is set, it directs the name server to pursue the query recursively.
Recursive query support is optional.
recursion_available: bool
Recursion Available is set or cleared in a response.
It denotes whether recursive query support is available in the name server.
response_code: RCODE
RCODE indicates the response code for this packet
questions_count: u16
Indicate the number of questions in the packet
answers_count: u16
Indicate the number of answers in the packet
name_servers_count: u16
Indicate the number of name servers resource records in the packet
additional_records_count: u16
Indicate the number of additional records in the packet
authentic_data: bool
checking_disabled: bool
Implementations
Creates a new header for a query packet
Writes the questions count in the header buffer
Writes the answers count in the header buffer
Returns the name servers count from the header buffer
Writes the name servers count in the header buffer
Returns the additional records from the header buffer