14#include "ns3/callback.h"
15#include "ns3/object.h"
169 uint16_t protocolType,
171 bool promiscuous =
false);
a polymophic address class
PacketType
Packet types are used as they are in Linux.
void UnregisterProtocolHandler(ProtocolHandler handler)
std::vector< DeviceAdditionListener > DeviceAdditionListenerList
Typedef for NetDevice addition listeners container.
uint32_t GetSystemId() const
void DoDispose() override
The dispose method.
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.
std::vector< Ptr< Application > > m_applications
Applications associated to this node.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
uint32_t m_id
Node id for this node.
uint32_t GetNDevices() const
Callback< void, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > ProtocolHandler
A protocol handler.
uint32_t GetNApplications() 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.
std::vector< Node::ProtocolHandlerEntry > ProtocolHandlerList
Typedef for protocol handlers container.
uint32_t m_sid
System id for this node.
ProtocolHandlerList m_handlers
Protocol handlers in the node.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
void Construct()
Finish node's construction by setting the correct node ID.
static TypeId GetTypeId()
Get the type ID.
Callback< void, Ptr< NetDevice > > DeviceAdditionListener
A callback invoked whenever a device is added to a node.
Time GetLocalTime() const
In the future, ns3 nodes may have clock that returned a local time different from the virtual time Si...
void RegisterDeviceAdditionListener(DeviceAdditionListener listener)
void DoInitialize() override
Initialize() implementation.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void NotifyDeviceAdded(Ptr< NetDevice > device)
Notifies all the DeviceAdditionListener about the new device added.
static bool ChecksumEnabled()
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.
Smart pointer class similar to boost::intrusive_ptr.
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