[][src]Struct rusty_dns::dns_packet::DnsPacket

pub struct DnsPacket {
    pub header: DnsHeader,
    pub question: Vec<DnsQuestion>,
    pub answer: Vec<DnsResourceRecord>,
    pub authority: Vec<DnsResourceRecord>,
    pub additional: Vec<DnsResourceRecord>,
}

DNS Packet.

Fields

header: DnsHeader

DNS Header for the DNS packet.

question: Vec<DnsQuestion>

DNS Question section for the DNS packet.

answer: Vec<DnsResourceRecord>

DNS Answer section for the DNS packet.

authority: Vec<DnsResourceRecord>

DNS Authority section for the DNS packet.

additional: Vec<DnsResourceRecord>

DNS Additonal section for the DNS packet.

Implementations

impl DnsPacket[src]

pub fn parse_dns_packet(dns_packet_buf: &Vec<u8>) -> Result<DnsPacket, String>[src]

Parse a DNS packet from a raw DNS packet.

pub fn serialize(&self) -> Result<Vec<u8>, String>[src]

Serialize the DNS packet into a DNS protocol conformant, network ready buffer.

pub fn parse_domain_name(
    buf: &Vec<u8>,
    start: usize,
    limit: usize
) -> Result<(String, usize), String>
[src]

Parse a DNS domain name from a raw DNS packet, taking into account DNS message compression.

pub fn is_domain_name_valid(domain_name: &String) -> bool[src]

Returns true if domain_name represents a valid DNS domain name.

pub fn serialize_domain_name(
    domain_name: &String,
    buf: &mut Vec<u8>,
    start: usize,
    domain_name_offsets: &mut HashMap<String, u16>
) -> Result<(), String>
[src]

Serialize domain_name into a DNS protocol conformant, network ready buffer, using message compression.

Trait Implementations

impl Debug for DnsPacket[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.