A Discrete-Event Network Simulator
API
ns3::DhcpClient Class Reference

Implements the functionality of a DHCP client. More...

#include "dhcp-client.h"

+ Inheritance diagram for ns3::DhcpClient:
+ Collaboration diagram for ns3::DhcpClient:

Public Member Functions

 DhcpClient ()
 
 DhcpClient (Ptr< NetDevice > netDevice)
 Constructor. More...
 
virtual ~DhcpClient ()
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
Ptr< NetDeviceGetDhcpClientNetDevice (void)
 Get the the NetDevice DHCP should work on. More...
 
Ipv4Address GetDhcpServer (void)
 Get the IPv4Address of current DHCP server. More...
 
void SetDhcpClientNetDevice (Ptr< NetDevice > netDevice)
 Set the NetDevice DHCP should work on. More...
 
- Public Member Functions inherited from ns3::Application
 Application ()
 
virtual ~Application ()
 
Ptr< NodeGetNode () const
 
void SetNode (Ptr< Node > node)
 
void SetStartTime (Time start)
 Specify application start time. More...
 
void SetStopTime (Time stop)
 Specify application stop time. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject () const
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Application
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual void DoDispose (void)
 Destructor implementation. More...
 
- Protected Member Functions inherited from ns3::Application
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Private Types

enum  States { WAIT_OFFER = 1, REFRESH_LEASE = 2, WAIT_ACK = 9 }
 client states More...
 

Private Member Functions

void AcceptAck (DhcpHeader header, Address from)
 Receives the DHCP ACK and configures IP address of the client. More...
 
void Boot (void)
 Sends DHCP DISCOVER and changes the client state to WAIT_OFFER. More...
 
void LinkStateHandler (void)
 Handles changes in LinkState. More...
 
void NetHandler (Ptr< Socket > socket)
 Handles incoming packets from the network. More...
 
void OfferHandler (DhcpHeader header)
 Stores DHCP offers in m_offerList. More...
 
void RemoveAndStart ()
 Remove the current DHCP information and restart the process. More...
 
void Request (void)
 Sends the DHCP REQUEST message and changes the client state to WAIT_ACK. More...
 
void Select (void)
 Selects an OFFER from m_offerList. More...
 
virtual void StartApplication (void)
 Application specific startup code. More...
 
virtual void StopApplication (void)
 Application specific shutdown code. More...
 

Private Attributes

Address m_chaddr
 chaddr of the interface (stored as an Address for convenience). More...
 
Time m_collect
 Time for which client should collect offers. More...
 
EventId m_collectEvent
 Offer collection event. More...
 
Ptr< NetDevicem_device
 NetDevice pointer. More...
 
EventId m_discoverEvent
 Message retransmission event. More...
 
TracedCallback< const Ipv4Address & > m_expiry
 Trace of lease expire. More...
 
bool m_firstBoot
 First boot (used to add the link state change callback) More...
 
Ipv4Address m_gateway
 Address of the gateway. More...
 
Time m_lease
 Store the lease time of address. More...
 
Ipv4Address m_myAddress
 Address assigned to the client. More...
 
Ipv4Mask m_myMask
 Mask of the address assigned. More...
 
TracedCallback< const Ipv4Address & > m_newLease
 Trace of new lease. More...
 
Time m_nextoffer
 Time to try the next offer (if request gets no reply) More...
 
EventId m_nextOfferEvent
 Message next offer event. More...
 
bool m_offered
 Specify if the client has got any offer. More...
 
Ipv4Address m_offeredAddress
 Address offered to the client. More...
 
std::list< DhcpHeaderm_offerList
 Stores all the offers given to the client. More...
 
Ptr< RandomVariableStreamm_ran
 Uniform random variable for transaction ID. More...
 
Time m_rebind
 Store the rebind time of address. More...
 
EventId m_rebindEvent
 Message rebind event. More...
 
EventId m_refreshEvent
 Message refresh event. More...
 
Ipv4Address m_remoteAddress
 Initially set to 255.255.255.255 to start DHCP. More...
 
Time m_renew
 Store the renew time of address. More...
 
EventId m_requestEvent
 Address refresh event. More...
 
Time m_rtrs
 Defining the time for retransmission. More...
 
Ipv4Address m_server
 Address of the DHCP server. More...
 
Ptr< Socketm_socket
 Socket for remote communication. More...
 
