24 #include "ns3/application.h"
25 #include "ns3/event-id.h"
27 #include "ns3/traced-callback.h"
28 #include "ns3/address.h"
29 #include "ns3/inet-socket-address.h"
30 #include "ns3/seq-ts-size-header.h"
31 #include <unordered_map>
168 return std::hash<uint32_t>()(a.
GetIpv4 ().
Get ());
a polymophic address class
The base class for all ns3 applications.
Ipv4Address GetIpv4(void) const
static bool IsMatchingType(const Address &address)
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input Address.
uint32_t Get(void) const
Get the host-order 32-bit IP address.
Receive and consume traffic generated to an IP address and port.
virtual void DoDispose(void)
Destructor implementation.
std::unordered_map< Address, Ptr< Packet >, AddressHash > m_buffer
Buffer for received packets.
Ptr< Socket > GetListeningSocket(void) const
TypeId m_tid
Protocol TypeId.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t m_localPort
Local port to bind to.
Address m_local
Local address to bind to (address and port)
std::list< Ptr< Socket > > GetAcceptedSockets(void) const
virtual void StartApplication(void)
Application specific startup code.
std::list< Ptr< Socket > > m_socketList
the accepted sockets
virtual void StopApplication(void)
Application specific shutdown code.
void HandleRead(Ptr< Socket > socket)
Handle a packet received by the application.
uint64_t GetTotalRx() const
void HandleAccept(Ptr< Socket > socket, const Address &from)
Handle an incoming connection.
void HandlePeerError(Ptr< Socket > socket)
Handle an connection error.
TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
Traced Callback: received packets, source address.
TracedCallback< Ptr< const Packet >, const Address &, const Address & > m_rxTraceWithAddresses
Callback for tracing the packet Rx events, includes source and destination addresses.
void(* SeqTsSizeCallback)(Ptr< const Packet > p, const Address &from, const Address &to, const SeqTsSizeHeader &header)
TracedCallback signature for a reception with addresses and SeqTsSizeHeader.
uint64_t m_totalRx
Total bytes received.
bool m_enableSeqTsSizeHeader
Enable or disable the export of SeqTsSize header.
TracedCallback< Ptr< const Packet >, const Address &, const Address &, const SeqTsSizeHeader & > m_rxTraceWithSeqTsSize
Callbacks for tracing the packet Rx events, includes source, destination addresses,...
void HandlePeerClose(Ptr< Socket > socket)
Handle an connection close.
Ptr< Socket > m_socket
Listening socket.
void PacketReceived(const Ptr< Packet > &p, const Address &from, const Address &localAddress)
Packet received: assemble byte stream to extract SeqTsSizeHeader.
Forward calls to a chain of Callback.
a unique identifier for an interface.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
list x
Random number samples.
Hashing for the Address class.
size_t operator()(const Address &x) const
operator ()