A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::OlsrHelper Class Reference

Helper class that adds OLSR routing to nodes. More...

#include "olsr-helper.h"

+ Inheritance diagram for ns3::OlsrHelper:
+ Collaboration diagram for ns3::OlsrHelper:

Public Member Functions

 OlsrHelper ()
 Create an OlsrHelper that makes life easier for people who want to install OLSR routing to nodes.
 
 OlsrHelper (const OlsrHelper &o)
 Construct an OlsrHelper from another previously initialized instance (Copy Constructor).
 
int64_t AssignStreams (NodeContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
OlsrHelperCopy () const override
 
Ptr< Ipv4RoutingProtocolCreate (Ptr< Node > node) const override
 
void ExcludeInterface (Ptr< Node > node, uint32_t interface)
 
OlsrHelperoperator= (const OlsrHelper &)=delete
 
void Set (std::string name, const AttributeValue &value)
 
- Public Member Functions inherited from ns3::Ipv4RoutingHelper
virtual ~Ipv4RoutingHelper ()
 
virtual Ipv4RoutingHelperCopy () const =0
 virtual constructor
 
virtual Ptr< Ipv4RoutingProtocolCreate (Ptr< Node > node) const =0
 

Private Attributes

ObjectFactory m_agentFactory
 Object factory.
 
std::map< Ptr< Node >, std::set< uint32_t > > m_interfaceExclusions
 container of interfaces excluded from OLSR operations
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::Ipv4RoutingHelper
template<class T >
static Ptr< T > GetRouting (Ptr< Ipv4RoutingProtocol > protocol)
 Request a specified routing protocol <T> from Ipv4RoutingProtocol protocol.
 
static void PrintNeighborCacheAllAt (Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of all nodes at a particular time.
 
static void PrintNeighborCacheAllEvery (Time printInterval, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of all nodes at regular intervals specified by user.
 
static void PrintNeighborCacheAt (Time printTime, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of a node at a particular time.
 
static void PrintNeighborCacheEvery (Time printInterval, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of a node at regular intervals specified by user.
 
static void PrintRoutingTableAllAt (Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of all nodes at a particular time.
 
static void PrintRoutingTableAllEvery (Time printInterval, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of all nodes at regular intervals specified by user.
 
static void PrintRoutingTableAt (Time printTime, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of a node at a particular time.
 
static void PrintRoutingTableEvery (Time printInterval, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of a node at regular intervals specified by user.
 

Detailed Description

Helper class that adds OLSR routing to nodes.

This class is expected to be used in conjunction with ns3::InternetStackHelper::SetRoutingHelper

Definition at line 41 of file olsr-helper.h.

Constructor & Destructor Documentation

◆ OlsrHelper() [1/2]

ns3::OlsrHelper::OlsrHelper ( )

Create an OlsrHelper that makes life easier for people who want to install OLSR routing to nodes.

Definition at line 30 of file olsr-helper.cc.

References m_agentFactory, and ns3::ObjectFactory::SetTypeId().

Referenced by Copy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OlsrHelper() [2/2]

ns3::OlsrHelper::OlsrHelper ( const OlsrHelper o)

Construct an OlsrHelper from another previously initialized instance (Copy Constructor).

Parameters
oobject to copy

Definition at line 35 of file olsr-helper.cc.

References m_interfaceExclusions.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::OlsrHelper::AssignStreams ( NodeContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned. The Install() method of the InternetStackHelper should have previously been called by the user.

Parameters
streamfirst stream index to use
cNodeContainer of the set of nodes for which the OlsrRoutingProtocol should be modified to use a fixed stream
Returns
the number of stream indices assigned by this helper

Definition at line 88 of file olsr-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), list, and NS_ASSERT_MSG.

+ Here is the call graph for this function:

◆ Copy()

OlsrHelper * ns3::OlsrHelper::Copy ( ) const
overridevirtual
Returns
pointer to clone of this OlsrHelper

This method is mainly for internal use by the other helpers; clients are expected to free the dynamic memory allocated by this method

Implements ns3::Ipv4RoutingHelper.

Definition at line 42 of file olsr-helper.cc.

References OlsrHelper().

+ Here is the call graph for this function:

◆ Create()

Ptr< Ipv4RoutingProtocol > ns3::OlsrHelper::Create ( Ptr< Node node) const
overridevirtual
Parameters
nodethe node on which the routing protocol will run
Returns
a newly-created routing protocol

This method will be called by ns3::InternetStackHelper::Install

Implements ns3::Ipv4RoutingHelper.

Definition at line 66 of file olsr-helper.cc.

References ns3::ObjectFactory::Create(), m_agentFactory, and m_interfaceExclusions.

+ Here is the call graph for this function:

◆ ExcludeInterface()

void ns3::OlsrHelper::ExcludeInterface ( Ptr< Node node,
uint32_t  interface 
)
Parameters
nodethe node for which an exception is to be defined
interfacean interface of node on which OLSR is not to be installed

This method allows the user to specify an interface on which OLSR is not to be installed on

Definition at line 48 of file olsr-helper.cc.

References m_interfaceExclusions.

◆ operator=()

OlsrHelper & ns3::OlsrHelper::operator= ( const OlsrHelper )
delete

◆ Set()

void ns3::OlsrHelper::Set ( std::string  name,
const AttributeValue value 
)
Parameters
namethe name of the attribute to set
valuethe value of the attribute to set.

This method controls the attributes of ns3::olsr::RoutingProtocol

Definition at line 82 of file olsr-helper.cc.

References m_agentFactory, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_agentFactory

ObjectFactory ns3::OlsrHelper::m_agentFactory
private

Object factory.

Definition at line 107 of file olsr-helper.h.

Referenced by OlsrHelper(), Create(), and Set().

◆ m_interfaceExclusions

std::map<Ptr<Node>, std::set<uint32_t> > ns3::OlsrHelper::m_interfaceExclusions
private

container of interfaces excluded from OLSR operations

Definition at line 110 of file olsr-helper.h.

Referenced by OlsrHelper(), Create(), and ExcludeInterface().


The documentation for this class was generated from the following files: