[−][src]Struct rusty_dns::dns_packet::DnsPacket
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.
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]
buf: &Vec<u8>,
start: usize,
limit: usize
) -> Result<(String, usize), String>
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]
domain_name: &String,
buf: &mut Vec<u8>,
start: usize,
domain_name_offsets: &mut HashMap<String, u16>
) -> Result<(), String>
Serialize domain_name into a DNS protocol conformant, network ready buffer, using message compression.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DnsPacket
impl Send for DnsPacket
impl Sync for DnsPacket
impl Unpin for DnsPacket
impl UnwindSafe for DnsPacket
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>,