Class DHCPOptions

File: src/inet/applications/dhcp/DHCPMessage.msg

C++ definition

Represents options in a DHCP message. In the DHCP protocol, options are added to the message as tagged data items. In the simulation, this DHCPOptions class statically holds the union of all options actually used by the DHCP protocol models. Options absent from a packet are represented by empty/unfilled DHCPOptions fields.

See also: DHCPMessage, DHCPClient, DHCPServer

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Fields:

Name Type Description
messageType int

to convey the type of the DHCP message

hostName string

name of the client

parameterRequestList int[]

used by a DHCP client to request values for specified configuration parameters

clientIdentifier MACAddress

used by DHCP clients to specify their unique identifier

requestedIp IPv4Address

used in a client request (DHCPDISCOVER) to allow the client to request that a particular IP address be assigned

subnetMask IPv4Address

client's subnet mask

router IPv4Address[]

IP addresses for routers on the client's subnet

dns IPv4Address[]

list of DNSs available to the client

ntp IPv4Address[]

list of IP addresses indicating NTP servers available to the client

serverIdentifier IPv4Address

client use this field as the destination address for any unicast DHCP messages to the server

renewalTime simtime_t

time interval (T1) from address assignment until the client transitions to the RENEWING state

rebindingTime simtime_t

time interval (T2) from address assignment until the client transitions to the REBINDING state

leaseTime simtime_t

request for lease time (client), offered lease time (server)

Source code:

//
// Represents options in a DHCP message. In the DHCP protocol, options are
// added to the message as tagged data items. In the simulation, this DHCPOptions
// class statically holds the union of all options actually used by the DHCP
// protocol models. Options absent from a packet are represented by empty/unfilled
// DHCPOptions fields.
//
// @see DHCPMessage, DHCPClient, DHCPServer
//
class DHCPOptions
{
    int messageType @enum(DHCPMessageType); // to convey the type of the DHCP message
    string hostName; // name of the client
    int parameterRequestList[]; // used by a DHCP client to request values for specified configuration parameters
    MACAddress clientIdentifier; // used by DHCP clients to specify their unique identifier
    IPv4Address requestedIp; // used in a client request (DHCPDISCOVER) to allow the client to request that a particular IP address be assigned
    IPv4Address subnetMask; // client's subnet mask
    IPv4Address router[]; // IP addresses for routers on the client's subnet
    IPv4Address dns[]; // list of DNSs available to the client
    IPv4Address ntp[]; // list of IP addresses indicating NTP servers available to the client
    IPv4Address serverIdentifier; // client use this field as the destination address for any unicast DHCP messages to the server
    simtime_t renewalTime; // time interval (T1) from address assignment until the client transitions to the RENEWING state
    simtime_t rebindingTime; // time interval (T2) from address assignment until the client transitions to the REBINDING state
    simtime_t leaseTime; // request for lease time (client), offered lease time (server)
}