23 #include "ns3/simulator.h"
24 #include "ns3/packet.h"
39 .SetGroupName(
"Network")
41 .AddAttribute (
"Delay",
"Transmission delay through the channel",
123 std::vector<Ptr<SimpleNetDevice> >::iterator iter;
Abstract Channel Base Class.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
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.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
static TypeId GetTypeId(void)
Get the type ID.
std::map< Ptr< SimpleNetDevice >, std::vector< Ptr< SimpleNetDevice > > > m_blackListedDevices
devices blocked on a device
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.
virtual void UnBlackList(Ptr< SimpleNetDevice > from, Ptr< SimpleNetDevice > to)
Un-Blocks the communications from a NetDevice to another NetDevice.
virtual std::size_t GetNDevices(void) const
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, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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 AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.