21 #include "ns3/simple-net-device.h"
22 #include "ns3/simulator.h"
23 #include "ns3/packet.h"
39 .AddConstructor<ErrorChannel> ()
115 .AddConstructor<BinaryErrorModel> ()
virtual bool DoCorrupt(Ptr< Packet > p)
keep track of time values and allow control of global simulation resolution
#define NS_LOG_FUNCTION(parameters)
std::vector< Ptr< SimpleNetDevice > > m_devices
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Abstract Channel Base Class.
static TypeId GetTypeId(void)
General error model that can be used to corrupt packets.
virtual ~BinaryErrorModel()
virtual void DoReset(void)
NS_LOG_COMPONENT_DEFINE("ErrorChannel")
bool IsEnabled(void) const
static TypeId GetTypeId(void)
static void ScheduleWithContext(uint32_t context, Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
Ptr< Packet > Copy(void) const
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
virtual void Add(Ptr< SimpleNetDevice > device)
Attached a net device to the channel.
virtual void Send(Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender)
A packet is sent by a net device.
virtual uint32_t GetNDevices(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual Ptr< NetDevice > GetDevice(uint32_t i) const