uint8_t m_state
 State of the DHCP client. More...
 
EventId m_timeout
 The timeout period. More...
 
uint32_t m_tran
 Stores the current transaction number to be used. More...
 

Static Private Attributes

static const int DHCP_PEER_PORT = 67
 DHCP server port. More...
 

Additional Inherited Members

- Public Types inherited from ns3::Application
typedef void(* DelayAddressCallback) (const Time &delay, const Address &from)
 Common callback signature for packet delay and address. More...
 
typedef void(* StateTransitionCallback) (const std::string &oldState, const std::string &newState)
 Common signature used by callbacks to application's state transition trace source. More...
 
- Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
 The node that this application is installed on. More...
 
EventId m_startEvent
 The event that will fire at m_startTime to start the application. More...
 
Time m_startTime
 The simulation time that the application will start. More...
 
EventId m_stopEvent
 The event that will fire at m_stopTime to end the application. More...
 
Time m_stopTime
 The simulation time that the application will end. More...
 

Detailed Description

Implements the functionality of a DHCP client.


Config Paths

ns3::DhcpClient is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/ApplicationList/[i]/$ns3::DhcpClient"

Attributes

  • RTRS: Time for retransmission of Discover message
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • Collect: Time for which offer collection starts
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +5000000000.0ns
    • Flags: construct write read
  • ReRequest: Time after which request will be resent to next server
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +10000000000.0ns
    • Flags: construct write read
  • Transactions: The possible value of transaction numbers

Attributes defined in parent class ns3::Application

  • StartTime: Time at which the application will start
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read
  • StopTime: Time at which the application will stop
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read

TraceSources

  • NewLease: Get a NewLease
    Callback signature: ns3::Ipv4Address::TracedCallback
  • ExpireLease: A lease expires
    Callback signature: ns3::Ipv4Address::TracedCallback

Size of this type is 488 bytes (on a 64-bit architecture).

Definition at line 45 of file dhcp-client.h.

Member Enumeration Documentation

◆ States

client states

Enumerator
WAIT_OFFER 

State of a client that waits for the offer.

REFRESH_LEASE 

State of a client that needs to refresh the lease.

WAIT_ACK 

State of a client that waits for acknowledgment.

Definition at line 97 of file dhcp-client.h.

Constructor & Destructor Documentation

◆ DhcpClient() [1/2]

ns3::DhcpClient::DhcpClient ( )

◆ ~DhcpClient()

ns3::DhcpClient::~DhcpClient ( )
virtual

Definition at line 107 of file dhcp-client.cc.

References NS_LOG_FUNCTION.

◆ DhcpClient() [2/2]

ns3::DhcpClient::DhcpClient ( Ptr< NetDevice netDevice)

Constructor.

Parameters
netDevicethe NetDevice DHCP should work on

Definition at line 91 of file dhcp-client.cc.

References ns3::Ipv4Address::GetAny(), m_collectEvent, m_device, m_discoverEvent, m_firstBoot, m_nextOfferEvent, m_rebindEvent, m_refreshEvent, m_requestEvent, m_server, m_socket, m_timeout, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

◆ AcceptAck()

void ns3::DhcpClient::AcceptAck ( DhcpHeader  header,
Address  from 
)
private

Receives the DHCP ACK and configures IP address of the client.

It also triggers the timeout, renew and rebind events.

Parameters
headerDhcpHeader of the DHCP ACK message
fromAddress of DHCP server that sent the DHCP ACK

Definition at line 435 of file dhcp-client.cc.

References ns3::EventId::Cancel(), ns3::Socket::Connect(), ns3::InetSocketAddress::ConvertFrom(), DHCP_PEER_PORT, ns3::InetSocketAddress::GetIpv4(), ns3::Application::GetNode(), ns3::Object::GetObject(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), m_device, m_expiry, m_gateway, m_lease, m_myAddress, m_myMask, m_newLease, m_offeredAddress, m_offerList, m_rebind, m_rebindEvent, m_refreshEvent, m_remoteAddress, m_renew, m_socket, m_state, m_timeout, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), REFRESH_LEASE, RemoveAndStart(), Request(), and ns3::Simulator::Schedule().

Referenced by NetHandler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AssignStreams()

int64_t ns3::DhcpClient::AssignStreams ( int64_t  stream)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamFirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 148 of file dhcp-client.cc.

