A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
olsr-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
#ifndef OLSR_HELPER_H
9
#define OLSR_HELPER_H
10
11
#include "ns3/ipv4-routing-helper.h"
12
#include "ns3/node-container.h"
13
#include "ns3/node.h"
14
#include "ns3/object-factory.h"
15
16
#include <map>
17
#include <set>
18
19
namespace
ns3
20
{
21
22
/**
23
* \ingroup olsr
24
*
25
* \brief Helper class that adds OLSR routing to nodes.
26
*
27
* This class is expected to be used in conjunction with
28
* ns3::InternetStackHelper::SetRoutingHelper
29
*/
30
class
OlsrHelper
:
public
Ipv4RoutingHelper
31
{
32
public
:
33
/**
34
* Create an OlsrHelper that makes life easier for people who want to install
35
* OLSR routing to nodes.
36
*/
37
OlsrHelper
();
38
39
/**
40
* \brief Construct an OlsrHelper from another previously initialized instance
41
* (Copy Constructor).
42
*
43
* \param o object to copy
44
*/
45
OlsrHelper
(
const
OlsrHelper
& o);
46
47
// Delete assignment operator to avoid misuse
48
OlsrHelper
&
operator=
(
const
OlsrHelper
&) =
delete
;
49
50
/**
51
* \returns pointer to clone of this OlsrHelper
52
*
53
* This method is mainly for internal use by the other helpers;
54
* clients are expected to free the dynamic memory allocated by this method
55
*/
56
OlsrHelper
*
Copy
()
const override
;
57
58
/**
59
* \param node the node for which an exception is to be defined
60
* \param interface an interface of node on which OLSR is not to be installed
61
*
62
* This method allows the user to specify an interface on which OLSR is not to be installed on
63
*/
64
void
ExcludeInterface
(
Ptr<Node>
node,
uint32_t
interface);
65
66
/**
67
* \param node the node on which the routing protocol will run
68
* \returns a newly-created routing protocol
69
*
70
* This method will be called by ns3::InternetStackHelper::Install
71
*/
72
Ptr<Ipv4RoutingProtocol>
Create
(
Ptr<Node>
node)
const override
;
73
74
/**
75
* \param name the name of the attribute to set
76
* \param value the value of the attribute to set.
77
*
78
* This method controls the attributes of ns3::olsr::RoutingProtocol
79
*/
80
void
Set
(std::string name,
const
AttributeValue
& value);
81
82
/**
83
* Assign a fixed random variable stream number to the random variables
84
* used by this model. Return the number of streams (possibly zero) that
85
* have been assigned. The Install() method of the InternetStackHelper
86
* should have previously been called by the user.
87
*
88
* \param stream first stream index to use
89
* \param c NodeContainer of the set of nodes for which the OlsrRoutingProtocol
90
* should be modified to use a fixed stream
91
* \return the number of stream indices assigned by this helper
92
*/
93
int64_t
AssignStreams
(
NodeContainer
c, int64_t stream);
94
95
private
:
96
ObjectFactory
m_agentFactory
;
//!< Object factory
97
98
std::map<Ptr<Node>, std::set<uint32_t>>
99
m_interfaceExclusions
;
//!< container of interfaces excluded from OLSR operations
100
};
101
102
}
// namespace ns3
103
104
#endif
/* OLSR_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::Ipv4RoutingHelper
a factory to create ns3::Ipv4RoutingProtocol objects
Definition
ipv4-routing-helper.h:35
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::OlsrHelper
Helper class that adds OLSR routing to nodes.
Definition
olsr-helper.h:31
ns3::OlsrHelper::Set
void Set(std::string name, const AttributeValue &value)
Definition
olsr-helper.cc:71
ns3::OlsrHelper::ExcludeInterface
void ExcludeInterface(Ptr< Node > node, uint32_t interface)
Definition
olsr-helper.cc:37
ns3::OlsrHelper::AssignStreams
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition
olsr-helper.cc:77
ns3::OlsrHelper::OlsrHelper
OlsrHelper()
Create an OlsrHelper that makes life easier for people who want to install OLSR routing to nodes.
Definition
olsr-helper.cc:19
ns3::OlsrHelper::Copy
OlsrHelper * Copy() const override
Definition
olsr-helper.cc:31
ns3::OlsrHelper::m_interfaceExclusions
std::map< Ptr< Node >, std::set< uint32_t > > m_interfaceExclusions
container of interfaces excluded from OLSR operations
Definition
olsr-helper.h:99
ns3::OlsrHelper::Create
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Definition
olsr-helper.cc:55
ns3::OlsrHelper::m_agentFactory
ObjectFactory m_agentFactory
Object factory.
Definition
olsr-helper.h:96
ns3::OlsrHelper::operator=
OlsrHelper & operator=(const OlsrHelper &)=delete
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
olsr
helper
olsr-helper.h
Generated on Fri Nov 8 2024 13:59:05 for ns-3 by
1.11.0