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: bool

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: boolchecking_disabled: bool

Implementations

Creates a new header for a query packet

Creates a new header for a reply packet

Parse a slice of 12 bytes into a Packet header

Writes this header to a buffer of 12 bytes

Returns the packet id from the header buffer

Returns the questions count from the header buffer

Writes the questions count in the header buffer

Returns the answers count from 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

Writes the additional records count in the header buffer

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.