|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
28 #include "ns3/application.h"
29 #include "ns3/traced-value.h"
37 class RandomVariableStream;
a unique identifier for an interface.
bool m_firstBoot
First boot (used to add the link state change callback)
An identifier for simulation events.
Ipv4Mask m_myMask
Mask of the address assigned.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetDhcpClientNetDevice(Ptr< NetDevice > netDevice)
Set the NetDevice DHCP should work on.
Ipv4Address m_gateway
Address of the gateway.
void Select(void)
Selects an OFFER from m_offerList.
EventId m_discoverEvent
Message retransmission event.
Time m_collect
Time for which client should collect offers.
Time m_lease
Store the lease time of address.
Address m_chaddr
chaddr of the interface (stored as an Address for convenience).
void Boot(void)
Sends DHCP DISCOVER and changes the client state to WAIT_OFFER.
EventId m_requestEvent
Address refresh event.
Ipv4 addresses are stored in host order in this class.
EventId m_timeout
The timeout period.
Time m_rebind
Store the rebind time of address.
Implements the functionality of a DHCP client.
uint8_t m_state
State of the DHCP client.
EventId m_nextOfferEvent
Message next offer event.
Ptr< NetDevice > GetDhcpClientNetDevice(void)
Get the the NetDevice DHCP should work on.
Ipv4Address m_myAddress
Address assigned to the client.
void LinkStateHandler(void)
Handles changes in LinkState.
virtual void DoDispose(void)
Destructor implementation.
virtual void StopApplication(void)
Application specific shutdown code.
a polymophic address class
Ipv4Address m_server
Address of the DHCP server.
std::list< DhcpHeader > m_offerList
Stores all the offers given to the client.
Ptr< NetDevice > m_device
NetDevice pointer.
void AcceptAck(DhcpHeader header, Address from)
Receives the DHCP ACK and configures IP address of the client.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
@ WAIT_OFFER
State of a client that waits for the offer.
Time m_nextoffer
Time to try the next offer (if request gets no reply)
Simulation virtual time values and global simulation resolution.
Ipv4Address GetDhcpServer(void)
Get the IPv4Address of current DHCP server.
void Request(void)
Sends the DHCP REQUEST message and changes the client state to WAIT_ACK.
EventId m_refreshEvent
Message refresh event.
bool m_offered
Specify if the client has got any offer.
Ipv4Address m_remoteAddress
Initially set to 255.255.255.255 to start DHCP.
@ WAIT_ACK
State of a client that waits for acknowledgment.
Ptr< Socket > m_socket
Socket for remote communication.
TracedCallback< const Ipv4Address & > m_expiry
Trace of lease expire.
virtual void StartApplication(void)
Application specific startup code.
a class to represent an Ipv4 address mask
void OfferHandler(DhcpHeader header)
Stores DHCP offers in m_offerList.
Forward calls to a chain of Callback.
Time m_renew
Store the renew time of address.
void RemoveAndStart()
Remove the current DHCP information and restart the process.
The base class for all ns3 applications.
Ipv4Address m_offeredAddress
Address offered to the client.
EventId m_rebindEvent
Message rebind event.
static TypeId GetTypeId(void)
Get the type ID.
static const int DHCP_PEER_PORT
DHCP server port.
void NetHandler(Ptr< Socket > socket)
Handles incoming packets from the network.
uint32_t m_tran
Stores the current transaction number to be used.
Ptr< RandomVariableStream > m_ran
Uniform random variable for transaction ID.
Time m_rtrs
Defining the time for retransmission.
EventId m_collectEvent
Offer collection event.
TracedCallback< const Ipv4Address & > m_newLease
Trace of new lease.
@ REFRESH_LEASE
State of a client that needs to refresh the lease.