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 support for NAPTR record type #427

Merged
merged 5 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 17 additions & 0 deletions src/base/zonefile_fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,21 @@ mod test {
record.display_zonefile(false).to_string()
);
}

#[test]
fn naptr_record() {
use crate::rdata::Naptr;
let record = create_record(Naptr::<Vec<u8>, &Name<[u8]>>::new(
100,
50,
"a".parse().unwrap(),
"z3950+N2L+N2C".parse().unwrap(),
"".parse().unwrap(),
Name::from_slice(b"\x09cidserver\x07example\x03com\x00").unwrap(),
));
assert_eq!(
r#"example.com. 3600 IN NAPTR 100 50 "a" "z3950+N2L+N2C" "" cidserver.example.com."#,
record.display_zonefile(false).to_string()
);
}
}
5 changes: 5 additions & 0 deletions src/rdata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,9 @@ rdata_types! {
Zonemd<O>,
}
}
naptr::{
ximon18 marked this conversation as resolved.
Show resolved Hide resolved
zone {
Naptr<O, N>,
}
}
}
Loading