mirror of
https://github.com/DNSCrypt/encrypted-dns-server.git
synced 2024-05-09 01:46:04 +02:00
Do not forget to define rcode_refused
This commit is contained in:
parent
590e4e4627
commit
e5a42ebfa1
11
src/dns.rs
11
src/dns.rs
|
@ -21,6 +21,7 @@ const DNS_TYPE_TXT: u16 = 16;
|
||||||
const DNS_CLASS_INET: u16 = 1;
|
const DNS_CLASS_INET: u16 = 1;
|
||||||
|
|
||||||
const DNS_RCODE_SERVFAIL: u8 = 2;
|
const DNS_RCODE_SERVFAIL: u8 = 2;
|
||||||
|
const DNS_RCODE_REFUSED: u8 = 5;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn rcode(packet: &[u8]) -> u8 {
|
pub fn rcode(packet: &[u8]) -> u8 {
|
||||||
|
@ -42,6 +43,16 @@ pub fn set_rcode_servfail(packet: &mut [u8]) {
|
||||||
set_rcode(packet, DNS_RCODE_SERVFAIL)
|
set_rcode(packet, DNS_RCODE_SERVFAIL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn rcode_refused(packet: &[u8]) -> bool {
|
||||||
|
rcode(packet) == DNS_RCODE_REFUSED
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn set_rcode_refused(packet: &mut [u8]) {
|
||||||
|
set_rcode(packet, DNS_RCODE_REFUSED)
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn qdcount(packet: &[u8]) -> u16 {
|
pub fn qdcount(packet: &[u8]) -> u16 {
|
||||||
BigEndian::read_u16(&packet[4..])
|
BigEndian::read_u16(&packet[4..])
|
||||||
|
|
Loading…
Reference in New Issue