Compare commits
1 Commits
master
...
dns-body-m
Author | SHA1 | Date | |
---|---|---|---|
59556f6b3c |
44
src/proto.rs
44
src/proto.rs
@ -156,11 +156,47 @@ pub struct DNSHeader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct DNSQuery {
|
pub enum DNSClass {
|
||||||
pub hdr: DNSHeader,
|
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 name: String,
|
||||||
pub qclass: u16,
|
pub r#type: DNSType,
|
||||||
pub qtype: u16,
|
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 {
|
impl DNSHeader {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user