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§
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
impl MessageOptions
Sourcepub fn to_tag(&self) -> u8
pub fn to_tag(&self) -> u8
Converts a MessageOption’s enum to a u8 that describes the “T” (tag) in “TLV” (tag-length-value)
Sourcepub fn extend_into(&self, bytes: &mut Vec<u8>)
pub fn extend_into(&self, bytes: &mut Vec<u8>)
for use when encoding a collection of options into bytes
Sourcepub fn from_bytes(bytes: &[u8]) -> Vec<Self>
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
impl Clone for MessageOptions
Source§fn clone(&self) -> MessageOptions
fn clone(&self) -> MessageOptions
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageOptions
impl Debug for MessageOptions
Source§impl<'de> Deserialize<'de> for MessageOptions
impl<'de> Deserialize<'de> for MessageOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MessageOptions
impl PartialEq for MessageOptions
Source§impl Serialize for MessageOptions
impl Serialize for MessageOptions
impl StructuralPartialEq for MessageOptions
Auto Trait Implementations§
impl Freeze for MessageOptions
impl RefUnwindSafe for MessageOptions
impl Send for MessageOptions
impl Sync for MessageOptions
impl Unpin for MessageOptions
impl UnwindSafe for MessageOptions
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)