#include "node.h"
Classes | |
struct | ProtocolHandlerEntry |
Protocol handler entry. More... | |
Public Types | |
typedef Callback< void, Ptr< NetDevice > > | DeviceAdditionListener |
A callback invoked whenever a device is added to a node. | |
typedef Callback< void, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > | ProtocolHandler |
A protocol handler. | |
Public Member Functions | |
Node () | |
Node (uint32_t systemId) | |
~Node () override | |
uint32_t | AddApplication (Ptr< Application > application) |
Associate an Application to this Node. | |
uint32_t | AddDevice (Ptr< NetDevice > device) |
Associate a NetDevice to this node. | |
Ptr< Application > | GetApplication (uint32_t index) const |
Retrieve the index-th Application associated to this node. | |
Ptr< NetDevice > | GetDevice (uint32_t index) const |
Retrieve the index-th NetDevice associated to this node. | |
uint32_t | GetId () const |
Time | GetLocalTime () const |
In the future, ns3 nodes may have clock that returned a local time different from the virtual time Simulator::Now(). | |
uint32_t | GetNApplications () const |
uint32_t | GetNDevices () const |
uint32_t | GetSystemId () const |
void | RegisterDeviceAdditionListener (DeviceAdditionListener listener) |
void | RegisterProtocolHandler (ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false) |
void | UnregisterDeviceAdditionListener (DeviceAdditionListener listener) |
void | UnregisterProtocolHandler (ProtocolHandler handler) |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
void | UnidirectionalAggregateObject (Ptr< Object > other) |
Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static bool | ChecksumEnabled () |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Protected Member Functions | |
void | DoDispose () override |
The dispose method. | |
void | DoInitialize () override |
Initialize() implementation. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Private Types | |
typedef std::vector< DeviceAdditionListener > | DeviceAdditionListenerList |
Typedef for NetDevice addition listeners container. | |
typedef std::vector< Node::ProtocolHandlerEntry > | ProtocolHandlerList |
Typedef for protocol handlers container. | |
Private Member Functions | |
void | Construct () |
Finish node's construction by setting the correct node ID. | |
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. | |
void | NotifyDeviceAdded (Ptr< NetDevice > device) |
Notifies all the DeviceAdditionListener about the new device added. | |
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. | |
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. | |
Private Attributes | |
std::vector< Ptr< Application > > | m_applications |
Applications associated to this node. | |
DeviceAdditionListenerList | m_deviceAdditionListeners |
Device addition listeners in the node. | |
std::vector< Ptr< NetDevice > > | m_devices |
Devices associated to this node. | |
ProtocolHandlerList | m_handlers |
Protocol handlers in the node. | |
uint32_t | m_id |
Node id for this node. | |
uint32_t | m_sid |
System id for this node. | |
Related Symbols | |
(Note that these are not member symbols.) | |
static GlobalValue | g_checksumEnabled |
| |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
A network Node.
This class holds together:
Every Node created is added to the NodeList automatically.
ns3::Node is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Group: Network
Size of this type is 160 bytes (on a 64-bit architecture).
typedef Callback<void, Ptr<NetDevice> > ns3::Node::DeviceAdditionListener |
|
private |
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. Note: If the L2 protocol does not use L2 addresses, the address reported here is the value of device->GetAddress(). |
packetType | type of packet received (broadcast/multicast/unicast/otherhost); Note: this value is only valid for promiscuous mode protocol handlers. |
|
private |
ns3::Node::Node | ( | ) |
Definition at line 77 of file node.cc.
References Construct(), and NS_LOG_FUNCTION.
ns3::Node::Node | ( | uint32_t | systemId | ) |
systemId | a unique integer used for parallel simulations. |
Definition at line 85 of file node.cc.
References Construct(), and NS_LOG_FUNCTION.
|
override |
Definition at line 100 of file node.cc.
References NS_LOG_FUNCTION.
uint32_t ns3::Node::AddApplication | ( | Ptr< Application > | application | ) |
Associate an Application to this Node.
application | Application to associate to this node. |
Definition at line 153 of file node.cc.
References GetId(), ns3::Object::Initialize(), m_applications, NS_LOG_FUNCTION, ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), BlockAckAggregationDisabledTest::DoRun(), Bug2222TestCase::DoRun(), Bug730TestCase::DoRun(), DsssModulationTest::DoRun(), PacketSocketAppsTest::DoRun(), PingTestCase::DoRun(), PreservePacketsInAmpdus::DoRun(), QosFragmentationTestCase::DoRun(), SpectrumIdealPhyTestCase::DoRun(), WifiTxopTest::DoRun(), WifiUseAvailBwTest::DoRun(), OrigBlockAckWindowStalled::DoSetup(), Experiment::Run(), WifiChannelSwitchingTest::SendPacket(), and BackoffGenerationTest::Transmit().
Associate a NetDevice to this node.
device | NetDevice to associate to this node. |
Definition at line 124 of file node.cc.
References GetId(), ns3::Object::Initialize(), m_devices, ns3::MakeCallback(), NonPromiscReceiveFromDevice(), NotifyDeviceAdded(), NS_LOG_FUNCTION, ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), IcmpEchoReplyTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), IpAddressHelperTestCasev6::DoRun(), PacketSocketAppsTest::DoRun(), SixlowpanIphcStatefulImplTest::DoRun(), ThreeGppAntennaSetupChangedTest::DoRun(), ThreeGppCalcLongTermMultiPortTest::DoRun(), ThreeGppChannelMatrixComputationTest::DoRun(), ThreeGppChannelMatrixUpdateTest::DoRun(), ThreeGppMimoPolarizationTest::DoRun(), ThreeGppSpectrumPropagationLossModelTest::DoRun(), UdpClientServerTestCase::DoRun(), UdpEchoClientSetFillTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), TestWifiPhyRxTraceHelper::DoSetup(), TestWifiPhyRxTraceHelperYans::DoSetup(), TbfQueueDiscTestCase::RunTbfTest(), ns3::Ipv4L3ClickProtocol::SetupLoopback(), ns3::Ipv4L3Protocol::SetupLoopback(), and ns3::Ipv6L3Protocol::SetupLoopback().
|
static |
Definition at line 267 of file node.cc.
References g_checksumEnabled, ns3::BooleanValue::Get(), and ns3::GlobalValue::GetValue().
Referenced by ns3::CsmaNetDevice::AddHeader(), ns3::Ipv4L3ClickProtocol::BuildHeader(), ns3::Ipv4L3Protocol::BuildHeader(), ns3::SixLowPanNetDevice::DecompressLowPanUdpNhc(), ns3::Ipv4L3Protocol::DoFragmentation(), ns3::lrwpan::LrWpanMac::McpsDataRequest(), ns3::lrwpan::LrWpanMac::MlmeAssociateResponse(), ns3::lrwpan::LrWpanMac::MlmeOrphanResponse(), ns3::TcpL4Protocol::PacketReceived(), ns3::lrwpan::LrWpanMac::PdDataIndication(), ns3::CsmaNetDevice::Receive(), ns3::UdpL4Protocol::Receive(), ns3::UdpL4Protocol::Receive(), ns3::Ipv4L3ClickProtocol::Send(), ns3::Ping::Send(), ns3::UdpL4Protocol::Send(), ns3::UdpL4Protocol::Send(), ns3::UdpL4Protocol::Send(), ns3::UdpL4Protocol::Send(), ns3::V4TraceRoute::Send(), ns3::lrwpan::LrWpanMac::SendAck(), ns3::lrwpan::LrWpanMac::SendAssocRequestCommand(), ns3::lrwpan::LrWpanMac::SendBeaconRequestCommand(), ns3::lrwpan::LrWpanMac::SendDataRequestCommand(), ns3::Icmpv4L4Protocol::SendMessage(), ns3::lrwpan::LrWpanMac::SendOneBeacon(), ns3::lrwpan::LrWpanMac::SendOrphanNotificationCommand(), ns3::TcpL4Protocol::SendPacketV4(), ns3::TcpL4Protocol::SendPacketV6(), ChainRegressionTest::SendPing(), ns3::olsr::Bug780Test::SendPing(), ns3::Ipv4L3ClickProtocol::SendWithHeader(), and ns3::Ipv4L3Protocol::SendWithHeader().
|
private |
Finish node's construction by setting the correct node ID.
Definition at line 94 of file node.cc.
References ns3::NodeList::Add(), m_id, and NS_LOG_FUNCTION.
Referenced by Node(), and Node().
|
overrideprotectedvirtual |
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.
Definition at line 179 of file node.cc.
References ns3::Object::DoDispose(), m_applications, m_deviceAdditionListeners, m_devices, m_handlers, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 202 of file node.cc.
References ns3::Object::DoInitialize(), m_applications, m_devices, and NS_LOG_FUNCTION.
Ptr< Application > ns3::Node::GetApplication | ( | uint32_t | index | ) | const |
Retrieve the index-th Application associated to this node.
index | the index of the requested Application |
Definition at line 164 of file node.cc.
References m_applications, and NS_ASSERT_MSG.
Retrieve the index-th NetDevice associated to this node.
index | the index of the requested NetDevice |
Definition at line 138 of file node.cc.
References m_devices, and NS_ASSERT_MSG.
Referenced by ns3::Socket::BindToNetDevice(), TestWifiPhyRxTraceHelperMloStr::CheckStats(), TestWifiPhyRxTraceHelperMloStr::CheckStats(), ns3::PacketSocket::DoBind(), AcousticModemEnergyTestCase::DoRun(), StaWifiMacScanningTestCase::DoRun(), ns3::PacketSocket::GetMinMtu(), ns3::TrafficControlLayer::GetRootQueueDiscOnDeviceByIndex(), ns3::PacketSocket::GetSockName(), ns3::AcousticModemEnergyModel::HandleEnergyDepletion(), ns3::AcousticModemEnergyModel::HandleEnergyRecharged(), ns3::Radvd::HandleRead(), ns3::DhcpServer::NetHandler(), Experiment::Run(), Experiment::Run(), ns3::TrafficControlLayer::ScanDevices(), ns3::PacketSocket::SendTo(), ns3::Ipv4L3ClickProtocol::SetupLoopback(), ns3::Ipv4L3Protocol::SetupLoopback(), and ns3::Ipv6L3Protocol::SetupLoopback().
uint32_t ns3::Node::GetId | ( | ) | const |
This unique id happens to be also the index of the Node into the NodeList.
Definition at line 106 of file node.cc.
References m_id.
Referenced by AddApplication(), AddDevice(), ns3::TcpSocketBase::AddOptionSack(), ns3::TcpSocketBase::AddOptionSackPermitted(), ns3::TcpSocketBase::AddOptionTimestamp(), ns3::TcpSocketBase::AddOptionWScale(), ns3::TcpSocketBase::CalculateWScale(), ns3::AcousticModemEnergyModel::ChangeState(), Bug772ChainTest::CreateDevices(), Ipv4FragmentationTest::DoRun(), Ipv6FragmentationTest::DoRun(), ns3::aodv::LoopbackTestCase::DoRun(), ns3::TcpGeneralTest::DoRun(), SixlowpanFragmentationTest::DoRun(), TestWifiPhyRxTraceHelper::DoRun(), TestWifiPhyRxTraceHelperMloStr::DoRun(), TestWifiPhyRxTraceHelperYans::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), ns3::SixLowPanNetDevice::DoSend(), ns3::InternetStackHelper::EnableAsciiIpv4Internal(), ns3::InternetStackHelper::EnableAsciiIpv6Internal(), ns3::InternetStackHelper::EnablePcapIpv4Internal(), ns3::InternetStackHelper::EnablePcapIpv6Internal(), ns3::UanPhyGen::EnergyDepletionHandler(), ns3::UanPhyGen::EnergyRechargeHandler(), ns3::ThreeGppChannelModel::GenerateChannelParameters(), ns3::Ping::GetApplicationSignature(), ns3::ThreeGppChannelModel::GetChannel(), ns3::ThreeGppChannelConditionModel::GetKey(), ns3::ThreeGppPropagationLossModel::GetKey(), ns3::ThreeGppChannelModel::GetNewChannel(), ns3::PyViz::GetPacketDropSamples(), ns3::ThreeGppChannelModel::GetParams(), ns3::PyViz::GetTransmissionSamples(), ns3::AcousticModemEnergyModel::HandleEnergyDepletion(), ns3::AcousticModemEnergyModel::HandleEnergyRecharged(), FlameRegressionTest::InstallApplications(), HwmpDoRfRegressionTest::InstallApplications(), HwmpProactiveRegressionTest::InstallApplications(), HwmpReactiveRegressionTest::InstallApplications(), HwmpSimplestRegressionTest::InstallApplications(), ns3::Ipv4L3Protocol::IpForward(), ns3::Ipv6L3Protocol::IpForward(), ns3::Ipv4L3Protocol::IpMulticastForward(), ns3::Ipv6L3Protocol::IpMulticastForward(), ns3::Ipv4L3ProtocolDropSinkWithContext(), ns3::Ipv4L3ProtocolDropSinkWithoutContext(), ns3::Ipv4L3ProtocolRxSinkWithContext(), ns3::Ipv4L3ProtocolRxSinkWithoutContext(), ns3::Ipv4L3ProtocolRxTxSink(), ns3::Ipv4L3ProtocolTxSinkWithContext(), ns3::Ipv4L3ProtocolTxSinkWithoutContext(), ns3::Ipv6L3ProtocolDropSinkWithContext(), ns3::Ipv6L3ProtocolDropSinkWithoutContext(), ns3::Ipv6L3ProtocolRxSinkWithContext(), ns3::Ipv6L3ProtocolRxSinkWithoutContext(), ns3::Ipv6L3ProtocolRxTxSink(), ns3::Ipv6L3ProtocolTxSinkWithContext(), ns3::Ipv6L3ProtocolTxSinkWithoutContext(), ns3::ArpL3Protocol::Lookup(), ns3::AnimationInterface::OutputCsmaPacket(), ns3::AnimationInterface::OutputWirelessPacketRxInfo(), ns3::AnimationInterface::OutputWirelessPacketTxInfo(), ns3::TcpSocketBase::ProcessOptionSackPermitted(), ns3::TcpSocketBase::ProcessOptionTimestamp(), ns3::TcpSocketBase::ProcessOptionWScale(), ns3::ArpL3Protocol::Receive(), ns3::Ipv4L3ClickProtocol::Receive(), ns3::Ipv4L3Protocol::Receive(), ns3::Ipv6L3Protocol::Receive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ReceiveFromDevice(), ns3::Ipv4ListRouting::RouteInput(), ns3::Ipv6ListRouting::RouteInput(), ns3::olsr::RoutingProtocol::RouteInput(), ns3::olsr::RoutingProtocol::RouteOutput(), ns3::TrafficControlLayer::ScanDevices(), ns3::LoopbackNetDevice::Send(), ns3::ArpL3Protocol::SendArpReply(), ns3::ArpL3Protocol::SendArpRequest(), ns3::LoopbackNetDevice::SendFrom(), ns3::SubscriberStationNetDevice::SetBasicConnection(), ns3::SubscriberStationNetDevice::SetPrimaryConnection(), ns3::TapBridge::StartTapDevice(), and ns3::PyViz::TraceNetDevRxCommon().
Time ns3::Node::GetLocalTime | ( | ) | const |
In the future, ns3 nodes may have clock that returned a local time different from the virtual time Simulator::Now().
This function is currently a placeholder to ease the development of this feature. For now, it is only an alias to Simulator::Now()
Definition at line 112 of file node.cc.
References ns3::Simulator::Now().
uint32_t ns3::Node::GetNApplications | ( | ) | const |
Definition at line 173 of file node.cc.
References m_applications.
uint32_t ns3::Node::GetNDevices | ( | ) | const |
Definition at line 147 of file node.cc.
References m_devices.
Referenced by ns3::Socket::BindToNetDevice(), ns3::PacketSocket::GetMinMtu(), ns3::TrafficControlLayer::GetNDevices(), ns3::TrafficControlLayer::ScanDevices(), ns3::PacketSocket::SendTo(), ns3::Ipv4L3ClickProtocol::SetupLoopback(), ns3::Ipv4L3Protocol::SetupLoopback(), and ns3::Ipv6L3Protocol::SetupLoopback().
uint32_t ns3::Node::GetSystemId | ( | ) | const |
|
static |
Get the type ID.
Definition at line 44 of file node.cc.
References ns3::TypeId::ATTR_GET, ns3::TypeId::ATTR_SET, m_applications, m_devices, m_id, m_sid, ns3::MakeObjectVectorAccessor(), ns3::MakeObjectVectorChecker(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), and ns3::TypeId::SetParent().
|
private |
Receive a packet from a device in non-promiscuous mode.
device | the device |
packet | the packet |
protocol | the protocol |
from | the sender |
Definition at line 287 of file node.cc.
References NS_LOG_FUNCTION, and ReceiveFromDevice().
Referenced by AddDevice().
Notifies all the DeviceAdditionListener about the new device added.
device | the added device to notify. |
Definition at line 366 of file node.cc.
References m_deviceAdditionListeners, and NS_LOG_FUNCTION.
Referenced by AddDevice().
|
private |
Receive a packet from a device in promiscuous mode.
device | the device |
packet | the packet |
protocol | the protocol |
from | the sender |
to | the destination |
packetType | the packet type |
Definition at line 275 of file node.cc.
References NS_LOG_FUNCTION, and ReceiveFromDevice().
Referenced by RegisterProtocolHandler().
|
private |
Receive a packet from a device.
device | the device |
packet | the packet |
protocol | the protocol |
from | the sender |
to | the destination |
packetType | the packet type |
promisc | true if received in promiscuous mode |
Definition at line 303 of file node.cc.
References ns3::Simulator::GetContext(), GetId(), m_handlers, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by NonPromiscReceiveFromDevice(), and PromiscReceiveFromDevice().
void ns3::Node::RegisterDeviceAdditionListener | ( | DeviceAdditionListener | listener | ) |
listener | the listener to add |
Add a new listener to the list of listeners for the device-added event. When a new listener is added, it is notified of the existence of all already-added devices to make discovery of devices easier.
Definition at line 340 of file node.cc.
References m_deviceAdditionListeners, m_devices, and NS_LOG_FUNCTION.
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 |
Definition at line 220 of file node.cc.
References ns3::Node::ProtocolHandlerEntry::device, ns3::Node::ProtocolHandlerEntry::handler, m_devices, m_handlers, ns3::MakeCallback(), NS_LOG_FUNCTION, PromiscReceiveFromDevice(), ns3::Node::ProtocolHandlerEntry::promiscuous, and ns3::Node::ProtocolHandlerEntry::protocol.
Referenced by ns3::BridgeNetDevice::AddBridgePort(), ns3::Ipv4L3Protocol::AddInterface(), ns3::Ipv6L3Protocol::AddInterface(), ns3::MeshPointDevice::AddInterface(), ns3::OpenFlowSwitchNetDevice::AddSwitchPort(), ns3::PacketSocket::DoBind(), and ns3::SixLowPanNetDevice::SetNetDevice().
void ns3::Node::UnregisterDeviceAdditionListener | ( | DeviceAdditionListener | listener | ) |
listener | the listener to remove |
Remove an existing listener from the list of listeners for the device-added event.
Definition at line 352 of file node.cc.
References m_deviceAdditionListeners, and NS_LOG_FUNCTION.
void ns3::Node::UnregisterProtocolHandler | ( | ProtocolHandler | handler | ) |
handler | the handler to unregister |
After this call returns, the input handler will never be invoked anymore.
Definition at line 253 of file node.cc.
References m_handlers, and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::Close().
|
related |
A global switch to enable all checksums for all protocols.
Definition at line 37 of file node.cc.
Referenced by ChecksumEnabled().
|
private |
Applications associated to this node.
Definition at line 293 of file node.h.
Referenced by AddApplication(), DoDispose(), DoInitialize(), GetApplication(), GetNApplications(), and GetTypeId().
|
private |
Device addition listeners in the node.
Definition at line 295 of file node.h.
Referenced by DoDispose(), NotifyDeviceAdded(), RegisterDeviceAdditionListener(), and UnregisterDeviceAdditionListener().
Devices associated to this node.
Definition at line 292 of file node.h.
Referenced by AddDevice(), DoDispose(), DoInitialize(), GetDevice(), GetNDevices(), GetTypeId(), RegisterDeviceAdditionListener(), and RegisterProtocolHandler().
|
private |
Protocol handlers in the node.
Definition at line 294 of file node.h.
Referenced by DoDispose(), ReceiveFromDevice(), RegisterProtocolHandler(), and UnregisterProtocolHandler().
|
private |
Node id for this node.
Definition at line 290 of file node.h.
Referenced by Construct(), GetId(), and GetTypeId().
|
private |
System id for this node.
Definition at line 291 of file node.h.
Referenced by GetSystemId(), and GetTypeId().