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