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
ipv4-static-routing-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 University of Washington
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*/
6
7
#ifndef IPV4_STATIC_ROUTING_HELPER_H
8
#define IPV4_STATIC_ROUTING_HELPER_H
9
10
#include "
ipv4-routing-helper.h
"
11
12
#include "ns3/ipv4-address.h"
13
#include "ns3/ipv4-static-routing.h"
14
#include "ns3/ipv4.h"
15
#include "ns3/net-device-container.h"
16
#include "ns3/net-device.h"
17
#include "ns3/node-container.h"
18
#include "ns3/node.h"
19
#include "ns3/ptr.h"
20
21
namespace
ns3
22
{
23
24
/**
25
* @ingroup ipv4Helpers
26
*
27
* @brief Helper class that adds ns3::Ipv4StaticRouting objects
28
*
29
* This class is expected to be used in conjunction with
30
* ns3::InternetStackHelper::SetRoutingHelper
31
*/
32
class
Ipv4StaticRoutingHelper
:
public
Ipv4RoutingHelper
33
{
34
public
:
35
/*
36
* Construct an Ipv4StaticRoutingHelper object, used to make configuration
37
* of static routing easier.
38
*/
39
Ipv4StaticRoutingHelper
();
40
41
/**
42
* @brief Construct an Ipv4StaticRoutingHelper from another previously
43
* initialized instance (Copy Constructor).
44
* @param o object to be copied
45
*/
46
Ipv4StaticRoutingHelper
(
const
Ipv4StaticRoutingHelper
& o);
47
48
// Delete assignment operator to avoid misuse
49
Ipv4StaticRoutingHelper
&
operator=
(
const
Ipv4StaticRoutingHelper
&) =
delete
;
50
51
/**
52
* @returns pointer to clone of this Ipv4StaticRoutingHelper
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
Ipv4StaticRoutingHelper
*
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
* Try and find the static routing protocol as either the main routing
69
* protocol or in the list of routing protocols associated with the
70
* Ipv4 provided.
71
*
72
* @param ipv4 the Ptr<Ipv4> to search for the static routing protocol
73
* @returns Ipv4StaticRouting pointer or 0 if not found
74
*/
75
Ptr<Ipv4StaticRouting>
GetStaticRouting
(
Ptr<Ipv4>
ipv4)
const
;
76
77
/**
78
* @brief Add a multicast route to a node and net device using explicit
79
* Ptr<Node> and Ptr<NetDevice>
80
*
81
* @param n The node.
82
* @param source Source address.
83
* @param group Multicast group.
84
* @param input Input NetDevice.
85
* @param output Output NetDevices.
86
*/
87
void
AddMulticastRoute
(
Ptr<Node>
n,
88
Ipv4Address
source,
89
Ipv4Address
group,
90
Ptr<NetDevice>
input,
91
NetDeviceContainer
output);
92
93
/**
94
* @brief Add a multicast route to a node and device using a name string
95
* previously associated to the node using the Object Name Service and a
96
* Ptr<NetDevice>
97
*
98
* @param n The node.
99
* @param source Source address.
100
* @param group Multicast group.
101
* @param input Input NetDevice.
102
* @param output Output NetDevices.
103
*/
104
void
AddMulticastRoute
(std::string n,
105
Ipv4Address
source,
106
Ipv4Address
group,
107
Ptr<NetDevice>
input,
108
NetDeviceContainer
output);
109
110
/**
111
* @brief Add a multicast route to a node and device using a Ptr<Node> and a
112
* name string previously associated to the device using the Object Name Service.
113
*
114
* @param n The node.
115
* @param source Source address.
116
* @param group Multicast group.
117
* @param inputName Input NetDevice.
118
* @param output Output NetDevices.
119
*/
120
void
AddMulticastRoute
(
Ptr<Node>
n,
121
Ipv4Address
source,
122
Ipv4Address
group,
123
std::string inputName,
124
NetDeviceContainer
output);
125
126
/**
127
* @brief Add a multicast route to a node and device using name strings
128
* previously associated to both the node and device using the Object Name
129
* Service.
130
*
131
* @param nName The node.
132
* @param source Source address.
133
* @param group Multicast group.
134
* @param inputName Input NetDevice.
135
* @param output Output NetDevices.
136
*/
137
void
AddMulticastRoute
(std::string nName,
138
Ipv4Address
source,
139
Ipv4Address
group,
140
std::string inputName,
141
NetDeviceContainer
output);
142
143
/**
144
* @brief Add a default route to the static routing protocol to forward
145
* packets out a particular interface
146
*
147
* Functionally equivalent to:
148
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
149
* @param n node
150
* @param nd device of the node to add default route
151
*/
152
void
SetDefaultMulticastRoute
(
Ptr<Node>
n,
Ptr<NetDevice>
nd);
153
154
/**
155
* @brief Add a default route to the static routing protocol to forward
156
* packets out a particular interface
157
*
158
* Functionally equivalent to:
159
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
160
* @param n node
161
* @param ndName string with name previously associated to device using the
162
* Object Name Service
163
*/
164
void
SetDefaultMulticastRoute
(
Ptr<Node>
n, std::string ndName);
165
166
/**
167
* @brief Add a default route to the static routing protocol to forward
168
* packets out a particular interface
169
*
170
* Functionally equivalent to:
171
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
172
* @param nName string with name previously associated to node using the
173
* Object Name Service
174
* @param nd device of the node to add default route
175
*/
176
void
SetDefaultMulticastRoute
(std::string nName,
Ptr<NetDevice>
nd);
177
178
/**
179
* @brief Add a default route to the static routing protocol to forward
180
* packets out a particular interface
181
*
182
* Functionally equivalent to:
183
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
184
* @param nName string with name previously associated to node using the
185
* Object Name Service
186
* @param ndName string with name previously associated to device using the
187
* Object Name Service
188
*/
189
void
SetDefaultMulticastRoute
(std::string nName, std::string ndName);
190
};
191
192
}
// namespace ns3
193
194
#endif
/* IPV4_STATIC_ROUTING_HELPER_H */
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::Ipv4StaticRoutingHelper
Helper class that adds ns3::Ipv4StaticRouting objects.
Definition
ipv4-static-routing-helper.h:33
ns3::Ipv4StaticRoutingHelper::Copy
Ipv4StaticRoutingHelper * Copy() const override
Definition
ipv4-static-routing-helper.cc:36
ns3::Ipv4StaticRoutingHelper::GetStaticRouting
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
Definition
ipv4-static-routing-helper.cc:48
ns3::Ipv4StaticRoutingHelper::operator=
Ipv4StaticRoutingHelper & operator=(const Ipv4StaticRoutingHelper &)=delete
ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper
Ipv4StaticRoutingHelper()
Definition
ipv4-static-routing-helper.cc:27
ns3::Ipv4StaticRoutingHelper::AddMulticastRoute
void AddMulticastRoute(Ptr< Node > n, Ipv4Address source, Ipv4Address group, Ptr< NetDevice > input, NetDeviceContainer output)
Add a multicast route to a node and net device using explicit Ptr<Node> and Ptr<NetDevice>
Definition
ipv4-static-routing-helper.cc:78
ns3::Ipv4StaticRoutingHelper::SetDefaultMulticastRoute
void SetDefaultMulticastRoute(Ptr< Node > n, Ptr< NetDevice > nd)
Add a default route to the static routing protocol to forward packets out a particular interface.
Definition
ipv4-static-routing-helper.cc:149
ns3::Ipv4StaticRoutingHelper::Create
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Definition
ipv4-static-routing-helper.cc:42
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition
net-device-container.h:32
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ipv4-routing-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
helper
ipv4-static-routing-helper.h
Generated on Wed Dec 11 2024 09:20:49 for ns-3 by
1.11.0