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

Static Public Member Functions

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

Protected Member Functions

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

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.
 
void Boot ()
 Sends DHCP DISCOVER and changes the client state to WAIT_OFFER.
 
void LinkStateHandler ()
 Handles changes in LinkState.
 
void NetHandler (Ptr< Socket > socket)
 Handles incoming packets from the network.
 
void OfferHandler (DhcpHeader header)
 Stores DHCP offers in m_offerList.
 
void RemoveAndStart ()
 Remove the current DHCP information and restart the process.
 
void Request ()
 Sends the DHCP REQUEST message and changes the client state to WAIT_ACK.
 
void Select ()
 Selects an OFFER from m_offerList.
 
void StartApplication () override
 Application specific startup code.
 
void StopApplication () override
 Application specific shutdown code.
 

Private Attributes

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

Static Private Attributes

static const int DHCP_PEER_PORT = 67
 DHCP server port.
 

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.
 
typedef void(* StateTransitionCallback) (const std::string &oldState, const std::string &newState)
 Common signature used by callbacks to application's state transition trace source.
 
- Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
 The node that this application is installed on.
 
EventId m_startEvent
 The event that will fire at m_startTime to start the application.
 
Time m_startTime
 The simulation time that the application will start.
 
EventId m_stopEvent
 The event that will fire at m_stopTime to end the application.
 
Time m_stopTime
 The simulation time that the application will end.
 

Detailed Description

Implements the functionality of a DHCP client.

Definition at line 36 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 82 of file dhcp-client.h.

Constructor & Destructor Documentation

◆ DhcpClient() [1/2]

ns3::DhcpClient::DhcpClient ( )

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

References ns3::Ipv4Address::GetAny(), m_collectEvent, 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:

◆ ~DhcpClient()

ns3::DhcpClient::~DhcpClient ( )
override

Definition at line 102 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 86 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 443 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)
overridevirtual

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

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this Application object

Reimplemented from ns3::Application.

Definition at line 145 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 ( )
private

Sends DHCP DISCOVER and changes the client state to WAIT_OFFER.

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

References Boot(), ns3::Create(), DHCP_PEER_PORT, ns3::DhcpHeader::DHCPDISCOVER, ns3::RandomVariableStream::GetValue(), m_chaddr, m_discoverEvent, m_offered, m_ran, m_remoteAddress, m_rtrs, m_socket, m_state, m_tran, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::DhcpHeader::ResetOpt(), ns3::Simulator::Schedule(), ns3::Socket::SendTo(), ns3::DhcpHeader::SetChaddr(), ns3::DhcpHeader::SetTime(), ns3::DhcpHeader::SetTran(), ns3::DhcpHeader::SetType(), and WAIT_OFFER.

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

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

◆ DoDispose()

void ns3::DhcpClient::DoDispose ( )
overrideprotectedvirtual

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 126 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 ( )

Get the the NetDevice DHCP should work on.

Returns
the NetDevice DHCP should work on

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

References m_device.

◆ GetDhcpServer()

Ipv4Address ns3::DhcpClient::GetDhcpServer ( )

Get the IPv4Address of current DHCP server.

Returns
Ipv4Address of current DHCP server

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

References m_server.

◆ GetTypeId()

TypeId ns3::DhcpClient::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

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

References m_collect, m_expiry, m_newLease, m_nextoffer, m_ran, m_rtrs, ns3::MakePointerAccessor(), ns3::MakePointerChecker(), 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()

void ns3::DhcpClient::LinkStateHandler ( )
private

Handles changes in LinkState.

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

References ns3::EventId::Cancel(), ns3::Application::GetNode(), ns3::Object::GetObject(), ns3::Ipv4StaticRoutingHelper::GetStaticRouting(), m_collectEvent, m_device, m_discoverEvent, m_gateway, m_myAddress, m_nextOfferEvent, m_rebindEvent, m_refreshEvent, m_requestEvent, m_socket, m_state, m_timeout, ns3::MakeCallback(), ns3::MakeNullCallback(), NetHandler(), ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Time::S, ns3::Socket::SetRecvCallback(), and StartApplication().

