|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
19 #ifndef POINT_TO_POINT_CHANNEL_H
20 #define POINT_TO_POINT_CHANNEL_H
23 #include "ns3/channel.h"
25 #include "ns3/nstime.h"
26 #include "ns3/data-rate.h"
27 #include "ns3/traced-callback.h"
31 class PointToPointNetDevice;
a unique identifier for an interface.
void(* TxRxAnimationCallback)(Ptr< const Packet > packet, Ptr< NetDevice > txDevice, Ptr< NetDevice > rxDevice, Time duration, Time lastBitTime)
TracedCallback signature for packet transmission animation events.
void Attach(Ptr< PointToPointNetDevice > device)
Attach a given netdevice to this channel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the TypeId.
@ IDLE
Idle state (no transmission from NetDevice)
Ptr< PointToPointNetDevice > m_dst
Second NetDevice.
Simple Point To Point Channel.
Time m_delay
Propagation delay.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Get NetDevice corresponding to index i on this channel.
@ INITIALIZING
Initializing state.
Smart pointer class similar to boost::intrusive_ptr.
virtual std::size_t GetNDevices(void) const
Get number of devices on this channel.
Time GetDelay(void) const
Get the delay associated with this channel.
TracedCallback< Ptr< const Packet >, Ptr< NetDevice >, Ptr< NetDevice >, Time, Time > m_txrxPointToPoint
The trace source for the packet transmission animation events that the device can fire.
Link()
Create the link, it will be in INITIALIZING state.
Simulation virtual time values and global simulation resolution.
Ptr< PointToPointNetDevice > GetPointToPointDevice(std::size_t i) const
Get PointToPointNetDevice corresponding to index i on this channel.
@ TRANSMITTING
Transmitting state (data being transmitted from NetDevice.
@ PROPAGATING
Propagating state (data is being propagated in the channel.
Ptr< PointToPointNetDevice > GetDestination(uint32_t i) const
Get the net-device destination.
std::size_t m_nDevices
Devices of this channel.
PointToPointChannel()
Create a PointToPointChannel.
bool IsInitialized(void) const
Check to make sure the link is initialized.
Abstract Channel Base Class.
Wire model for the PointToPointChannel.
static const std::size_t N_DEVICES
Each point to point link has exactly two net devices.
WireState m_state
State of the link.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Forward calls to a chain of Callback.
Ptr< PointToPointNetDevice > m_src
First NetDevice.
Ptr< PointToPointNetDevice > GetSource(uint32_t i) const
Get the net-device source.
virtual bool TransmitStart(Ptr< const Packet > p, Ptr< PointToPointNetDevice > src, Time txTime)
Transmit a packet over this channel.
Link m_link[N_DEVICES]
Link model.