Skip to content

Commit

Permalink
add zone file parsing for SVCB and HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
bluejekyll committed Mar 12, 2021
1 parent 1e7b941 commit 1b7ba9c
Show file tree
Hide file tree
Showing 5 changed files with 586 additions and 16 deletions.
6 changes: 6 additions & 0 deletions crates/client/src/error/parse_error.rs
Expand Up @@ -196,6 +196,12 @@ impl From<ProtoError> for Error {
}
}

impl From<std::convert::Infallible> for Error {
fn from(_e: std::convert::Infallible) -> Error {
panic!("infallible")
}
}

impl From<Error> for io::Error {
fn from(e: Error) -> Self {
match *e.kind() {
Expand Down
6 changes: 2 additions & 4 deletions crates/client/src/serialize/txt/parse_rdata.rs
Expand Up @@ -46,8 +46,7 @@ impl RDataParser for RData {
RecordType::CAA => caa::parse(tokens).map(RData::CAA)?,
RecordType::CNAME => RData::CNAME(name::parse(tokens, origin)?),
RecordType::HINFO => RData::HINFO(hinfo::parse(tokens)?),
// FIXME: actually implement this
RecordType::HTTPS => unimplemented!("HTTPS records not yet supported in zone files"),
RecordType::HTTPS => svcb::parse(tokens).map(RData::SVCB)?,
RecordType::IXFR => panic!("parsing IXFR doesn't make sense"), // valid panic, never should happen
RecordType::MX => RData::MX(mx::parse(tokens, origin)?),
RecordType::NAPTR => RData::NAPTR(naptr::parse(tokens, origin)?),
Expand All @@ -59,8 +58,7 @@ impl RDataParser for RData {
RecordType::SOA => RData::SOA(soa::parse(tokens, origin)?),
RecordType::SRV => RData::SRV(srv::parse(tokens, origin)?),
RecordType::SSHFP => RData::SSHFP(sshfp::parse(tokens)?),
// FIXME: actually implement this
RecordType::SVCB => unimplemented!("SVCB records not yet supported in zone files"),
RecordType::SVCB => svcb::parse(tokens).map(RData::SVCB)?,
RecordType::TLSA => RData::TLSA(tlsa::parse(tokens)?),
RecordType::TXT => RData::TXT(txt::parse(tokens)?),
RecordType::DNSSEC(DNSSECRecordType::SIG) => panic!("parsing SIG doesn't make sense"), // valid panic, never should happen
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/serialize/txt/rdata_parsers/mod.rs
Expand Up @@ -31,5 +31,6 @@ pub(crate) mod openpgpkey;
pub(crate) mod soa;
pub(crate) mod srv;
pub(crate) mod sshfp;
pub(crate) mod svcb;
pub(crate) mod tlsa;
pub(crate) mod txt;

0 comments on commit 1b7ba9c

Please sign in to comment.