Referenced by StartApplication().

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

◆ 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 293 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(), 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 356 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 504 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()

void ns3::DhcpClient::Request ( )
private

Sends the DHCP REQUEST message and changes the client state to WAIT_ACK.

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

References ns3::Create(), DHCP_PEER_PORT, ns3::DhcpHeader::DHCPREQ, ns3::Ipv4Address::Get(), ns3::RandomVariableStream::GetValue(), m_chaddr, m_myAddress, m_nextoffer, m_nextOfferEvent, m_offeredAddress, m_ran, m_remoteAddress, m_socket, m_state, m_tran, NS_LOG_FUNCTION, NS_LOG_INFO, REFRESH_LEASE, ns3::DhcpHeader::ResetOpt(), ns3::Simulator::Schedule(), Select(), ns3::Socket::SendTo(), ns3::DhcpHeader::SetChaddr(), ns3::DhcpHeader::SetReq(), ns3::DhcpHeader::SetTime(), ns3::DhcpHeader::SetTran(), ns3::DhcpHeader::SetType(), and WAIT_ACK.

Referenced by AcceptAck(), and Select().

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

◆ Select()

void ns3::DhcpClient::Select ( )
private

Selects an OFFER from m_offerList.

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

References Boot(), ns3::DhcpHeader::GetDhcps(), ns3::DhcpHeader::GetLease(), ns3::DhcpHeader::GetMask(), ns3::DhcpHeader::GetRebind(), ns3::DhcpHeader::GetRenew(), ns3::DhcpHeader::GetRouter(), ns3::DhcpHeader::GetYiaddr(), m_gateway, m_lease, m_myMask, m_offered, m_offeredAddress, m_offerList, m_rebind, m_renew, m_server, NS_LOG_FUNCTION, Request(), and ns3::Seconds().

Referenced by OfferHandler(), and Request().

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

◆ 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 114 of file dhcp-client.cc.

References m_device.

◆ StartApplication()

void ns3::DhcpClient::StartApplication ( )
overrideprivatevirtual

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 153 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 ( )
overrideprivatevirtual

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 206 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 89 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 143 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 160 of file dhcp-client.h.

Referenced by GetTypeId(), and OfferHandler().

◆ m_collectEvent

EventId ns3::DhcpClient::m_collectEvent
private

Offer collection event.

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

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

◆ m_device

◆ m_discoverEvent

EventId ns3::DhcpClient::m_discoverEvent
private

Message retransmission event.

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

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

◆ m_expiry

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

Trace of lease expire.

Definition at line 165 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 137 of file dhcp-client.h.

Referenced by DhcpClient(), DhcpClient(), and StartApplication().

◆ m_gateway

Ipv4Address ns3::DhcpClient::m_gateway
private

Address of the gateway.

Definition at line 146 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 154 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 142 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 144 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 164 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 157 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 151 of file dhcp-client.h.

Referenced by DhcpClient(), 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 161 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 141 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 162 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 158 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 156 of file dhcp-client.h.

Referenced by AcceptAck(), and Select().

◆ m_rebindEvent

EventId ns3::DhcpClient::m_rebindEvent
private

Message rebind event.

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

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

◆ m_refreshEvent

EventId ns3::DhcpClient::m_refreshEvent
private

Message refresh event.

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

Referenced by DhcpClient(), DhcpClient(), AcceptAck(), 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 140 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 155 of file dhcp-client.h.

Referenced by AcceptAck(), and Select().

◆ m_requestEvent

EventId ns3::DhcpClient::m_requestEvent
private

Address refresh event.

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

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

◆ m_rtrs

Time ns3::DhcpClient::m_rtrs
private

Defining the time for retransmission.

Definition at line 159 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 145 of file dhcp-client.h.

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

◆ m_socket

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

Socket for remote communication.

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

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

◆ m_state

uint8_t ns3::DhcpClient::m_state
private

State of the DHCP client.

Definition at line 136 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 152 of file dhcp-client.h.

Referenced by DhcpClient(), DhcpClient(), AcceptAck(), 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 163 of file dhcp-client.h.

Referenced by Boot(), and Request().


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