dns/src/models/mod.rs

38 lines
675 B
Rust

#[derive(Debug, Clone)]
pub struct DNSQuery {
pub id: u16,
pub questions: Vec<DNSQuestion>,
}
#[derive(Debug, Clone)]
pub struct DNSResponse {
pub id: u16,
pub questions: Vec<DNSQuestion>,
pub answers: Vec<DNSResourceRecord>,
}
#[derive(Debug, Clone)]
pub struct DNSQuestion {
pub name: String,
pub r#type: DNSType,
}
#[derive(Debug, Clone)]
pub enum DNSType {
HostAddress,
NameServer,
CanonicalName,
StartOfZoneAuthority,
DomainNamePointer,
MailExchange,
TextStrings,
}
#[derive(Debug, Clone)]
pub struct DNSResourceRecord {
pub name: String,
pub r#type: DNSType,
pub ttl: u32,
pub data: String,
}