7#ifndef UDP_ECHO_CLIENT_H
8#define UDP_ECHO_CLIENT_H
12#include "ns3/deprecated.h"
13#include "ns3/event-id.h"
14#include "ns3/ipv4-address.h"
16#include "ns3/traced-callback.h"
a polymophic address class
An identifier for simulation events.
Smart pointer class similar to boost::intrusive_ptr.
A low-level Socket API based loosely on the BSD Socket API.
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
a unique identifier for an interface.
void SetFill(std::string fill)
Set the data fill of the packet (what is sent as data to the server) to the zero-terminated contents ...
Time m_interval
Packet inter-send time.
Ptr< Socket > m_socket
Socket.
void HandleRead(Ptr< Socket > socket)
Handle a packet reception.
static constexpr uint16_t DEFAULT_PORT
default port
~UdpEchoClient() override
EventId m_sendEvent
Event to send the next packet.
uint32_t m_size
Size of the sent packet.
uint32_t GetDataSize() const
Get the number of data bytes that will be sent to the server.
uint16_t GetPort() const
Get the remote port (temporary function until deprecated attributes are removed).
uint32_t m_count
Maximum number of packets the application will send.
std::optional< uint16_t > m_peerPort
Remote peer port (deprecated) // NS_DEPRECATED_3_44.
static TypeId GetTypeId()
Get the type ID.
uint8_t * m_data
packet payload data
void SetPort(uint16_t port)
Set the remote port (temporary function until deprecated attributes are removed).
uint32_t m_sent
Counter for sent packets.
void ScheduleTransmit(Time dt)
Schedule the next packet transmission.
TracedCallback< Ptr< const Packet >, const Address &, const Address & > m_txTraceWithAddresses
Callbacks for tracing the packet Tx events, includes source and destination addresses.
TracedCallback< Ptr< const Packet > > m_txTrace
Callbacks for tracing the packet Tx events.
TracedCallback< Ptr< const Packet >, const Address &, const Address & > m_rxTraceWithAddresses
Callbacks for tracing the packet Rx events, includes source and destination addresses.
void SetDataSize(uint32_t dataSize)
Set the data size of the packet (the number of bytes that are sent as data to the server).
TracedCallback< Ptr< const Packet > > m_rxTrace
Callbacks for tracing the packet Rx events.
Address GetRemote() const
Get the remote address (temporary function until deprecated attributes are removed).
uint32_t m_dataSize
packet payload size (must be equal to m_size)
#define NS_DEPRECATED_3_44(msg)
Tag for things deprecated in version ns-3.44.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
void StopApplication() override
void StartApplication() override
void Send()
Send a packet.