18#include "ns3/applications-module.h"
22TutorialApp::TutorialApp ()
44 .SetGroupName (
"Tutorial")
a polymophic address class
The base class for all ns3 applications.
Class for representing data rates.
uint64_t GetBitRate() const
Get the underlying bitrate.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
virtual int Close(void)=0
Close a socket.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Simulation virtual time values and global simulation resolution.
Tutorial - a simple Application sending packets.
static TypeId GetTypeId(void)
Register this type.
virtual void StopApplication(void)
Application specific shutdown code.
EventId m_sendEvent
Send event.
Ptr< Socket > m_socket
The tranmission socket.
uint32_t m_packetsSent
The number of pacts sent.
void ScheduleTx(void)
Schedule a new transmission.
void SendPacket(void)
Send a packet.
Address m_peer
The destination address.
uint32_t m_packetSize
The packet size.
void Setup(Ptr< Socket > socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate)
Setup the socket.
DataRate m_dataRate
The datarate to use.
uint32_t m_nPackets
The number of pacts to send.
virtual void StartApplication(void)
Application specific startup code.
bool m_running
True if the application is running.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint32_t packetSize
Pcket size generated at the AP.