[−][src]Struct rusty_dns::dns_packet::dns_header::DnsHeader
DNS Packet Header.
Fields
id: u16
The ID for the DNS query and corresponding response.
qr: bool
The QR flag is false if the DNS packet is a query, true if it is a response.
opcode: u8
OPCODE for the query. Valid values are 0-2. See DNS_RFC_Notes.
aa: bool
The AA flag is false if the answer is non-authoritative, true otherwise.
tc: bool
The TC flag is true if the DNS packet was truncated due to message length.
rd: bool
The RD flag is set if recursion is desired during query resolution.
ra: bool
The RA flag is set in a response if the answering server supports recursive query.
z: u8
The Z field is reserved per the DNS protocol, and must always be 0.
rcode: u8
The RCODE field is the response from the answering server during query resolution.
qdcount: u16
QDCOUNT is the number of entries in the question section of the DNS packet.
ancount: u16
ANCOUNT is the number of entries in the answer section of the DNS packet.
nscount: u16
NSCOUNT is the number of name server resource records in the authority section of the DNS packet.
arcount: u16
ARCOUNT is the numer of entries in the additional section of the DNS packet.
Implementations
impl DnsHeader
[src]
pub fn new() -> Result<DnsHeader, String>
[src]
pub fn parse(dns_packet_buf: &Vec<u8>) -> Result<DnsHeader, String>
[src]
Parse a DNS header from the start of a raw DNS packet.
pub fn serialize(&self) -> Vec<u8>
[src]
Serialize the DNS header into a DNS protocol conformant, network ready buffer.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DnsHeader
impl Send for DnsHeader
impl Sync for DnsHeader
impl Unpin for DnsHeader
impl UnwindSafe for DnsHeader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,