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
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.
pub fn parse<'a, Octs: AsRef<[u8]> + ?Sized>( parser: &mut Parser<'a, Octs>, ) -> Result<Self, ParseError>
pub const COMPOSE_LEN: u16 = 2u16
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
impl Copy for OptionCode
impl Eq for OptionCode
impl StructuralPartialEq for OptionCode
Auto Trait Implementations§
impl Freeze for OptionCode
impl RefUnwindSafe for OptionCode
impl Send for OptionCode
impl Sync for OptionCode
impl Unpin for OptionCode
impl UnwindSafe for OptionCode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)