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