DhcpOption

Enum DhcpOption 

Source
pub enum DhcpOption<'a> {
Show 22 variants ClientIdentifier(&'a [u8]), ServerIdentifier(&'a [u8]), IaNa(IaNa<'a>), IaTa(IaTa<'a>), IaAddress(IaAddress<'a>), OptionRequest(OptionRequest<'a>), Preference(u8), ElapsedTime(u16), RelayMessage(&'a [u8]), ServerUnicast(&'a Addr), RapidCommit, UserClass(&'a [u8]), InterfaceId(&'a [u8]), ReconfigureMessage(MessageType), ReconfigureAccept, StatusCode(StatusCode, &'a [u8]), IaPd(IaPd<'a>), IaPrefix(IaPrefix<'a>), InformationRefreshTime(u32), RelayAgentEchoRequest(&'a [u8]), ClientLinkLayerAddress(&'a [u8]), Other(u16, &'a [u8]),
}
Expand description

DHCPv6 option.

Some option variants may only be encapsulated in sub-option fields of specific options.

Variants§

§

ClientIdentifier(&'a [u8])

Client Identifier

Used to carry a DUID that identifies the client.

§

ServerIdentifier(&'a [u8])

Server Identifier

Used to carry a DUID that identifies the server.

§

IaNa(IaNa<'a>)

Identity Association for Non-temporary Addresses

§

IaTa(IaTa<'a>)

§

IaAddress(IaAddress<'a>)

§

OptionRequest(OptionRequest<'a>)

§

Preference(u8)

Preference

§

ElapsedTime(u16)

Elapsed Time

The amount of time in hundredths of a second, since the client began its current DHCP transaction.

§

RelayMessage(&'a [u8])

Relay Message

Carries a DHCP message in a Relay-forward or Relay-reply message.

§

ServerUnicast(&'a Addr)

§

RapidCommit

§

UserClass(&'a [u8])

§

InterfaceId(&'a [u8])

§

ReconfigureMessage(MessageType)

§

ReconfigureAccept

§

StatusCode(StatusCode, &'a [u8])

Status Code

The status-message is a UTF-8 encoded string that is not null-terminated.

§

IaPd(IaPd<'a>)

§

IaPrefix(IaPrefix<'a>)

§

InformationRefreshTime(u32)

Information Refresh Time

The value u32::MAX is taken to mean “infinity”.

§

RelayAgentEchoRequest(&'a [u8])

§

ClientLinkLayerAddress(&'a [u8])

DHCPv6 Client Link-Layer Address

See: RFC6939

§

Other(u16, &'a [u8])

Implementations§

Source§

impl<'a> DhcpOption<'a>

Source

pub fn code(&self) -> u16

Returns the option code.

Source

pub fn length(&self) -> Result<u16, Error>

Returns the value of the ‘option-len’ field.

Source

pub fn write(&self, writer: impl Write) -> Result<()>

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

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.