pub enum DhcpOption<'a> {
Show 14 variants
ClientId(&'a [u8]),
ServerId(&'a [u8]),
Iana(IanaSerializer<'a>),
IaAddr(IaAddrSerializer<'a>),
Oro(&'a [OptionCode]),
Preference(u8),
ElapsedTime(u16),
StatusCode(u16, &'a str),
IaPd(IaPdSerializer<'a>),
IaPrefix(IaPrefixSerializer<'a>),
InformationRefreshTime(u32),
SolMaxRt(u32),
DnsServers(&'a [Ipv6Addr]),
DomainList(&'a [Domain]),
}
Expand description
A serializable DHCPv6 option.
Options that are not found in this type are currently not supported. An exhaustive list of options can be found here.
Variants§
ClientId(&'a [u8])
ServerId(&'a [u8])
Iana(IanaSerializer<'a>)
IaAddr(IaAddrSerializer<'a>)
Oro(&'a [OptionCode])
Preference(u8)
ElapsedTime(u16)
StatusCode(u16, &'a str)
IaPd(IaPdSerializer<'a>)
IaPrefix(IaPrefixSerializer<'a>)
InformationRefreshTime(u32)
SolMaxRt(u32)
DnsServers(&'a [Ipv6Addr])
DomainList(&'a [Domain])
Implementations§
Source§impl DhcpOption<'_>
impl DhcpOption<'_>
Sourcepub fn code(&self) -> OptionCode
pub fn code(&self) -> OptionCode
Returns the corresponding option code for the calling option.
Trait Implementations§
Source§impl<'a> Debug for DhcpOption<'a>
impl<'a> Debug for DhcpOption<'a>
Source§impl<'a> RecordBuilder for DhcpOption<'a>
impl<'a> RecordBuilder for DhcpOption<'a>
Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Calculates the serialized length of the option based on option format defined in RFC 8415, Section 21.1.
For variable length options that exceeds the size limit (u16::MAX
),
fallback to a default value.
Source§fn serialize_into(&self, buf: &mut [u8])
fn serialize_into(&self, buf: &mut [u8])
Serializes an option and appends to input buffer based on option format defined in RFC 8415, Section 21.1.
For variable length options that exceeds the size limit (u16::MAX
),
fallback to use a default value instead, so it is impossible for future
changes to introduce DoS vulnerabilities even if they accidentally allow
such options to be injected.
§Panics
serialize_into
panics if buf
is too small to hold the serialized
form of self
.