|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/simple-net-device.h"
22 #include "ns3/simulator.h"
23 #include "ns3/packet.h"
39 .SetGroupName (
"Network")
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetDuplicateTime(Time delay)
Set the delay for the odd duplicate packets (even ones are not duplicated)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool m_jumping
Flag for Jumping mode.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Time m_jumpingTime
Delay time in Jumping mode.
A Error channel, introducing deterministic delays on even/odd packets.
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
Simulation virtual time values and global simulation resolution.
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
uint8_t m_jumpingState
Counter for even/odd packets in Jumping mode.
Time m_duplicateTime
Duplicate time in Duplicate mode.
static TypeId GetTypeId(void)
Get the type ID.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
A simple channel, for simple things and testing.
uint8_t m_duplicateState
Counter for even/odd packets in Duplicate mode.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
void SetDuplicateMode(bool mode)
Set if the odd packets are duplicated (even ones are not duplicated ever)
bool m_duplicate
Flag for Duplicate mode.
virtual std::size_t GetNDevices(void) const
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.