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
ripng-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Universita' di Firenze, Italy
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
7
*/
8
9
#ifndef RIPNG_HELPER_H
10
#define RIPNG_HELPER_H
11
12
#include "
ipv6-routing-helper.h
"
13
14
#include "ns3/node-container.h"
15
#include "ns3/node.h"
16
#include "ns3/object-factory.h"
17
18
#include <map>
19
20
namespace
ns3
21
{
22
23
/**
24
* \ingroup ipv6Helpers
25
*
26
* \brief Helper class that adds RIPng routing to nodes.
27
*
28
* This class is expected to be used in conjunction with
29
* ns3::InternetStackHelper::SetRoutingHelper
30
*
31
*/
32
class
RipNgHelper
:
public
Ipv6RoutingHelper
33
{
34
public
:
35
/*
36
* Construct an RipNgHelper to make life easier while adding RIPng
37
* routing to nodes.
38
*/
39
RipNgHelper
();
40
41
/**
42
* \brief Construct an RipNgHelper from another previously
43
* initialized instance (Copy Constructor).
44
* \param o The object to copy from.
45
*/
46
RipNgHelper
(
const
RipNgHelper
& o);
47
48
~RipNgHelper
()
override
;
49
50
// Delete assignment operator to avoid misuse
51
RipNgHelper
&
operator=
(
const
RipNgHelper
&) =
delete
;
52
53
/**
54
* \returns pointer to clone of this RipNgHelper
55
*
56
* This method is mainly for internal use by the other helpers;
57
* clients are expected to free the dynamic memory allocated by this method
58
*/
59
RipNgHelper
*
Copy
()
const override
;
60
61
/**
62
* \param node the node on which the routing protocol will run
63
* \returns a newly-created routing protocol
64
*
65
* This method will be called by ns3::InternetStackHelper::Install
66
*/
67
Ptr<Ipv6RoutingProtocol>
Create
(
Ptr<Node>
node)
const override
;
68
69
/**
70
* \param name the name of the attribute to set
71
* \param value the value of the attribute to set.
72
*
73
* This method controls the attributes of ns3::RipNg
74
*/
75
void
Set
(std::string name,
const
AttributeValue
& value);
76
77
/**
78
* Assign a fixed random variable stream number to the random variables
79
* used by this model. Return the number of streams (possibly zero) that
80
* have been assigned. The Install() method should have previously been
81
* called by the user.
82
*
83
* \param c NetDeviceContainer of the set of net devices for which the
84
* SixLowPanNetDevice should be modified to use a fixed stream
85
* \param stream first stream index to use
86
* \return the number of stream indices assigned by this helper
87
*/
88
int64_t
AssignStreams
(
NodeContainer
c, int64_t stream);
89
90
/**
91
* \brief Install a default route in the node.
92
*
93
* The traffic will be routed to the nextHop, located on the specified
94
* interface, unless a more specific route is found.
95
*
96
* \param node the node
97
* \param nextHop the next hop
98
* \param interface the network interface
99
*/
100
void
SetDefaultRouter
(
Ptr<Node>
node,
Ipv6Address
nextHop,
uint32_t
interface);
101
102
/**
103
* \brief Exclude an interface from RIPng protocol.
104
*
105
* You have to call this function \a before installing RIPng in the nodes.
106
*
107
* Note: the exclusion means that RIPng will not be propagated on that interface.
108
* The network prefix on that interface will be still considered in RIPng.
109
*
110
* \param node the node
111
* \param interface the network interface to be excluded
112
*/
113
void
ExcludeInterface
(
Ptr<Node>
node,
uint32_t
interface);
114
115
/**
116
* \brief Set a metric for an interface.
117
*
118
* You have to call this function \a before installing RIPng in the nodes.
119
*
120
* Note: RIPng will apply the metric on route message reception.
121
* As a consequence, interface metric should be set on the receiver.
122
*
123
* \param node the node
124
* \param interface the network interface
125
* \param metric the interface metric
126
*/
127
void
SetInterfaceMetric
(
Ptr<Node>
node,
uint32_t
interface, uint8_t metric);
128
129
private
:
130
ObjectFactory
m_factory
;
//!< Object Factory
131
132
std::map<Ptr<Node>, std::set<uint32_t>>
m_interfaceExclusions
;
//!< Interface Exclusion set
133
std::map<Ptr<Node>, std::map<uint32_t, uint8_t>>
m_interfaceMetrics
;
//!< Interface Metric set
134
};
135
136
}
// namespace ns3
137
138
#endif
/* RIPNG_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::Ipv6Address
Describes an IPv6 address.
Definition
ipv6-address.h:38
ns3::Ipv6RoutingHelper
A factory to create ns3::Ipv6RoutingProtocol objects.
Definition
ipv6-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::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::RipNgHelper
Helper class that adds RIPng routing to nodes.
Definition
ripng-helper.h:33
ns3::RipNgHelper::RipNgHelper
RipNgHelper()
Definition
ripng-helper.cc:21
ns3::RipNgHelper::SetDefaultRouter
void SetDefaultRouter(Ptr< Node > node, Ipv6Address nextHop, uint32_t interface)
Install a default route in the node.
Definition
ripng-helper.cc:118
ns3::RipNgHelper::ExcludeInterface
void ExcludeInterface(Ptr< Node > node, uint32_t interface)
Exclude an interface from RIPng protocol.
Definition
ripng-helper.cc:150
ns3::RipNgHelper::Create
Ptr< Ipv6RoutingProtocol > Create(Ptr< Node > node) const override
Definition
ripng-helper.cc:46
ns3::RipNgHelper::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
ripng-helper.cc:78
ns3::RipNgHelper::Copy
RipNgHelper * Copy() const override
Definition
ripng-helper.cc:40
ns3::RipNgHelper::SetInterfaceMetric
void SetInterfaceMetric(Ptr< Node > node, uint32_t interface, uint8_t metric)
Set a metric for an interface.
Definition
ripng-helper.cc:168
ns3::RipNgHelper::m_interfaceExclusions
std::map< Ptr< Node >, std::set< uint32_t > > m_interfaceExclusions
Interface Exclusion set.
Definition
ripng-helper.h:132
ns3::RipNgHelper::Set
void Set(std::string name, const AttributeValue &value)
Definition
ripng-helper.cc:72
ns3::RipNgHelper::~RipNgHelper
~RipNgHelper() override
Definition
ripng-helper.cc:33
ns3::RipNgHelper::m_interfaceMetrics
std::map< Ptr< Node >, std::map< uint32_t, uint8_t > > m_interfaceMetrics
Interface Metric set.
Definition
ripng-helper.h:133
ns3::RipNgHelper::m_factory
ObjectFactory m_factory
Object Factory.
Definition
ripng-helper.h:130
ns3::RipNgHelper::operator=
RipNgHelper & operator=(const RipNgHelper &)=delete
uint32_t
ipv6-routing-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
helper
ripng-helper.h
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0