pub struct OptionCode(/* private fields */);
Expand description
DNS EDNS0 option codes.
The record data of OPT records is a sequence of options. The type of each of these options is given through a 16 bit value called option code.
The currently assigned option codes can be found in the IANA registry. The type is complete as of 2019-12-23.
Implementations§
Source§impl OptionCode
impl OptionCode
Sourcepub const LLQ: OptionCode
pub const LLQ: OptionCode
Long-Lived Queries (LLQ, 1).
Long-Lived Queries is a protocol developed by Apple for change notifications. It is now being replaced by DNS Push Notifications. The LLQ options is used in LLQ messages.
This option code and the LLQ option are defined in a upcoming RFC, currently draft-sekar-dns-llq.
Sourcepub const UL: OptionCode
pub const UL: OptionCode
Update lease (UL, 2).
This option was proposed in a draft as a way to state lease times for registrations made via DNS UPDATE. Its draft, draft-sekar-dns-ul, has since expired. The code is considered ‘on hold.’
Sourcepub const NSID: OptionCode
pub const NSID: OptionCode
Name server identifier (NSID, 3).
The NSID option allows a name server to include an indentifier in an answer for diagnostic purposes. The options in defined in RFC 5001.
Sourcepub const DAU: OptionCode
pub const DAU: OptionCode
DNSSEC algorithm understood (DAU, 5).
The DAU option allows a validating resolver to signal a queried server which DNSSEC signing algorithms it understands. The option is defined in [RFC 6975].
Sourcepub const DHU: OptionCode
pub const DHU: OptionCode
DS hash understood (DHU, 6).
The DHU option allows a validating resolver to signal a queried server which DS hash algorithms it understands. The option is defined in [RFC 6975].
Sourcepub const N3U: OptionCode
pub const N3U: OptionCode
NSEC3 hash understood (N3U, 7).
The DHU option allows a validating resolver to signal a queried server which NSEC3 hash algorithms it understands. The option is defined in [RFC 6975].
Sourcepub const CLIENT_SUBNET: OptionCode
pub const CLIENT_SUBNET: OptionCode
EDNS client subnet (8),
The EDSN client subnet option allows a resolver to identify the IP address subnet it queries from so that a server can determine the best answer. This option is defined in RFC 7871.
Sourcepub const EXPIRE: OptionCode
pub const EXPIRE: OptionCode
Expire (9).
The expire option allows a secondary to maintain the correct expiry time for a zone when transferring from a server other than the primary. The option is defined in RFC 7314.
Sourcepub const COOKIE: OptionCode
pub const COOKIE: OptionCode
DNS Cookie (10).
The cookie option allows clients and server to exchange session cookies as a mechanism for protecting agains denial-of-service and amplification attacks. The option is defined in RFC 7873.
Sourcepub const TCP_KEEPALIVE: OptionCode
pub const TCP_KEEPALIVE: OptionCode
edns-tcp-keepalive (11).
This option allows DNS servers to signal to a client for how long they may hold open a TCP connection. The option is defined in RFC 7828.
Sourcepub const PADDING: OptionCode
pub const PADDING: OptionCode
Padding (12).
The padding option allows clients and servers to pad their messages with extra data to make it harder to guess content based on length. The option is defined in RFC 7830.
Sourcepub const CHAIN: OptionCode
pub const CHAIN: OptionCode
CHAIN query requests (13).
The CHAIN query requests option allows a security-aware resolver to all ask a server to include records necessary for DNSSEC validation of the answer. The option is defined in RFC 7901.
Sourcepub const KEY_TAG: OptionCode
pub const KEY_TAG: OptionCode
EDNS key tag (14).
The key tag option allows a client to signal to a server which DNSSEC key they would use to validate an asnwer. The option is defined in RFC 8145.
Sourcepub const EXTENDED_ERROR: OptionCode
pub const EXTENDED_ERROR: OptionCode
Extended DNS Error (15).
This option allows the server to return additional information about the cause of DNS errors. It does not change the processing of RCODEs. The option is defined in RFC 8914.
Sourcepub const CLIENT_TAG: OptionCode
pub const CLIENT_TAG: OptionCode
EDNS client tag (16).
The client tag option allows a client to send arbitrary additional data to a server. The option is defined in the now expired draft-bellis-dnsop-edns-tags.
Sourcepub const SERVER_TAG: OptionCode
pub const SERVER_TAG: OptionCode
EDNS server tag (16).
The client tag option allows a server to send arbitrary additional data to a client. The option is defined in the now expired draft-bellis-dnsop-edns-tags.
Sourcepub const DEVICE_ID: OptionCode
pub const DEVICE_ID: OptionCode
DeviceID (26946).
Ths option is used by the Cisco Umbrella network device API.
Source§impl OptionCode
impl OptionCode
pub const COMPOSE_LEN: u16 = 2u16
Sourcepub fn from_mnemonic(m: &[u8]) -> Option<Self>
pub fn from_mnemonic(m: &[u8]) -> Option<Self>
Returns a value from a well-defined mnemonic.
Sourcepub const fn to_mnemonic(self) -> Option<&'static [u8]>
pub const fn to_mnemonic(self) -> Option<&'static [u8]>
Returns the mnemonic for this value if there is one.
This will also return a mnemonic if a well-defined variant
is hidden in a Int
variant.
Sourcepub const fn to_mnemonic_str(self) -> Option<&'static str>
pub const fn to_mnemonic_str(self) -> Option<&'static str>
Returns the mnemonic as a &str
for this value if there is one
pub fn parse<'a, Octs: AsRef<[u8]> + ?Sized>( parser: &mut Parser<'a, Octs>, ) -> Result<Self, ParseError>
pub fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Source§impl OptionCode
impl OptionCode
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Trait Implementations§
Source§impl Clone for OptionCode
impl Clone for OptionCode
Source§fn clone(&self) -> OptionCode
fn clone(&self) -> OptionCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OptionCode
impl Debug for OptionCode
Source§impl Display for OptionCode
impl Display for OptionCode
Source§impl<'a> From<&'a OptionCode> for u16
impl<'a> From<&'a OptionCode> for u16
Source§fn from(value: &'a OptionCode) -> Self
fn from(value: &'a OptionCode) -> Self
Source§impl From<OptionCode> for u16
impl From<OptionCode> for u16
Source§fn from(value: OptionCode) -> Self
fn from(value: OptionCode) -> Self
Source§impl From<u16> for OptionCode
impl From<u16> for OptionCode
Source§impl FromStr for OptionCode
impl FromStr for OptionCode
Source§impl Hash for OptionCode
impl Hash for OptionCode
Source§impl Ord for OptionCode
impl Ord for OptionCode
Source§fn cmp(&self, other: &OptionCode) -> Ordering
fn cmp(&self, other: &OptionCode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OptionCode
impl PartialEq for OptionCode
Source§impl PartialOrd for OptionCode
impl PartialOrd for OptionCode
Source§impl ZonefileFmt for OptionCode
impl ZonefileFmt for OptionCode
Source§fn fmt(&self, p: &mut impl Formatter) -> Result
fn fmt(&self, p: &mut impl Formatter) -> Result
fmt::Formatter
Read more