Module message

Module message 

Source
Expand description

Information sent over a UDP connection between a DHCP client and server

Structs§

AddressListOption
This represents one of several Message options that takes a list of Ipv4Addr values.
AddressOption
This represents one of several Message options that takes an Ipv4Addr value.
Encoder
Keeps track of the state of the output and provides methods to add data to the output.
File
A null-terminated string that always maps to the 128 bytes assigned to it in Message.
FileOption
Similar to the File struct, used for the fixed-length Message file field, but is a variable-length option used for the Message options field.
Flags
Wraps a bit field used in Message.
MaxMessage
This option specifies the maximum length DHCP message that it is willing to accept.
Message
Wraps all the data sent between DHCP clients and servers.
OpaqueOption
An option that contains ambiguous bytes. For example, it might be an id, with no special meaning, sent by the client.
SName
A null-terminated string that always maps to the 64 bytes assigned to it in Message.
SNameOption
Similar to the SName struct, used for the fixed-length Message sname field, but is a variable-length option used for the Message options field.
Slicer
Takes a slice as input and divides it into smaller slices. This processes the slice from start to end by user-provided len sized chunks.
Socket
A connection to a UdpSocket that understands how to send/receive Deliverable. Meant to be used by both Client and Server.
StringOption
An option that represents a string of variable length with a minimum length of 1.
TimeOffset
This type specifies the offset of the client’s subnet in seconds from Coordinated Universal Time (UTC) through an i32.
TimeOption
An option that represents seconds as a u32.
UndecodedMessage
UndecodedMessage takes a message’s byte array from the socket. It can return smaller slices that can be later decoded into a Message’s field via DecodeMessage.

Enums§

HTypes
Variants of a htype field in Message.
MessageOptions
Variants of an options field in Message. Options are also referred to as “configuration parameters”.
MessageTypes
Variants of option 53 in MessageOptions.
Ops
Variants of an op field in Message.
OverloadOptions
Variants of option 52 in MessageOptions.

Constants§

MAGIC
The first four octets of options field with values 99, 130, 83, 99

Traits§

Decodable
A supertrait that defines everything a custom message needs to be decoded after being received by a socket.
DecodeMessage
Define how the bytes of a DHCP message’s fields decode into your custom Message’s types.
Encodable
A supertrait that defines everything a custom message needs to be encoded before being sent by a socket.
EncodeMessage
Define how your custom Message type encodes itself into the bytes of a DHCP message’s fields.
MessageHelpers
Define common methods on your custom Message that a client or server will need to use.

Type Aliases§

MessageBuffer
Bytes, received from the socket, that can be decoded into a Message.