26 #include "ns3/object.h"
27 #include "ns3/callback.h"
29 #include "ns3/net-device.h"
68 Node(uint32_t systemId);
78 uint32_t
GetId (
void)
const;
163 uint16_t protocolType,
165 bool promiscuous=
false);
uint32_t AddApplication(Ptr< Application > application)
smart pointer class similar to boost::intrusive_ptr
uint32_t GetNApplications(void) const
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.
DeviceAdditionListenerList m_deviceAdditionListeners
Device addition listeners in the node.
std::vector< DeviceAdditionListener > DeviceAdditionListenerList
Typedef for NetDevice addition listeners container.
static bool ChecksumEnabled(void)
void NotifyDeviceAdded(Ptr< NetDevice > device)
Notifies all the DeviceAdditionListener about the new device added.
ProtocolHandler handler
the protocol handler
std::vector< Ptr< NetDevice > > m_devices
Devices associated to this node.
uint32_t GetSystemId(void) const
void UnregisterProtocolHandler(ProtocolHandler handler)
a polymophic address class
std::vector< struct Node::ProtocolHandlerEntry > ProtocolHandlerList
Typedef for protocol handlers container.
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.
uint32_t m_sid
System id for this node.
Ptr< Application > GetApplication(uint32_t index) const
virtual void DoDispose(void)
The dispose method.
Ptr< NetDevice > device
the NetDevice
Ptr< NetDevice > GetDevice(uint32_t index) const
uint16_t protocol
the protocol number
uint32_t GetNDevices(void) const
ProtocolHandlerList m_handlers
Protocol handlers in the node.
void RegisterDeviceAdditionListener(DeviceAdditionListener listener)
std::vector< Ptr< Application > > m_applications
Applications associated to this node.
uint32_t m_id
Node id for this node.
void RegisterProtocolHandler(ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false)
static TypeId GetTypeId(void)
Get the type ID.
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.
uint32_t AddDevice(Ptr< NetDevice > device)
uint32_t GetId(void) const
void UnregisterDeviceAdditionListener(DeviceAdditionListener listener)
Callback< void, Ptr< NetDevice > > DeviceAdditionListener
A callback invoked whenever a device is added to a node.
a base class which provides memory management and object aggregation
Callback< void, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > ProtocolHandler
A protocol handler.
PacketType
Packet types are used as they are in Linux.
a unique identifier for an interface.
void Construct(void)
Finish node's construction by setting the correct node ID.
bool promiscuous
true if it is a promiscuous handler
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.