MessageOptions

Enum MessageOptions 

Source
pub enum MessageOptions {
Show 26 variants Pad, Netmask(AddressOption), TimeOffset(TimeOffset), Router(AddressListOption), DnsServer(AddressListOption), HostName(StringOption), DomainName(StringOption), Broadcast(AddressOption), RequestedIp(AddressOption), LeaseTime(TimeOption), Overload(OverloadOptions), MessageType(MessageTypes), ServerIdentifier(AddressOption), RequestedOptions(Vec<u8>), Message(StringOption), MaxMessage(MaxMessage), T1(TimeOption), T2(TimeOption), VendorId(OpaqueOption), ClientId(OpaqueOption), SName(SNameOption), FileName(FileOption), RapidCommit, SubnetSelect(AddressOption), End, Other(u8, u8, Vec<u8>),
}
Expand description

Variants of an options field in Message. Options are also referred to as “configuration parameters”.

Most options are documented in RFC-2132 unless noted otherwise.

Variants§

§

Pad

0

§

Netmask(AddressOption)

1

§

TimeOffset(TimeOffset)

2, Deprecated by options 100 and 101 in RFC-4833

§

Router(AddressListOption)

3

§

DnsServer(AddressListOption)

6

§

HostName(StringOption)

12 See RFC 1035 for character set restrictions.

§

DomainName(StringOption)

15

§

Broadcast(AddressOption)

28

§

RequestedIp(AddressOption)

50

§

LeaseTime(TimeOption)

51

Number of seconds an ip assignment is valid for. A client may use this option in a Discover or Request MessageType. A server may use this option in a Offer MessageType.

§

Overload(OverloadOptions)

52

§

MessageType(MessageTypes)

53

§

ServerIdentifier(AddressOption)

54

§

RequestedOptions(Vec<u8>)

55

§

Message(StringOption)

56

§

MaxMessage(MaxMessage)

57

§

T1(TimeOption)

58

§

T2(TimeOption)

59

§

VendorId(OpaqueOption)

60

§

ClientId(OpaqueOption)

61

§

SName(SNameOption)

66, variable length unlike the fixed Message field

§

FileName(FileOption)

67, variable length unlike the fixed Message field

§

RapidCommit

80, RFC-4039

Used to assign an IP through a faster 2-message (Discover-Ack) exchange instead of the traditional 4-message (Discover-Offer-Request-Ack) exchange.

Warning: A client broadcasts its Discover message, so multiple DHCP servers on the same subnet might receive it. In such a scenario:

  • A 4-message exchange Requests an IP address from one of the DHCP servers.
  • A 2-message exchange would commit an IP address from each DHCP server.

A client may use this option only in a Discover MessageType. A server may use this option only in an Ack MessageType.

§

SubnetSelect(AddressOption)

118, RFC-3011

§

End

255

§

Other(u8, u8, Vec<u8>)

Unknown option

Implementations§

Source§

impl MessageOptions

Source

pub fn to_tag(&self) -> u8

Converts a MessageOption’s enum to a u8 that describes the “T” (tag) in “TLV” (tag-length-value)

Source

pub fn extend_into(&self, bytes: &mut Vec<u8>)

for use when encoding a collection of options into bytes

Source

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

Takes an array slice and parses the TLV sub-format

Trait Implementations§

Source§

impl Clone for MessageOptions

Source§

fn clone(&self) -> MessageOptions

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MessageOptions

Source§

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

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

impl<'de> Deserialize<'de> for MessageOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MessageOptions

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MessageOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MessageOptions

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,