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);
a polymophic address class
PacketType
Packet types are used as they are in Linux.
static bool ChecksumEnabled(void)
void UnregisterProtocolHandler(ProtocolHandler handler)
std::vector< DeviceAdditionListener > DeviceAdditionListenerList
Typedef for NetDevice addition listeners container.
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.
DeviceAdditionListenerList m_deviceAdditionListeners
Device addition listeners in the node.
Callback< void, Ptr< NetDevice > > DeviceAdditionListener
A callback invoked whenever a device is added to a node.
uint32_t GetId(void) const
std::vector< struct Node::ProtocolHandlerEntry > ProtocolHandlerList
Typedef for protocol handlers container.
std::vector< Ptr< Application > > m_applications
Applications associated to this node.
void Construct(void)
Finish node's construction by setting the correct node ID.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t m_id
Node id for this node.
Callback< void, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > ProtocolHandler
A protocol handler.
uint32_t GetNApplications(void) const
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
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.
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.
virtual void DoDispose(void)
The dispose method.
uint32_t m_sid
System id for 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...
virtual void DoInitialize(void)
Initialize() implementation.
uint32_t GetNDevices(void) const
ProtocolHandlerList m_handlers
Protocol handlers in the node.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
void RegisterDeviceAdditionListener(DeviceAdditionListener listener)
static TypeId GetTypeId(void)
Get the type ID.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
uint32_t GetSystemId(void) const
void NotifyDeviceAdded(Ptr< NetDevice > device)
Notifies all the DeviceAdditionListener about the new device added.
void UnregisterDeviceAdditionListener(DeviceAdditionListener listener)
std::vector< Ptr< NetDevice > > m_devices
Devices associated to this node.
void RegisterProtocolHandler(ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false)
A base class which provides memory management and object aggregation.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool promiscuous
true if it is a promiscuous handler
uint16_t protocol
the protocol number
Ptr< NetDevice > device
the NetDevice
ProtocolHandler handler
the protocol handler