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