use crate::rfc5389::attributes::ErrorCode;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct AddressFamilyNotSupported;
impl AddressFamilyNotSupported {
pub const CODEPOINT: u16 = 440;
}
impl From<AddressFamilyNotSupported> for ErrorCode {
fn from(_: AddressFamilyNotSupported) -> Self {
ErrorCode::new(
AddressFamilyNotSupported::CODEPOINT,
"Address Family not Supported".to_string(),
)
.expect("never fails")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct PeerAddressFamilyMismatch;
impl PeerAddressFamilyMismatch {
pub const CODEPOINT: u16 = 443;
}
impl From<PeerAddressFamilyMismatch> for ErrorCode {
fn from(_: PeerAddressFamilyMismatch) -> Self {
ErrorCode::new(
PeerAddressFamilyMismatch::CODEPOINT,
"Peer Address Family Mismatch".to_owned(),
)
.expect("never fails")
}
}