pub enum OptionCode {
Show 18 variants
Llq,
Ul,
Nsid,
Dau,
Dhu,
N3u,
ClientSubnet,
Expire,
Cookie,
TcpKeepalive,
Padding,
Chain,
KeyTag,
ExtendedError,
ClientTag,
ServerTag,
DeviceId,
Int(u16),
}
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.
Variants§
Llq
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.
Ul
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.’
Nsid
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.
Dau
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].
Dhu
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].
N3u
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].
ClientSubnet
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.
Expire
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.
Cookie
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.
TcpKeepalive
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.
Padding
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.
Chain
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.
KeyTag
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.
ExtendedError
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.
ClientTag
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.
ServerTag
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.
DeviceId
DeviceID (26946).
Ths option is used by the Cisco Umbrella network device API.
Int(u16)
A raw value given through its integer.
Implementations§
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§impl PartialEq<OptionCode> for u16
impl PartialEq<OptionCode> for u16
source§impl PartialEq<u16> for OptionCode
impl PartialEq<u16> for OptionCode
source§impl PartialEq for OptionCode
impl PartialEq for OptionCode
source§impl PartialOrd<OptionCode> for u16
impl PartialOrd<OptionCode> for u16
source§impl PartialOrd<u16> for OptionCode
impl PartialOrd<u16> for OptionCode
source§impl PartialOrd for OptionCode
impl PartialOrd for OptionCode
impl Copy for OptionCode
impl Eq 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
)