toe-beans 0.10.0

DHCP library, client, and server
Documentation
mod address;
mod address_list;
mod file;
mod max_message;
mod mtypes;
mod opaque;
mod options;
mod overload_options;
mod sname;
mod string;
mod time;
mod time_offset;

pub use self::address::*;
pub use self::address_list::*;
pub use self::file::*;
pub use self::max_message::*;
pub use self::mtypes::*;
pub use self::opaque::*;
pub use self::options::*;
pub use self::overload_options::*;
pub use self::sname::*;
pub use self::string::*;
pub use self::time::*;
pub use self::time_offset::*;

/// The amount of bytes in a message used for the magic portion of the options field.
pub const MAGIC_SIZE: usize = 4;
/// The amount of bytes in a message used for the options field minus the magic bytes.
pub const NON_MAGIC_SIZE: usize = 308; // aside: does the word "magic" have an antonym?

/// "A DHCP client must be prepared to receive DHCP messages with an options
/// field of at least length 312 octets"
pub const MIN_OPTIONS_SIZE: usize = MAGIC_SIZE + NON_MAGIC_SIZE;

/// A type alias for an array of magic bytes
pub type MagicBuffer = [u8; MAGIC_SIZE];

/// The first four octets of options field with values 99, 130, 83, 99
pub const MAGIC: MagicBuffer = [99, 130, 83, 99];

/// A type alias for an array of option bytes (minus magic)
pub type OptionsBuffer = [u8; NON_MAGIC_SIZE];