INET Framework for OMNeT++/OMNEST
|
Implements a DHCP client. More...
#include <DHCPClient.h>
Public Member Functions | |
DHCPClient () | |
virtual | ~DHCPClient () |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Protected Types | |
enum | TimerType { WAIT_OFFER, WAIT_ACK, T1, T2, LEASE_TIMEOUT, START_DHCP } |
enum | ClientState { IDLE, INIT, INIT_REBOOT, REBOOTING, SELECTING, REQUESTING, BOUND, RENEWING, REBINDING } |
Protected Member Functions | |
virtual int | numInitStages () const override |
virtual void | initialize (int stage) override |
virtual void | finish () override |
virtual void | handleMessage (cMessage *msg) override |
virtual void | scheduleTimerTO (TimerType type) |
virtual void | scheduleTimerT1 () |
virtual void | scheduleTimerT2 () |
const char * | getAndCheckMessageTypeName (DHCPMessageType type) |
virtual void | refreshDisplay () const override |
virtual void | openSocket () |
virtual void | handleDHCPMessage (DHCPMessage *msg) |
virtual void | handleTimer (cMessage *msg) |
virtual void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
virtual void | sendToUDP (cPacket *msg, int srcPort, const L3Address &destAddr, int destPort) |
virtual void | sendDiscover () |
virtual void | sendRequest () |
virtual void | sendDecline (IPv4Address declinedIp) |
virtual void | recordLease (DHCPMessage *dhcpACK) |
virtual void | recordOffer (DHCPMessage *dhcpOffer) |
virtual void | bindLease () |
virtual void | unbindLease () |
virtual void | initClient () |
virtual void | initRebootedClient () |
virtual void | handleDHCPACK (DHCPMessage *msg) |
virtual InterfaceEntry * | chooseInterface () |
virtual void | startApp () |
virtual void | stopApp () |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
Perform one stage of a lifecycle operation. More... | |
Static Protected Member Functions | |
static const char * | getStateName (ClientState state) |
Protected Attributes | |
int | serverPort = -1 |
int | clientPort = -1 |
UDPSocket | socket |
simtime_t | startTime |
MACAddress | macAddress |
cModule * | host = nullptr |
InterfaceEntry * | ie = nullptr |
IIPv4RoutingTable * | irt = nullptr |
cMessage * | timerT1 = nullptr |
cMessage * | timerT2 = nullptr |
cMessage * | timerTo = nullptr |
cMessage * | leaseTimer = nullptr |
cMessage * | startTimer = nullptr |
bool | isOperational = false |
ClientState | clientState = INIT |
unsigned int | xid = 0 |
DHCPLease * | lease = nullptr |
IPv4Route * | route = nullptr |
int | numSent = 0 |
int | numReceived = 0 |
int | responseTimeout = 0 |
Implements a DHCP client.
See NED file for more details.
|
protected |
Enumerator | |
---|---|
IDLE | |
INIT | |
INIT_REBOOT | |
REBOOTING | |
SELECTING | |
REQUESTING | |
BOUND | |
RENEWING | |
REBINDING |
|
protected |
|
virtual |
|
protectedvirtual |
Referenced by handleDHCPACK().
|
protectedvirtual |
Referenced by initialize(), and startApp().
|
overrideprotectedvirtual |
|
protected |
Referenced by handleDHCPMessage().
|
staticprotected |
Referenced by refreshDisplay().
|
protectedvirtual |
Referenced by handleDHCPMessage().
|
protectedvirtual |
Referenced by handleMessage().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Perform one stage of a lifecycle operation.
Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.
Return value: true = "done"; false = "not yet done, will invoke doneCallback when done"
Implements inet::ILifecycle.
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by handleDHCPMessage(), handleTimer(), and receiveSignal().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleTimer().
|
inlineoverrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleTimer().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleDHCPACK().
|
protectedvirtual |
Referenced by handleDHCPMessage().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleDHCPACK().
|
protectedvirtual |
Referenced by handleDHCPACK().
|
protectedvirtual |
Referenced by handleDHCPMessage(), handleTimer(), initClient(), and initRebootedClient().
|
protectedvirtual |
|
protectedvirtual |
Referenced by initClient().
|
protectedvirtual |
Referenced by handleDHCPMessage(), handleTimer(), and initRebootedClient().
|
protectedvirtual |
Referenced by sendDecline(), sendDiscover(), and sendRequest().
|
protectedvirtual |
Referenced by handleOperationStage(), and initialize().
|
protectedvirtual |
Referenced by handleOperationStage().
|
protectedvirtual |
Referenced by handleDHCPMessage(), handleTimer(), and receiveSignal().
|
protected |
Referenced by initialize(), openSocket(), sendDecline(), sendDiscover(), and sendRequest().
|
protected |
Referenced by handleDHCPMessage(), handleTimer(), initClient(), initialize(), initRebootedClient(), refreshDisplay(), and sendRequest().
|
protected |
Referenced by bindLease(), and initialize().
|
protected |
Referenced by bindLease(), chooseInterface(), handleDHCPMessage(), handleOperationStage(), initialize(), receiveSignal(), sendToUDP(), startApp(), and unbindLease().
|
protected |
Referenced by bindLease(), initialize(), and unbindLease().
|
protected |
Referenced by handleDHCPMessage(), handleMessage(), handleOperationStage(), initialize(), and receiveSignal().
|
protected |
Referenced by bindLease(), handleTimer(), recordLease(), recordOffer(), scheduleTimerT1(), scheduleTimerT2(), sendRequest(), and ~DHCPClient().
|
protected |
Referenced by bindLease(), finish(), handleTimer(), initClient(), initialize(), stopApp(), unbindLease(), and ~DHCPClient().
|
protected |
Referenced by initialize(), recordOffer(), sendDecline(), sendDiscover(), and sendRequest().
|
protected |
Referenced by initialize().
|
protected |
Referenced by initialize().
|
protected |
Referenced by initialize(), and scheduleTimerTO().
|
protected |
Referenced by bindLease(), and unbindLease().
|
protected |
Referenced by initialize(), openSocket(), sendDecline(), sendDiscover(), and sendRequest().
|
protected |
Referenced by openSocket(), and sendToUDP().
|
protected |
Referenced by initialize(), and startApp().
|
protected |
Referenced by finish(), initialize(), startApp(), stopApp(), and ~DHCPClient().
|
protected |
Referenced by finish(), handleTimer(), initClient(), initialize(), scheduleTimerT1(), stopApp(), unbindLease(), and ~DHCPClient().
|
protected |
Referenced by finish(), handleTimer(), initClient(), initialize(), scheduleTimerT2(), stopApp(), unbindLease(), and ~DHCPClient().
|
protected |
Referenced by finish(), handleDHCPACK(), handleTimer(), initClient(), initialize(), scheduleTimerTO(), stopApp(), unbindLease(), and ~DHCPClient().
|
protected |
Referenced by handleDHCPMessage(), initialize(), sendDecline(), sendDiscover(), and sendRequest().