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
sourceimpl 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.
sourceimpl OptionCode
impl OptionCode
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Trait Implementations
sourceimpl Clone for OptionCode
impl Clone for OptionCode
sourcefn clone(&self) -> OptionCode
fn clone(&self) -> OptionCode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Compose for OptionCode
impl Compose for OptionCode
sourcefn compose<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the concrete representation of the value to the target. Read more
sourcefn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
fn compose_canonical<T: OctetsBuilder + AsMut<[u8]>>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
Appends the canonical representation of the value to the target. Read more
sourceimpl Debug for OptionCode
impl Debug for OptionCode
sourceimpl<'de> Deserialize<'de> for OptionCode
impl<'de> Deserialize<'de> for OptionCode
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for OptionCode
impl Display for OptionCode
sourceimpl<'a> From<&'a OptionCode> for u16
impl<'a> From<&'a OptionCode> for u16
sourcefn from(value: &'a OptionCode) -> Self
fn from(value: &'a OptionCode) -> Self
Converts to this type from the input type.
sourceimpl From<OptionCode> for u16
impl From<OptionCode> for u16
sourcefn from(value: OptionCode) -> Self
fn from(value: OptionCode) -> Self
Converts to this type from the input type.
sourceimpl From<u16> for OptionCode
impl From<u16> for OptionCode
sourceimpl FromStr for OptionCode
impl FromStr for OptionCode
sourceimpl Hash for OptionCode
impl Hash for OptionCode
sourceimpl Ord for OptionCode
impl Ord for OptionCode
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<Ref: AsRef<[u8]>> Parse<Ref> for OptionCode
impl<Ref: AsRef<[u8]>> Parse<Ref> for OptionCode
sourceimpl PartialEq<OptionCode> for OptionCode
impl PartialEq<OptionCode> for OptionCode
sourceimpl PartialEq<OptionCode> for u16
impl PartialEq<OptionCode> for u16
sourcefn eq(&self, other: &OptionCode) -> bool
fn eq(&self, other: &OptionCode) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialEq<u16> for OptionCode
impl PartialEq<u16> for OptionCode
sourceimpl PartialOrd<OptionCode> for OptionCode
impl PartialOrd<OptionCode> for OptionCode
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
sourceimpl PartialOrd<OptionCode> for u16
impl PartialOrd<OptionCode> for u16
sourcefn partial_cmp(&self, other: &OptionCode) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
sourceimpl PartialOrd<u16> for OptionCode
impl PartialOrd<u16> for OptionCode
sourcefn partial_cmp(&self, other: &u16) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
sourceimpl Scan for OptionCode
impl Scan for OptionCode
sourceimpl Serialize for OptionCode
impl Serialize for OptionCode
impl Copy for OptionCode
impl Eq for OptionCode
Auto Trait Implementations
impl RefUnwindSafe for OptionCode
impl Send for OptionCode
impl Sync for OptionCode
impl Unpin for OptionCode
impl UnwindSafe for OptionCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
sourcefn octets_into(self) -> Result<Target, ShortBuf>
fn octets_into(self) -> Result<Target, ShortBuf>
Performs the conversion.