diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-03-01 01:13:25 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-03-01 01:13:25 -0500 |
commit | b7676d06363f71b4a856c5f5815f75e2bf7ca8ec (patch) | |
tree | b7e188aa4e1abaa69b1b9ee4fb6cd5a0ad60637d /resolver/src/config.rs | |
parent | gpl (diff) | |
download | wrapper-b7676d06363f71b4a856c5f5815f75e2bf7ca8ec.tar.gz wrapper-b7676d06363f71b4a856c5f5815f75e2bf7ca8ec.tar.bz2 wrapper-b7676d06363f71b4a856c5f5815f75e2bf7ca8ec.zip |
inital working dns
Diffstat (limited to 'resolver/src/config.rs')
-rw-r--r-- | resolver/src/config.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/resolver/src/config.rs b/resolver/src/config.rs new file mode 100644 index 0000000..762f311 --- /dev/null +++ b/resolver/src/config.rs @@ -0,0 +1,23 @@ +use std::net::IpAddr; + +#[derive(Clone)] +pub struct Config { + fallback: IpAddr +} + +impl Config { + + pub fn new() -> Self { + let fallback = "9.9.9.9".parse::<IpAddr>().expect("Failed to create default ns fallback"); + Self { fallback } + } + + pub fn get_fallback_ns(&self) -> &IpAddr { + return &self.fallback; + } + + pub fn set_fallback_ns(&mut self, addr: &IpAddr) { + self.fallback = addr.clone(); + } + +}
\ No newline at end of file |