15#include "ns3/packet.h"
16#include "ns3/simulator.h"
30 .SetGroupName(
"Network")
A Error channel, introducing deterministic delays on even/odd packets.
Time m_duplicateTime
Duplicate time in Duplicate mode.
uint8_t m_duplicateState
Counter for even/odd packets in Duplicate mode.
static TypeId GetTypeId()
Get the type ID.
std::size_t GetNDevices() const override
bool m_jumping
Flag for Jumping mode.
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
void Send(Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender) override
A packet is sent by a net device.
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
Ptr< NetDevice > GetDevice(std::size_t i) const override
void SetDuplicateMode(bool mode)
Set if the odd packets are duplicated (even ones are not duplicated ever)
Time m_jumpingTime
Delay time in Jumping mode.
void Add(Ptr< SimpleNetDevice > device) override
Attached a net device to the channel.
void SetDuplicateTime(Time delay)
Set the delay for the odd duplicate packets (even ones are not duplicated)
uint8_t m_jumpingState
Counter for even/odd packets in Jumping mode.
bool m_duplicate
Flag for Duplicate mode.
Smart pointer class similar to boost::intrusive_ptr.
A simple channel, for simple things and testing.
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.
Simulation virtual time values and global simulation resolution.
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.