Enum domain::base::iana::opt::OptionCode

source ·
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

source

pub const fn from_int(value: u16) -> Self

Returns a value from its raw integer value.

source

pub const fn to_int(self) -> u16

Returns the raw integer value for a value.

source

pub fn from_mnemonic(m: &[u8]) -> Option<Self>

Returns a value from a well-defined mnemonic.

source

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.

source

pub fn parse<'a, Octs: AsRef<[u8]> + ?Sized>( parser: &mut Parser<'a, Octs> ) -> Result<Self, ParseError>

source

pub const COMPOSE_LEN: u16 = 2u16

source

pub fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target ) -> Result<(), Target::AppendError>

source§

impl OptionCode

source

pub fn from_bytes(bytes: &[u8]) -> Option<Self>

source§

impl OptionCode

source

pub fn scan<S: Scanner>(scanner: &mut S) -> Result<Self, S::Error>

Trait Implementations§

source§

impl Clone for OptionCode

source§

fn clone(&self) -> OptionCode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OptionCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for OptionCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a OptionCode> for u16

source§

fn from(value: &'a OptionCode) -> Self

Converts to this type from the input type.
source§

impl From<OptionCode> for u16

source§

fn from(value: OptionCode) -> Self

Converts to this type from the input type.
source§

impl From<u16> for OptionCode

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl FromStr for OptionCode

§

type Err = FromStrError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for OptionCode

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for OptionCode

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<OptionCode> for OptionCode

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<OptionCode> for u16

source§

fn eq(&self, other: &OptionCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u16> for OptionCode

source§

fn eq(&self, other: &u16) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<OptionCode> for OptionCode

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<OptionCode> for u16

source§

fn partial_cmp(&self, other: &OptionCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u16> for OptionCode

source§

fn partial_cmp(&self, other: &u16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for OptionCode

source§

impl Eq for OptionCode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Source, Target> OctetsInto<Target> for Sourcewhere Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

source§

fn try_octets_into( self ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
source§

fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V