Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the no-aaaa option #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ pub struct Config {
pub no_check_names: bool,
/// Try AAAA query before A
pub inet6: bool,
/// Do not issue AAAA queries
pub no_aaaa: bool,
/// Use reverse lookup of ipv6 using bit-label format described instead
/// of nibble format
pub ip6_bytestring: bool,
Expand Down Expand Up @@ -125,6 +127,7 @@ impl Config {
/// assert_eq!(config.rotate, false);
/// assert_eq!(config.no_check_names, false);
/// assert_eq!(config.inet6, false);
/// assert_eq!(config.no_aaaa, false);
/// assert_eq!(config.ip6_bytestring, false);
/// assert_eq!(config.ip6_dotint, false);
/// assert_eq!(config.edns0, false);
Expand All @@ -147,6 +150,7 @@ impl Config {
rotate: false,
no_check_names: false,
inet6: false,
no_aaaa: false,
ip6_bytestring: false,
ip6_dotint: false,
edns0: false,
Expand Down Expand Up @@ -355,6 +359,9 @@ impl fmt::Display for Config {
if self.inet6 {
writeln!(fmt, "options inet6")?;
}
if self.no_aaaa {
writeln!(fmt, "options no-aaaa")?;
}
if self.ip6_bytestring {
writeln!(fmt, "options ip6-bytestring")?;
}
Expand Down
1 change: 1 addition & 0 deletions src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ pub(crate) fn parse(bytes: &[u8]) -> Result<Config, ParseError> {
("rotate", _) => cfg.rotate = true,
("no-check-names", _) => cfg.no_check_names = true,
("inet6", _) => cfg.inet6 = true,
("no-aaaa", _) => cfg.no_aaaa = true,
("ip6-bytestring", _) => cfg.ip6_bytestring = true,
("ip6-dotint", _) => cfg.ip6_dotint = true,
("no-ip6-dotint", _) => cfg.ip6_dotint = false,
Expand Down