Added dns body models
This commit is contained in:
parent
d0e4bea3e8
commit
59556f6b3c
44
src/proto.rs
44
src/proto.rs
@ -156,11 +156,47 @@ pub struct DNSHeader {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DNSQuery {
|
||||
pub hdr: DNSHeader,
|
||||
pub enum DNSClass {
|
||||
Internet = 1,
|
||||
Any = 255,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum DNSType {
|
||||
HostAddress = 1,
|
||||
NameServer = 2,
|
||||
CanonicalName = 5,
|
||||
StartOfZoneAuthority = 6,
|
||||
WellKnownServiceDescription = 11,
|
||||
DomainNamePointer = 12,
|
||||
HostInformation = 13,
|
||||
MailListInformation = 14,
|
||||
MailExchange = 15,
|
||||
TextStrings = 16,
|
||||
Any = 255,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DNSQuestion {
|
||||
pub name: String,
|
||||
pub qclass: u16,
|
||||
pub qtype: u16,
|
||||
pub r#type: DNSType,
|
||||
pub class: DNSClass,
|
||||
}
|
||||
|
||||
pub struct DNSResourceRecord {
|
||||
pub name: String,
|
||||
pub r#type: DNSType,
|
||||
pub class: DNSClass,
|
||||
pub ttl: u32,
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
pub struct DNSMessage {
|
||||
pub header: DNSHeader,
|
||||
pub questions: Vec<DNSQuestion>,
|
||||
pub answers: Vec<DNSResourceRecord>,
|
||||
pub authorities: Vec<DNSResourceRecord>,
|
||||
pub additionals: Vec<DNSResourceRecord>,
|
||||
}
|
||||
|
||||
impl DNSHeader {
|
||||
|
Loading…
x
Reference in New Issue
Block a user