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;
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual void Add(Ptr< SimpleNetDevice > device)
Attached a net device to the channel.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Abstract Channel Base Class.
virtual void Send(Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender)
A packet is sent by a net device.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
AttributeValue implementation for Time.
virtual void UnBlackList(Ptr< SimpleNetDevice > from, Ptr< SimpleNetDevice > to)
Un-Blocks the communications from a NetDevice to another NetDevice.
std::map< Ptr< SimpleNetDevice >, std::vector< Ptr< SimpleNetDevice > > > m_blackListedDevices
devices blocked on a device
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
Time m_delay
The assigned speed-of-light delay of the channel.
static void ScheduleWithContext(uint32_t context, Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
virtual std::size_t GetNDevices(void) const
A simple channel, for simple things and testing.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Time Seconds(double value)
Construct a Time in the indicated unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void BlackList(Ptr< SimpleNetDevice > from, Ptr< SimpleNetDevice > to)
Blocks the communications from a NetDevice to another NetDevice.
static TypeId GetTypeId(void)
Get the type ID.