Package: inet.applications.dhcp
DhcpServer
simple moduleImplements the DHCP server protocol. DHCP (Dynamic Host Configuration Protocol), described in RFC 2131, provides configuration parameters to Internet hosts. Requires UDP.
See also: DhcpClient, DhcpMessage
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string |
the path to the InterfaceTable module |
|
interface | string | "" |
interface to listen on; can be left empty if there is only one non-loopback interface |
numReservedAddresses | int |
number of addresses to skip at the start of the network's address range |
|
maxNumClients | int |
maximum number of clients (IPs) allowed to be leased |
|
gateway | string | "" |
gateway to assign, if empty use the interface address |
leaseTime | int |
lease time in seconds |
|
startTime | double | 0s |
application start time |
stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
Properties
Name | Value | Description |
---|---|---|
display | i=block/app2 | |
lifecycleSupport |
Gates
Name | Direction | Size | Description |
---|---|---|---|
socketIn | input | ||
socketOut | output |
Scheduled messages (observed)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
omnetpp::cMessage | 0 | Start DHCP server |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
ScenarioManager | inet::ScenarioManager::moduleOperationStageCompleted | moduleOperationStageCompleted |
InterfaceTable | inet::InterfaceTable::findInterfaceByName | findInterfaceByName |
Called methods (observed)
function | info | call from |
---|---|---|
inet::DhcpServer::handleOperationStage | handleOperationStage | ScenarioManager |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
socketIn | Indication | 2 (UdpStatusInd::UDP_I_SOCKET_CLOSED) | UdpSocketClosedIndication | Udp | SocketInd |
socketIn | Packet | 0 (UdpStatusInd::UDP_I_DATA) | Udp | DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, MacAddressInd, NetworkProtocolInd, SocketInd, TosInd, TransportProtocolInd |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
socketOut | Packet | 0 (UdpCommandCode::UDP_C_DATA) | Udp | DispatchProtocolReq, InterfaceReq, L3AddressReq, L4PortReq, SocketReq | |
socketOut | Request | 1 (UdpCommandCode::UDP_C_BIND) | UdpBindCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 3 (UdpCommandCode::UDP_C_SETOPTION) | UdpSetBroadcastCommand | Udp | DispatchProtocolReq, SocketReq |
socketOut | Request | 4 (UdpCommandCode::UDP_C_CLOSE) | UdpCloseCommand | Udp | DispatchProtocolReq, SocketReq |
Packet operations (observed)
chunkType | packetAction |
---|---|
DhcpMessage | insertAtBack, peekAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolReq | addTagIfAbsent |
InterfaceInd | getTag |
InterfaceReq | addTagIfAbsent |
L3AddressReq | addTagIfAbsent |
L4PortReq | addTagIfAbsent |
SocketInd | findTag |
SocketReq | addTagIfAbsent |
Tagging operations (observed)
tagType | tagAction |
---|---|
inet::Ipv4InterfaceData | getTag |
Source code
// // Implements the DHCP server protocol. DHCP (Dynamic Host Configuration Protocol), // described in RFC 2131, provides configuration parameters to Internet hosts. // Requires UDP. // // @see ~DhcpClient, ~DhcpMessage // simple DhcpServer like IApp { parameters: string interfaceTableModule; // the path to the InterfaceTable module string interface = default(""); // interface to listen on; can be left empty if there is only one non-loopback interface int numReservedAddresses; // number of addresses to skip at the start of the network's address range int maxNumClients; // maximum number of clients (IPs) allowed to be leased string gateway = default(""); // gateway to assign, if empty use the interface address int leaseTime @unit(s); // lease time in seconds double startTime @unit(s) = default(0s); // application start time @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 gates: input socketIn @labels(UdpControlInfo/up); output socketOut @labels(UdpControlInfo/down); }File: src/inet/applications/dhcp/DhcpServer.ned