DhcpClient¶
Package: inet.applications.dhcp
simple module DhcpClient
Implements the DHCP client protocol. DHCP (Dynamic Host Configuration Protocol), described in RFC 2131, provides configuration parameters to Internet hosts. Requires UDP.
See also: DhcpServer, DhcpMessage
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“{clientStateName}” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
interfaceTableModule |
string |
Path to the InterfaceTable module |
|
routingTableModule |
string |
Path to the Ipv4RoutingTable module |
|
interface |
string |
“” |
Which NIC should be configured (i.e. wlan0, eth1 etc.) |
startTime |
double |
0s |
Starting time of DHCP initialization |
stopOperationExtraTime |
double |
-1s |
Extra time after lifecycle stop operation finished |
stopOperationTimeout |
double |
2s |
Timeout value for lifecycle stop operation |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
DhcpClient |
|
display |
i=block/app2 |
|
lifecycleSupport |
||
selfMessageKinds |
inet::DhcpTimerType |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
socketIn |
input |
||
socketOut |
output |
Source code¶
//
// Implements the DHCP client protocol. DHCP (Dynamic Host Configuration Protocol),
// described in RFC 2131, provides configuration parameters to Internet hosts.
// Requires UDP.
//
// @see ~DhcpServer, ~DhcpMessage
//
simple DhcpClient extends SimpleModule like IApp
{
parameters:
@class(DhcpClient);
string interfaceTableModule; // Path to the InterfaceTable module
string routingTableModule; // Path to the Ipv4RoutingTable module
string interface = default(""); // Which NIC should be configured (i.e. wlan0, eth1 etc.)
double startTime @unit(s) = default(0s); // Starting time of DHCP initialization
displayStringTextFormat = default("{clientStateName}");
@display("i=block/app2");
@lifecycleSupport;
double stopOperationExtraTime @unit(s) = default(-1s); // Extra time after lifecycle stop operation finished
double stopOperationTimeout @unit(s) = default(2s); // Timeout value for lifecycle stop operation
@selfMessageKinds(inet::DhcpTimerType);
gates:
input socketIn @labels(UdpCommand/up);
output socketOut @labels(UdpCommand/down);
}