14#include "ns3/packet.h"
15#include "ns3/simulator.h"
31 .SetGroupName(
"Network")
33 .AddAttribute(
"Delay",
34 "Transmission delay through the channel",
Abstract Channel Base Class.
Smart pointer class similar to boost::intrusive_ptr.
A simple channel, for simple things and testing.
virtual void BlackList(Ptr< SimpleNetDevice > from, Ptr< SimpleNetDevice > to)
Blocks the communications from a NetDevice to another NetDevice.
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
Ptr< NetDevice > GetDevice(std::size_t i) const override
std::map< Ptr< SimpleNetDevice >, std::vector< Ptr< SimpleNetDevice > > > m_blackListedDevices
devices blocked on a device
static TypeId GetTypeId()
Get the type ID.
virtual void Add(Ptr< SimpleNetDevice > device)
Attached a net device to the channel.
Time m_delay
The assigned speed-of-light delay of the channel.
std::size_t GetNDevices() const override
virtual void UnBlackList(Ptr< SimpleNetDevice > from, Ptr< SimpleNetDevice > to)
Un-Blocks the communications from a NetDevice to another NetDevice.
virtual void Send(Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender)
A packet is sent by a net device.
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.