use core::fmt;
use domain_macros::*;
mod dnskey;
pub use dnskey::{DNSKey, DNSKeyFlags};
mod rrsig;
pub use rrsig::RRSig;
mod nsec;
pub use nsec::{NSec, TypeBitmaps};
mod nsec3;
pub use nsec3::{NSec3, NSec3Flags, NSec3HashAlg, NSec3Param};
mod ds;
pub use ds::{DigestType, Ds};
#[derive(
Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
AsBytes,
BuildBytes,
ParseBytes,
ParseBytesZC,
SplitBytes,
SplitBytesZC,
UnsizedCopy,
)]
#[repr(transparent)]
pub struct SecAlg {
pub code: u8,
}
impl SecAlg {
pub const DSA_SHA1: Self = Self { code: 3 };
pub const RSA_SHA1: Self = Self { code: 5 };
}
impl fmt::Debug for SecAlg {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match *self {
Self::DSA_SHA1 => "SecAlg::DSA_SHA1",
Self::RSA_SHA1 => "SecAlg::RSA_SHA1",
_ => return write!(f, "SecAlg({})", self.code),
})
}
}