|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
26 #include "ns3/object.h"
27 #include "ns3/callback.h"
29 #include "ns3/net-device.h"
69 Node(uint32_t systemId);
79 uint32_t
GetId (
void)
const;
174 uint16_t protocolType,
176 bool promiscuous=
false);
void Construct(void)
Finish node's construction by setting the correct node ID.
a unique identifier for an interface.
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
Callback< void, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > ProtocolHandler
A protocol handler.
void RegisterProtocolHandler(ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false)
void RegisterDeviceAdditionListener(DeviceAdditionListener listener)
uint32_t GetId(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DeviceAdditionListenerList m_deviceAdditionListeners
Device addition listeners in the node.
virtual void DoDispose(void)
The dispose method.
void UnregisterProtocolHandler(ProtocolHandler handler)
bool ReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet >, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType, bool promisc)
Receive a packet from a device.
ProtocolHandler handler
the protocol handler
std::vector< DeviceAdditionListener > DeviceAdditionListenerList
Typedef for NetDevice addition listeners container.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< NetDevice > device
the NetDevice
a polymophic address class
A base class which provides memory management and object aggregation.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Time GetLocalTime(void) const
In the future, ns3 nodes may have clock that returned a local time different from the virtual time Si...
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
ProtocolHandlerList m_handlers
Protocol handlers in the node.
static bool ChecksumEnabled(void)
uint32_t GetSystemId(void) const
Simulation virtual time values and global simulation resolution.
bool PromiscReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
Receive a packet from a device in promiscuous mode.
uint32_t m_id
Node id for this node.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
std::vector< Ptr< NetDevice > > m_devices
Devices associated to this node.
virtual void DoInitialize(void)
Initialize() implementation.
void NotifyDeviceAdded(Ptr< NetDevice > device)
Notifies all the DeviceAdditionListener about the new device added.
uint16_t protocol
the protocol number
std::vector< struct Node::ProtocolHandlerEntry > ProtocolHandlerList
Typedef for protocol handlers container.
uint32_t m_sid
System id for this node.
std::vector< Ptr< Application > > m_applications
Applications associated to this node.
void UnregisterDeviceAdditionListener(DeviceAdditionListener listener)
PacketType
Packet types are used as they are in Linux.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
uint32_t GetNDevices(void) const
Callback< void, Ptr< NetDevice > > DeviceAdditionListener
A callback invoked whenever a device is added to a node.
uint32_t GetNApplications(void) const
bool NonPromiscReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &from)
Receive a packet from a device in non-promiscuous mode.
bool promiscuous
true if it is a promiscuous handler