|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
25 #ifndef ONOFF_APPLICATION_H
26 #define ONOFF_APPLICATION_H
28 #include "ns3/address.h"
29 #include "ns3/application.h"
30 #include "ns3/event-id.h"
32 #include "ns3/data-rate.h"
33 #include "ns3/traced-callback.h"
34 #include "ns3/seq-ts-size-header.h"
39 class RandomVariableStream;
a unique identifier for an interface.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
An identifier for simulation events.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
EventId m_startStopEvent
Event id for next start or stop event.
bool m_connected
True if connected.
uint64_t m_maxBytes
Limit total number of bytes sent.
TracedCallback< Ptr< const Packet >, const Address &, const Address & > m_txTraceWithAddresses
Callbacks for tracing the packet Tx events, includes source and destination addresses.
void SetMaxBytes(uint64_t maxBytes)
Set the total number of bytes to send.
uint32_t m_residualBits
Number of generated, but not sent, bits.
DataRate m_cbrRateFailSafe
Rate that data is generated (check copy)
DataRate m_cbrRate
Rate that data is generated.
TracedCallback< Ptr< const Packet >, const Address &, const Address &, const SeqTsSizeHeader & > m_txTraceWithSeqTsSize
Callback for tracing the packet Tx events, includes source, destination, the packet sent,...
virtual void StopApplication(void)
Application specific shutdown code.
Address m_local
Local address to bind to.
Class for representing data rates.
void StopSending()
Start an Off period.
a polymophic address class
uint32_t m_pktSize
Size of packets.
virtual ~OnOffApplication()
Ptr< RandomVariableStream > m_onTime
rng for On Time
void ScheduleNextTx()
Schedule the next packet transmission.
void ConnectionFailed(Ptr< Socket > socket)
Handle a Connection Failed event.
void SendPacket()
Send a packet.
void StartSending()
Start an On period.
Simulation virtual time values and global simulation resolution.
EventId m_sendEvent
Event id of pending "send packet" event.
void CancelEvents()
Cancel all pending events.
Address m_peer
Peer address.
Generate traffic to a single destination according to an OnOff pattern.
Ptr< RandomVariableStream > m_offTime
rng for Off Time
uint64_t m_totBytes
Total bytes sent so far.
Ptr< Packet > m_unsentPacket
Unsent packet cached for future attempt.
void ScheduleStartEvent()
Schedule the next On period start.
Ptr< Socket > GetSocket(void) const
Return a pointer to associated socket.
Forward calls to a chain of Callback.
Time m_lastStartTime
Time last packet sent.
Ptr< Socket > m_socket
Associated socket.
The base class for all ns3 applications.
void ConnectionSucceeded(Ptr< Socket > socket)
Handle a Connection Succeed event.
bool m_enableSeqTsSizeHeader
Enable or disable the use of SeqTsSizeHeader.
TypeId m_tid
Type of the socket used.
virtual void DoDispose(void)
Destructor implementation.
TracedCallback< Ptr< const Packet > > m_txTrace
Traced Callback: transmitted packets.
virtual void StartApplication(void)
Application specific startup code.
void ScheduleStopEvent()
Schedule the next Off period start.