#include <node.h>
Public Types | |
typedef Callback< void, Ptr < NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > | ProtocolHandler |
Public Member Functions | |
Node () | |
Node (uint32_t systemId) | |
uint32_t | GetId (void) const |
uint32_t | GetSystemId (void) const |
uint32_t | AddDevice (Ptr< NetDevice > device) |
Ptr< NetDevice > | GetDevice (uint32_t index) const |
uint32_t | GetNDevices (void) const |
uint32_t | AddApplication (Ptr< Application > application) |
Ptr< Application > | GetApplication (uint32_t index) const |
uint32_t | GetNApplications (void) const |
void | RegisterProtocolHandler (ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false) |
void | UnregisterProtocolHandler (ProtocolHandler handler) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Node. | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Private Member Functions | |
virtual void | NotifyDeviceAdded (Ptr< NetDevice > device) |
A network Node.
This class holds together:
Every Node created is added to the NodeList automatically.
typedef Callback<void,Ptr<NetDevice>, Ptr<const Packet>,uint16_t,const Address &, const Address &, NetDevice::PacketType> ns3::Node::ProtocolHandler |
A protocol handler
device | a pointer to the net device which received the packet | |
packet | the packet received | |
protocol | the 16 bit protocol number associated with this packet. This protocol number is expected to be the same protocol number given to the Send method by the user on the sender side. | |
sender | the address of the sender | |
receiver | the address of the receiver; Note: this value is only valid for promiscuous mode protocol handlers. | |
packetType | type of packet received (broadcast/multicast/unicast/otherhost); Note: this value is only valid for promiscuous mode protocol handlers. |
ns3::Node::Node | ( | ) |
Must be invoked by subclasses only.
ns3::Node::Node | ( | uint32_t | systemId | ) |
systemId | a unique integer used for parallel simulations. |
Must be invoked by subclasses only.
uint32_t ns3::Node::AddApplication | ( | Ptr< Application > | application | ) |
application | Application to associate to this node. |
Associated this Application to this Node. This method is called automatically from Application::Application so the user has little reasons to call this method directly.
virtual void ns3::Node::DoDispose | ( | void | ) | [protected, virtual] |
The dispose method. Subclasses must override this method and must chain up to it by calling Node::DoDispose at the end of their own DoDispose method.
Reimplemented from ns3::Object.
Ptr<Application> ns3::Node::GetApplication | ( | uint32_t | index | ) | const |
index |
uint32_t ns3::Node::GetId | ( | void | ) | const |
uint32_t ns3::Node::GetNApplications | ( | void | ) | const |
uint32_t ns3::Node::GetNDevices | ( | void | ) | const |
uint32_t ns3::Node::GetSystemId | ( | void | ) | const |
static TypeId ns3::Node::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::Node.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Object.
device | the device added to this Node. |
This method is invoked whenever a user calls Node::AddDevice.
void ns3::Node::RegisterProtocolHandler | ( | ProtocolHandler | handler, | |
uint16_t | protocolType, | |||
Ptr< NetDevice > | device, | |||
bool | promiscuous = false | |||
) |
handler | the handler to register | |
protocolType | the type of protocol this handler is interested in. This protocol type is a so-called EtherType, as registered here: http://standards.ieee.org/regauth/ethertype/eth.txt the value zero is interpreted as matching all protocols. | |
device | the device attached to this handler. If the value is zero, the handler is attached to all devices on this node. | |
promiscuous | whether to register a promiscuous mode handler |
void ns3::Node::UnregisterProtocolHandler | ( | ProtocolHandler | handler | ) |
handler | the handler to unregister |
After this call returns, the input handler will never be invoked anymore.