packet_formats_dhcp::v6

Enum DhcpOption

Source
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<'_>

Source

pub fn code(&self) -> OptionCode

Returns the corresponding option code for the calling option.

Trait Implementations§

Source§

impl<'a> Debug for DhcpOption<'a>

Source§

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

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

impl<'a> RecordBuilder for DhcpOption<'a>

Source§

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])

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.

Auto Trait Implementations§

§

impl<'a> Freeze for DhcpOption<'a>

§

impl<'a> RefUnwindSafe for DhcpOption<'a>

§

impl<'a> Send for DhcpOption<'a>

§

impl<'a> Sync for DhcpOption<'a>

§

impl<'a> Unpin for DhcpOption<'a>

§

impl<'a> UnwindSafe for DhcpOption<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.