(refactor) no support for rfc4035 as of now
This commit is contained in:
parent
46629d2aad
commit
4dd3effc1a
22
src/proto.rs
22
src/proto.rs
@ -140,10 +140,10 @@ pub struct DNSHeader {
|
||||
pub recursion_desired: bool,
|
||||
/// denotes whether recursive query support is available in the name server
|
||||
pub recursion_available: bool,
|
||||
/// TODO: add documuentation about this flag
|
||||
pub authentic_data: bool,
|
||||
/// TODO: add documuentation about this flag
|
||||
pub checking_disabled: bool,
|
||||
// no support of rfc4035 at the moment
|
||||
//pub authentic_data: bool,
|
||||
// no support of rfc4035 at the moment
|
||||
//pub checking_disabled: bool,
|
||||
pub response_code: DNSRCode,
|
||||
/// TODO: add documuentation about this count
|
||||
pub query_count: u16,
|
||||
@ -171,8 +171,9 @@ impl DNSHeader {
|
||||
const RD_MASK: u8 = 0b00000001;
|
||||
|
||||
const RA_MASK: u8 = 0b10000000;
|
||||
const AD_MASK: u8 = 0b00100000;
|
||||
const CD_MASK: u8 = 0b00010000;
|
||||
// no support of rfc4035 at the moment
|
||||
//const AD_MASK: u8 = 0b00100000;
|
||||
//const CD_MASK: u8 = 0b00010000;
|
||||
const RCODE_MASK: u8 = 0b00001111;
|
||||
|
||||
const OPCODE_OFFSET: u8 = 3;
|
||||
@ -192,8 +193,9 @@ impl DNSHeader {
|
||||
let recursion_desired = (datagram[2] & Self::RD_MASK) != 0;
|
||||
let recursion_available = (datagram[3] & Self::RA_MASK) != 0;
|
||||
|
||||
let authentic_data = (datagram[2] & Self::AD_MASK) != 0;
|
||||
let checking_disabled = (datagram[2] & Self::CD_MASK) != 0;
|
||||
// no support for rfc4035 at the moment
|
||||
//let authentic_data = (datagram[2] & Self::AD_MASK) != 0;
|
||||
//let checking_disabled = (datagram[2] & Self::CD_MASK) != 0;
|
||||
|
||||
let response_code = DNSRCode::try_from(datagram[3] & Self::RCODE_MASK)?;
|
||||
let query_count = u16::from_be_bytes((datagram[4..6]).try_into().unwrap());
|
||||
@ -209,8 +211,8 @@ impl DNSHeader {
|
||||
truncated,
|
||||
recursion_desired,
|
||||
recursion_available,
|
||||
authentic_data,
|
||||
checking_disabled,
|
||||
//authentic_data, // no support of rfc4035 at the moment
|
||||
//checking_disabled, // no support of rfc4035 at the moment
|
||||
response_code,
|
||||
query_count,
|
||||
answer_count,
|
||||
|
Loading…
x
Reference in New Issue
Block a user