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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more