Skip to content

Commit

Permalink
edns no ends0 and recmomended payload added
Browse files Browse the repository at this point in the history
  • Loading branch information
joalopez1206 authored and FranciscaOrtegaG committed Oct 9, 2024
1 parent 5613631 commit e63fb52
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/async_resolver/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ pub struct ResolverConfig {
/// Max payload for the resolver.
max_payload: u16,
/// Version of endns0.
ends0_version: u8,
edns0_version: u8,
/// edns0 flags for the resolver.
ends0_do: bool,
edns0_do: bool,
/// edns0 options for the resolver.
edns0_options: Vec<u16>,
/// This is whether tsig is enabled or not.
Expand Down Expand Up @@ -119,11 +119,11 @@ impl ResolverConfig {
max_retry_interval_seconds: 10,
min_retry_interval_seconds: 1,
global_retransmission_limit: 30,
ends0: false,
max_payload: 512,
ends0_version: 0,
ends0_do: true,
ends0_options: Vec::new(),
edns0: false,
max_payload: RECOMMENDED_MAX_PAYLOAD as u16,
edns0_version: 0,
edns0_do: false,
edns0_options: Vec::new(),
tsig: false,
key_name: None,
key: Vec::new(),
Expand Down Expand Up @@ -166,9 +166,9 @@ impl ResolverConfig {
global_retransmission_limit: global_retransmission_limit,
edns0: false,
max_payload: 512,
ends0_version: 0,
ends0_do: true,
ends0_options: Vec::new(),
edns0_version: 0,
edns0_do: false,
edns0_options: Vec::new(),
tsig: false,
key_name: None,
key: Vec::new(),
Expand Down Expand Up @@ -262,13 +262,13 @@ impl ResolverConfig {
/// resolver_config.add_edns0_to_message(&message);
/// ```
pub fn add_edns0_to_message(&self, message: &mut DnsMessage) {
if self.ends0 {
if self.edns0 {
message.add_edns0(
Some(self.get_max_payload()),
Rcode::NOERROR,
self.get_ends0_version(),
self.get_ends0_do(),
Some(self.get_ends0_options()));
self.get_edns0_version(),
self.get_edns0_do(),
Some(self.get_edns0_options()));
}
}

Expand Down Expand Up @@ -364,12 +364,12 @@ impl ResolverConfig {
self.max_payload
}

pub fn get_ends0_version(&self) -> u8 {
self.ends0_version
pub fn get_edns0_version(&self) -> u8 {
self.edns0_version
}

pub fn get_ends0_do(&self) -> bool {
self.ends0_do
pub fn get_edns0_do(&self) -> bool {
self.edns0_do
}

pub fn get_edns0_options(&self) -> Vec<u16> {
Expand Down Expand Up @@ -453,11 +453,11 @@ impl ResolverConfig{
}

pub fn set_ends0_version(&mut self, ends0_version: u8) {
self.ends0_version = ends0_version;
self.edns0_version = ends0_version;
}

pub fn set_ends0_do(&mut self, ends0_do: bool) {
self.ends0_do = ends0_do;
self.edns0_do = ends0_do;
}

pub fn set_ends0_options(&mut self, ends0_options: Vec<u16>) {
Expand Down

0 comments on commit e63fb52

Please sign in to comment.