References m_ran, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

◆ Boot()

void ns3::DhcpClient::Boot ( void  )
private

◆ DoDispose()

void ns3::DhcpClient::DoDispose ( void  )
protectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Application.

Definition at line 129 of file dhcp-client.cc.

References ns3::EventId::Cancel(), ns3::Application::DoDispose(), m_collectEvent, m_device, m_discoverEvent, m_nextOfferEvent, m_rebindEvent, m_refreshEvent, m_requestEvent, m_timeout, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetDhcpClientNetDevice()

Ptr< NetDevice > ns3::DhcpClient::GetDhcpClientNetDevice ( void  )

Get the the NetDevice DHCP should work on.

Returns
the NetDevice DHCP should work on

Definition at line 112 of file dhcp-client.cc.

References m_device.

◆ GetDhcpServer()

Ipv4Address ns3::DhcpClient::GetDhcpServer ( void  )

Get the IPv4Address of current DHCP server.

Returns
Ipv4Address of current DHCP server

Definition at line 123 of file dhcp-client.cc.

References m_server.

◆ GetTypeId()

TypeId ns3::DhcpClient::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 42 of file dhcp-client.cc.

References m_collect, m_expiry, m_newLease, m_nextoffer, m_ran, m_rtrs, ns3::MakePointerAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().

Referenced by ns3::DhcpHelper::DhcpHelper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LinkStateHandler()

◆ NetHandler()

void ns3::DhcpClient::NetHandler ( Ptr< Socket socket)
private

Handles incoming packets from the network.

Parameters
socketSocket bound to port 68 of the DHCP client

Definition at line 294 of file dhcp-client.cc.

References AcceptAck(), Boot(), ns3::EventId::Cancel(), ns3::DhcpHeader::DHCPACK, ns3::DhcpHeader::DHCPNACK, ns3::DhcpHeader::DHCPOFFER, ns3::DhcpHeader::GetChaddr(), ns3::DhcpHeader::GetType(), m_chaddr, m_nextOfferEvent, m_socket, m_state, NS_LOG_FUNCTION, OfferHandler(), ns3::Socket::RecvFrom(), ns3::Packet::RemoveHeader(), WAIT_ACK, and WAIT_OFFER.

Referenced by LinkStateHandler(), and StartApplication().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OfferHandler()

void ns3::DhcpClient::OfferHandler ( DhcpHeader  header)
private

Stores DHCP offers in m_offerList.

Parameters
headerDhcpHeader of the DHCP OFFER message

Definition at line 353 of file dhcp-client.cc.

References ns3::EventId::Cancel(), m_collect, m_collectEvent, m_discoverEvent, m_offered, m_offerList, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and Select().

Referenced by NetHandler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveAndStart()

void ns3::DhcpClient::RemoveAndStart ( )
private

Remove the current DHCP information and restart the process.

Definition at line 493 of file dhcp-client.cc.

References ns3::EventId::Cancel(), ns3::Application::GetNode(), ns3::Object::GetObject(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), m_device, m_expiry, m_gateway, m_myAddress, m_nextOfferEvent, m_rebindEvent, m_refreshEvent, m_timeout, NS_LOG_FUNCTION, and StartApplication().

Referenced by AcceptAck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Request()

◆ Select()

void ns3::DhcpClient::Select ( void  )
private

◆ SetDhcpClientNetDevice()

void ns3::DhcpClient::SetDhcpClientNetDevice ( Ptr< NetDevice netDevice)

Set the NetDevice DHCP should work on.

Parameters
netDevicethe NetDevice DHCP should work on

Definition at line 118 of file dhcp-client.cc.

References m_device.

◆ StartApplication()

void ns3::DhcpClient::StartApplication ( void  )
privatevirtual

Application specific startup code.

The StartApplication method is called at the start time specified by Start This method should be overridden by all or most application subclasses.

Reimplemented from ns3::Application.

Definition at line 156 of file dhcp-client.cc.

References ns3::Socket::Bind(), ns3::Socket::BindToNetDevice(), Boot(), ns3::Address::CopyFrom(), ns3::Address::CopyTo(), ns3::Socket::CreateSocket(), ns3::Ipv4Address::GetAny(), ns3::Application::GetNode(), ns3::Object::GetObject(), LinkStateHandler(), ns3::TypeId::LookupByName(), m_chaddr, m_device, m_firstBoot, m_gateway, m_myAddress, m_remoteAddress, m_socket, ns3::MakeCallback(), ns3::Address::MAX_SIZE, NetHandler(), NS_ASSERT_MSG(), NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Socket::SetAllowBroadcast(), and ns3::Socket::SetRecvCallback().

