21 #include "ns3/trace-source-accessor.h"
22 #include "ns3/packet.h"
23 #include "ns3/simulator.h"
38 .AddConstructor<PointToPointChannel> ()
39 .AddAttribute (
"Delay",
"Transmission delay through the channel",
43 .AddTraceSource (
"TxRxPointToPoint",
44 "Trace source indicating transmission of packet from the PointToPointChannel, used by the Animation interface.",
56 m_delay (Seconds (0.)),
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
bool IsInitialized(void) const
uint64_t GetUid(void) const
A packet is allocated a new uid when it is created empty or with zero-filled payload.
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...
static TypeId GetTypeId(void)
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Abstract Channel Base Class.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual uint32_t GetNDevices(void) const
Get number of devices on this channel.
void Attach(Ptr< PointToPointNetDevice > device)
Attach a given netdevice to this channel.
PointToPointChannel()
Create a PointToPointChannel.
Ptr< PointToPointNetDevice > m_dst
hold objects of type ns3::Time
Time GetDelay(void) const
static void ScheduleWithContext(uint32_t context, Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
#define NS_LOG_LOGIC(msg)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
virtual Ptr< NetDevice > GetDevice(uint32_t i) const
#define NS_ASSERT_MSG(condition, message)
void Receive(Ptr< Packet > p)
Receive a packet from a connected PointToPointChannel.
static const int N_DEVICES
Ptr< PointToPointNetDevice > m_src
Ptr< PointToPointNetDevice > GetSource(uint32_t i) const
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual bool TransmitStart(Ptr< Packet > p, Ptr< PointToPointNetDevice > src, Time txTime)
Transmit a packet over this channel.
Ptr< PointToPointNetDevice > GetDestination(uint32_t i) const
a unique identifier for an interface.
Ptr< PointToPointNetDevice > GetPointToPointDevice(uint32_t i) const
TypeId SetParent(TypeId tid)
NS_LOG_COMPONENT_DEFINE("PointToPointChannel")