Enum dhcp_protocol::DhcpOption

source ·
pub enum DhcpOption {
Show 76 variants Pad(), End(), SubnetMask(PrefixLength<Ipv4>), TimeOffset(i32), Router(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), TimeServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), NameServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), DomainNameServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), LogServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), CookieServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), LprServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), ImpressServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), ResourceLocationServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), HostName(String), BootFileSize(u16), MeritDumpFile(String), DomainName(String), SwapServer(Ipv4Addr), RootPath(String), ExtensionsPath(String), IpForwarding(bool), NonLocalSourceRouting(bool), PolicyFilter(AtLeast<2, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), MaxDatagramReassemblySize(u16), DefaultIpTtl(NonZeroU8), PathMtuAgingTimeout(u32), PathMtuPlateauTable(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u16>>>), InterfaceMtu(u16), AllSubnetsLocal(bool), BroadcastAddress(Ipv4Addr), PerformMaskDiscovery(bool), MaskSupplier(bool), PerformRouterDiscovery(bool), RouterSolicitationAddress(Ipv4Addr), StaticRoute(AtLeast<2, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), TrailerEncapsulation(bool), ArpCacheTimeout(u32), EthernetEncapsulation(bool), TcpDefaultTtl(NonZeroU8), TcpKeepaliveInterval(u32), TcpKeepaliveGarbage(bool), NetworkInformationServiceDomain(String), NetworkInformationServers(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), NetworkTimeProtocolServers(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), VendorSpecificInformation(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u8>>>), NetBiosOverTcpipNameServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), NetBiosOverTcpipDatagramDistributionServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), NetBiosOverTcpipNodeType(NodeType), NetBiosOverTcpipScope(String), XWindowSystemFontServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), XWindowSystemDisplayManager(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), NetworkInformationServicePlusDomain(String), NetworkInformationServicePlusServers(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), MobileIpHomeAgent(AtLeast<0, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), SmtpServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), Pop3Server(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), NntpServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), DefaultWwwServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), DefaultFingerServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), DefaultIrcServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), StreetTalkServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), StreetTalkDirectoryAssistanceServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>), RequestedIpAddress(Ipv4Addr), IpAddressLeaseTime(u32), OptionOverload(Overload), TftpServerName(String), BootfileName(String), DhcpMessageType(MessageType), ServerIdentifier(Ipv4Addr), ParameterRequestList(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<OptionCode>>>), Message(String), MaxDhcpMessageSize(u16), RenewalTimeValue(u32), RebindingTimeValue(u32), VendorClassIdentifier(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u8>>>), ClientIdentifier(AtLeast<{ CLIENT_IDENTIFIER_MINIMUM_LENGTH }, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u8>>>),
}
Expand description

A DHCP Option as defined in RFC 2132. DHCP Options provide a mechanism for transmitting configuration parameters between the Server and Client and vice-versa. DHCP Options also include some control and meta information needed for the operation of the DHCP protocol but which could not be included in the DHCP header because of the backwards compatibility requirement with the older BOOTP protocol.

Variants§

§

Pad()

§

End()

§

SubnetMask(PrefixLength<Ipv4>)

§

TimeOffset(i32)

§

Router(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

TimeServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

NameServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

DomainNameServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

LogServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

CookieServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

LprServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

ImpressServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

ResourceLocationServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

HostName(String)

§

BootFileSize(u16)

§

MeritDumpFile(String)

§

DomainName(String)

§

SwapServer(Ipv4Addr)

§

RootPath(String)

§

ExtensionsPath(String)

§

IpForwarding(bool)

§

NonLocalSourceRouting(bool)

§

PolicyFilter(AtLeast<2, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

MaxDatagramReassemblySize(u16)

§

DefaultIpTtl(NonZeroU8)

§

PathMtuAgingTimeout(u32)

§

PathMtuPlateauTable(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u16>>>)

§

InterfaceMtu(u16)

§

AllSubnetsLocal(bool)

§

BroadcastAddress(Ipv4Addr)

§

PerformMaskDiscovery(bool)

§

MaskSupplier(bool)

§

PerformRouterDiscovery(bool)

§

RouterSolicitationAddress(Ipv4Addr)

§

StaticRoute(AtLeast<2, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

TrailerEncapsulation(bool)

§

ArpCacheTimeout(u32)

§

EthernetEncapsulation(bool)

§

TcpDefaultTtl(NonZeroU8)

§

TcpKeepaliveInterval(u32)

§

TcpKeepaliveGarbage(bool)

§

NetworkInformationServiceDomain(String)

§

NetworkInformationServers(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

NetworkTimeProtocolServers(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

VendorSpecificInformation(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u8>>>)

§

NetBiosOverTcpipNameServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

NetBiosOverTcpipDatagramDistributionServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

NetBiosOverTcpipNodeType(NodeType)

§

NetBiosOverTcpipScope(String)

§

XWindowSystemFontServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

XWindowSystemDisplayManager(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

NetworkInformationServicePlusDomain(String)

§

NetworkInformationServicePlusServers(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

MobileIpHomeAgent(AtLeast<0, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

SmtpServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

Pop3Server(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

NntpServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

DefaultWwwServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

DefaultFingerServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

DefaultIrcServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

StreetTalkServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

StreetTalkDirectoryAssistanceServer(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<Ipv4Addr>>>)

§

RequestedIpAddress(Ipv4Addr)

§

IpAddressLeaseTime(u32)

§

OptionOverload(Overload)

§

TftpServerName(String)

§

BootfileName(String)

§

DhcpMessageType(MessageType)

§

ServerIdentifier(Ipv4Addr)

§

ParameterRequestList(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<OptionCode>>>)

§

Message(String)

According to RFC 2132 section 9.9, “The message consists of n octets of NVT ASCII text, which the client may display on an available output device”. According to RFC 3629 section 1, UTF-8 preserves US-ASCII octets.

While it’s somewhat ambiguous from RFC 854 whether “NVT ASCII” includes the non-standard-7-bit-ASCII control codes or not, RFC 698 states that “it is expected normal NVT ASCII would be used for 7-bit ASCII”, suggesting that NVT ASCII does designate only the US-ASCII-compatible subset of characters that can be output by NVT terminals.

Thus, it is safe to represent incoming Message options as a UTF-8 String and discard Message options that cannot be represented in UTF-8.

However, outgoing Message options (e.g. ones written by a DHCP server implemented using this library) must be careful to use only ASCII text rather than full UTF-8.

§

MaxDhcpMessageSize(u16)

§

RenewalTimeValue(u32)

§

RebindingTimeValue(u32)

§

VendorClassIdentifier(AtLeast<1, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u8>>>)

§

ClientIdentifier(AtLeast<{ CLIENT_IDENTIFIER_MINIMUM_LENGTH }, AtMostBytes<{ size_constrained::U8_MAX_AS_USIZE }, Vec<u8>>>)

Implementations§

source§

impl DhcpOption

source

pub fn code(&self) -> OptionCode

Returns the OptionCode variant corresponding to self.

Trait Implementations§

source§

impl Clone for DhcpOption

source§

fn clone(&self) -> DhcpOption

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for DhcpOption

source§

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

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

impl<'de> Deserialize<'de> for DhcpOption

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 FidlCompatible<Option_> for DhcpOption

source§

impl Hash for DhcpOption

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for DhcpOption

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for DhcpOption

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 Eq for DhcpOption

source§

impl StructuralPartialEq for DhcpOption

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

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

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

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

§

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>,

§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

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