28 #include "ns3/application.h" 
   29 #include "ns3/event-id.h" 
   31 #include "ns3/address.h" 
   32 #include "ns3/traced-value.h" 
   33 #include "ns3/inet-socket-address.h" 
   73   static const int PORT = 67;                       
 
Ipv4Address m_minAddress
The first address in the address pool. 
 
Simulation virtual time values and global simulation resolution. 
 
Ptr< Socket > m_socket
The socket bound to port 67. 
 
AvailableAddress m_availableAddresses
Available addresses to be used (IP addresses) 
 
static TypeId GetTypeId(void)
Get the type ID. 
 
Ipv4Address m_maxAddress
The last address in the address pool. 
 
std::list< Address >::const_iterator ExpiredAddressCIter
Expired address const iterator - chaddr. 
 
a class to represent an Ipv4 address mask 
 
Implements the functionality of a DHCP server. 
 
std::map< Address, std::pair< Ipv4Address, uint32_t > >::iterator LeasedAddressIter
Leased address iterator - chaddr + IP addr / lease time. 
 
Ipv4Address m_gateway
The gateway address. 
 
a polymophic address class 
 
void AddStaticDhcpEntry(Address chaddr, Ipv4Address addr)
Add a static entry to the pool. 
 
Ipv4Address m_poolAddress
The network address available to the server. 
 
Time m_lease
The granted lease time for an address. 
 
void SendAck(Ptr< NetDevice > iDev, DhcpHeader header, InetSocketAddress from)
Sends DHCP ACK (or NACK) after receiving Request. 
 
The base class for all ns3 applications. 
 
virtual void DoDispose(void)
Destructor implementation. 
 
LeasedAddress m_leasedAddresses
Leased address and their status (cache memory) 
 
std::map< Address, std::pair< Ipv4Address, uint32_t > >::const_iterator LeasedAddressCIter
Leased address const iterator - chaddr + IP addr / lease time. 
 
Time m_renew
The renewal time for an address. 
 
std::list< Address >::iterator ExpiredAddressIter
Expired address iterator - chaddr. 
 
std::map< Address, std::pair< Ipv4Address, uint32_t > > LeasedAddress
Leased address container - chaddr + IP addr / lease time. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
static const int PORT
Port number of DHCP server. 
 
Ipv4Mask m_poolMask
The network mask of the pool. 
 
ExpiredAddress m_expiredAddresses
Expired addresses to be reused (chaddr of the clients) 
 
virtual void StartApplication(void)
Starts the DHCP Server application. 
 
EventId m_expiredEvent
The Event to trigger TimerHandler. 
 
Ipv4 addresses are stored in host order in this class. 
 
An identifier for simulation events. 
 
Time m_rebind
The rebinding time for an address. 
 
void SendOffer(Ptr< NetDevice > iDev, DhcpHeader header, InetSocketAddress from)
Sends DHCP offer after receiving DHCP Discover. 
 
void TimerHandler(void)
Modifies the remaining lease time of addresses. 
 
std::list< Address > ExpiredAddress
Expired address container - chaddr. 
 
virtual void StopApplication(void)
Stops the DHCP client application. 
 
std::list< Ipv4Address > AvailableAddress
Available address container - IP addr. 
 
void NetHandler(Ptr< Socket > socket)
Handles incoming packets from the network. 
 
a unique identifier for an interface.