Referenced by LinkStateHandler(), and RemoveAndStart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StopApplication()

void ns3::DhcpClient::StopApplication ( void  )
privatevirtual

Application specific shutdown code.

The StopApplication method is called at the stop time specified by Stop This method should be overridden by all or most application subclasses.

Reimplemented from ns3::Application.

Definition at line 210 of file dhcp-client.cc.

References ns3::EventId::Cancel(), ns3::Socket::Close(), ns3::Application::GetNode(), ns3::Object::GetObject(), m_collectEvent, m_device, m_discoverEvent, m_myAddress, m_nextOfferEvent, m_rebindEvent, m_refreshEvent, m_requestEvent, m_socket, m_timeout, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().

+ Here is the call graph for this function:

Member Data Documentation

◆ DHCP_PEER_PORT

const int ns3::DhcpClient::DHCP_PEER_PORT = 67
staticprivate

DHCP server port.

Definition at line 104 of file dhcp-client.h.

Referenced by AcceptAck(), Boot(), and Request().

◆ m_chaddr

Address ns3::DhcpClient::m_chaddr
private

chaddr of the interface (stored as an Address for convenience).

Definition at line 168 of file dhcp-client.h.

Referenced by Boot(), NetHandler(), Request(), and StartApplication().

◆ m_collect

Time ns3::DhcpClient::m_collect
private

Time for which client should collect offers.

Definition at line 185 of file dhcp-client.h.

Referenced by GetTypeId(), and OfferHandler().

◆ m_collectEvent

EventId ns3::DhcpClient::m_collectEvent
private

Offer collection event.

Definition at line 178 of file dhcp-client.h.

Referenced by DhcpClient(), DoDispose(), LinkStateHandler(), OfferHandler(), and StopApplication().

◆ m_device

◆ m_discoverEvent

EventId ns3::DhcpClient::m_discoverEvent
private

Message retransmission event.

Definition at line 173 of file dhcp-client.h.

Referenced by Boot(), DhcpClient(), DoDispose(), LinkStateHandler(), OfferHandler(), and StopApplication().

◆ m_expiry

TracedCallback<const Ipv4Address&> ns3::DhcpClient::m_expiry
private

Trace of lease expire.

Definition at line 190 of file dhcp-client.h.

Referenced by AcceptAck(), GetTypeId(), and RemoveAndStart().

◆ m_firstBoot

bool ns3::DhcpClient::m_firstBoot
private

First boot (used to add the link state change callback)

Definition at line 162 of file dhcp-client.h.

Referenced by DhcpClient(), and StartApplication().

◆ m_gateway

Ipv4Address ns3::DhcpClient::m_gateway
private

Address of the gateway.

Definition at line 171 of file dhcp-client.h.

Referenced by AcceptAck(), LinkStateHandler(), RemoveAndStart(), Select(), and StartApplication().

◆ m_lease

Time ns3::DhcpClient::m_lease
private

Store the lease time of address.

Definition at line 179 of file dhcp-client.h.

Referenced by AcceptAck(), and Select().

◆ m_myAddress

Ipv4Address ns3::DhcpClient::m_myAddress
private

Address assigned to the client.

Definition at line 167 of file dhcp-client.h.

Referenced by AcceptAck(), LinkStateHandler(), RemoveAndStart(), Request(), StartApplication(), and StopApplication().

◆ m_myMask

Ipv4Mask ns3::DhcpClient::m_myMask
private

Mask of the address assigned.

Definition at line 169 of file dhcp-client.h.

Referenced by AcceptAck(), and Select().

◆ m_newLease

TracedCallback<const Ipv4Address&> ns3::DhcpClient::m_newLease
private

Trace of new lease.

Definition at line 189 of file dhcp-client.h.

Referenced by AcceptAck(), and GetTypeId().

◆ m_nextoffer

Time ns3::DhcpClient::m_nextoffer
private

Time to try the next offer (if request gets no reply)

Definition at line 182 of file dhcp-client.h.

Referenced by GetTypeId(), and Request().

