|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
20 #include "ns3/application.h"
21 #include "ns3/traced-callback.h"
22 #include "ns3/average.h"
65 void Write32 (uint8_t *buffer,
const uint32_t
data);
72 void Read32 (
const uint8_t *buffer, uint32_t &
data);
a unique identifier for an interface.
std::map< uint16_t, Time > m_sent
All sent but not answered packets. Map icmp seqno -> when sent.
bool m_verbose
produce ping-style output if true
An identifier for simulation events.
virtual void StartApplication(void)
Application specific startup code.
uint32_t GetApplicationId(void) const
Return the application ID in the node.
void Write32(uint8_t *buffer, const uint32_t data)
Writes data to buffer in little-endian format.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ipv4 addresses are stored in host order in this class.
virtual void DoDispose(void)
Destructor implementation.
virtual void StopApplication(void)
Application specific shutdown code.
an application which sends one ICMP ECHO request, waits for a REPLYs and reports the calculated RTT.
uint32_t m_size
Specifies the number of data bytes to be sent.
Time m_interval
Wait interval seconds between sending each packet.
Ipv4Address m_remote
Remote address.
Simulation virtual time values and global simulation resolution.
EventId m_next
Next packet will be sent.
void Read32(const uint8_t *buffer, uint32_t &data)
Writes data from a little-endian formatted buffer to data.
Average< double > m_avgRtt
Average rtt is ms.
Time m_started
Start time to report total ping time.
static TypeId GetTypeId(void)
Get the type ID.
void Send()
Send one Ping (ICMP ECHO) to the destination.
void Receive(Ptr< Socket > socket)
Receive an ICMP Echo.
uint16_t m_seq
ICMP ECHO sequence number.
Ptr< Socket > m_socket
The socket we send packets from.
V4Ping()
create a pinger applications
uint32_t m_recv
received packets counter
Forward calls to a chain of Callback.
The base class for all ns3 applications.
TracedCallback< Time > m_traceRtt
TracedCallback for RTT measured by ICMP ECHOs.