9#ifndef SOURCE_APPLICATION_H
10#define SOURCE_APPLICATION_H
12#include "ns3/address.h"
13#include "ns3/application.h"
14#include "ns3/traced-callback.h"
a polymophic address class
Smart pointer class similar to boost::intrusive_ptr.
A low-level Socket API based loosely on the BSD Socket API.
TracedCallback< Ptr< Socket >, const Address &, const Address & > m_connectionFailure
Traced Callback: connection failure event.
TypeId m_protocolTid
Protocol TypeId value.
void StopApplication() override
Application specific shutdown code.
~SourceApplication() override
Address m_local
Local address to bind to.
Address GetRemote() const
get the remote address
SourceApplication(bool allowPacketSocket=true)
Constructor.
void ConnectionFailed(Ptr< Socket > socket)
Handle a Connection Failed event.
Ptr< Socket > m_socket
Socket.
TracedCallback< Ptr< Socket >, const Address &, const Address & > m_connectionSuccess
Traced Callback: connection success event.
void DoDispose() override
Destructor implementation.
Ptr< Socket > GetSocket() const
Get the socket this application is attached to.
void ConnectionSucceeded(Ptr< Socket > socket)
Handle a Connection Succeed event.
virtual void DoConnectionFailed(Ptr< Socket > socket)
Application specific code for child subclasses upon a Connection Failed event.
virtual void DoStopApplication()
Application specific shutdown code for child subclasses.
virtual void SetRemote(const Address &addr)
set the remote address
virtual void CancelEvents()=0
Cancel all pending events.
TracedCallback< Ptr< const Packet > > m_txTrace
Traced Callback: transmitted packets.
uint8_t m_tos
The packets Type of Service.
void StartApplication() override
Application specific startup code.
bool m_connected
flag whether socket is connected
bool m_allowPacketSocket
Allow use of packet socket.
static TypeId GetTypeId()
Get the type ID.
void(* ConnectionEventCallback)(Ptr< Socket > socket, const Address &local, const Address &remote)
TracedCallback signature for connection success/failure event.
Address m_peer
Peer address.
bool CloseSocket()
Close the socket.
virtual void DoStartApplication()
Application specific startup code for child subclasses.
virtual void DoConnectionSucceeded(Ptr< Socket > socket)
Application specific code for child subclasses upon a Connection Succeed event.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.