◆ m_nextOfferEvent

EventId ns3::DhcpClient::m_nextOfferEvent
private

Message next offer event.

Definition at line 176 of file dhcp-client.h.

Referenced by DhcpClient(), DoDispose(), LinkStateHandler(), NetHandler(), RemoveAndStart(), Request(), and StopApplication().

◆ m_offered

bool ns3::DhcpClient::m_offered
private

Specify if the client has got any offer.

Definition at line 186 of file dhcp-client.h.

Referenced by Boot(), OfferHandler(), and Select().

◆ m_offeredAddress

Ipv4Address ns3::DhcpClient::m_offeredAddress
private

Address offered to the client.

Definition at line 166 of file dhcp-client.h.

Referenced by AcceptAck(), Request(), and Select().

◆ m_offerList

std::list<DhcpHeader> ns3::DhcpClient::m_offerList
private

Stores all the offers given to the client.

Definition at line 187 of file dhcp-client.h.

Referenced by AcceptAck(), OfferHandler(), and Select().

◆ m_ran

Ptr<RandomVariableStream> ns3::DhcpClient::m_ran
private

Uniform random variable for transaction ID.

Definition at line 183 of file dhcp-client.h.

Referenced by AssignStreams(), Boot(), GetTypeId(), and Request().

◆ m_rebind

Time ns3::DhcpClient::m_rebind
private

Store the rebind time of address.

Definition at line 181 of file dhcp-client.h.

Referenced by AcceptAck(), and Select().

◆ m_rebindEvent

EventId ns3::DhcpClient::m_rebindEvent
private

Message rebind event.

Definition at line 175 of file dhcp-client.h.

Referenced by AcceptAck(), DhcpClient(), DoDispose(), LinkStateHandler(), RemoveAndStart(), and StopApplication().

◆ m_refreshEvent

EventId ns3::DhcpClient::m_refreshEvent
private

Message refresh event.

Definition at line 174 of file dhcp-client.h.

Referenced by AcceptAck(), DhcpClient(), DoDispose(), LinkStateHandler(), RemoveAndStart(), and StopApplication().

◆ m_remoteAddress

Ipv4Address ns3::DhcpClient::m_remoteAddress
private

Initially set to 255.255.255.255 to start DHCP.

Definition at line 165 of file dhcp-client.h.

Referenced by AcceptAck(), Boot(), Request(), and StartApplication().

◆ m_renew

Time ns3::DhcpClient::m_renew
private

Store the renew time of address.

Definition at line 180 of file dhcp-client.h.

Referenced by AcceptAck(), and Select().

◆ m_requestEvent

EventId ns3::DhcpClient::m_requestEvent
private

Address refresh event.

Definition at line 172 of file dhcp-client.h.

Referenced by DhcpClient(), DoDispose(), LinkStateHandler(), and StopApplication().

◆ m_rtrs

Time ns3::DhcpClient::m_rtrs
private

Defining the time for retransmission.

Definition at line 184 of file dhcp-client.h.

Referenced by Boot(), and GetTypeId().

◆ m_server

Ipv4Address ns3::DhcpClient::m_server
private

Address of the DHCP server.

Definition at line 170 of file dhcp-client.h.

Referenced by DhcpClient(), GetDhcpServer(), and Select().

◆ m_socket

Ptr<Socket> ns3::DhcpClient::m_socket
private

Socket for remote communication.

Definition at line 164 of file dhcp-client.h.

Referenced by AcceptAck(), Boot(), DhcpClient(), LinkStateHandler(), NetHandler(), Request(), StartApplication(), and StopApplication().

◆ m_state

uint8_t ns3::DhcpClient::m_state
private

State of the DHCP client.

Definition at line 161 of file dhcp-client.h.

Referenced by AcceptAck(), Boot(), LinkStateHandler(), NetHandler(), and Request().

◆ m_timeout

EventId ns3::DhcpClient::m_timeout
private

The timeout period.

Definition at line 177 of file dhcp-client.h.

Referenced by AcceptAck(), DhcpClient(), DoDispose(), LinkStateHandler(), RemoveAndStart(), and StopApplication().

◆ m_tran

uint32_t ns3::DhcpClient::m_tran
private

Stores the current transaction number to be used.

Definition at line 188 of file dhcp-client.h.

Referenced by Boot(), and Request().


The documentation for this class was generated from the following files: