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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*/
17
18
#ifndef IPV4_STATIC_ROUTING_HELPER_H
19
#define IPV4_STATIC_ROUTING_HELPER_H
20
21
#include "
ipv4-routing-helper.h
"
22
23
#include "ns3/ipv4-address.h"
24
#include "ns3/ipv4-static-routing.h"
25
#include "ns3/ipv4.h"
26
#include "ns3/net-device-container.h"
27
#include "ns3/net-device.h"
28
#include "ns3/node-container.h"
29
#include "ns3/node.h"
30
#include "ns3/ptr.h"
31
32
namespace
ns3
33
{
34
35
/**
36
* \ingroup ipv4Helpers
37
*
38
* \brief Helper class that adds ns3::Ipv4StaticRouting objects
39
*
40
* This class is expected to be used in conjunction with
41
* ns3::InternetStackHelper::SetRoutingHelper
42
*/
43
class
Ipv4StaticRoutingHelper
:
public
Ipv4RoutingHelper
44
{
45
public
:
46
/*
47
* Construct an Ipv4StaticRoutingHelper object, used to make configuration
48
* of static routing easier.
49
*/
50
Ipv4StaticRoutingHelper
();
51
52
/**
53
* \brief Construct an Ipv4StaticRoutingHelper from another previously
54
* initialized instance (Copy Constructor).
55
* \param o object to be copied
56
*/
57
Ipv4StaticRoutingHelper
(
const
Ipv4StaticRoutingHelper
& o);
58
59
// Delete assignment operator to avoid misuse
60
Ipv4StaticRoutingHelper
&
operator=
(
const
Ipv4StaticRoutingHelper
&) =
delete
;
61
62
/**
63
* \returns pointer to clone of this Ipv4StaticRoutingHelper
64
*
65
* This method is mainly for internal use by the other helpers;
66
* clients are expected to free the dynamic memory allocated by this method
67
*/
68
Ipv4StaticRoutingHelper
*
Copy
()
const override
;
69
70
/**
71
* \param node the node on which the routing protocol will run
72
* \returns a newly-created routing protocol
73
*
74
* This method will be called by ns3::InternetStackHelper::Install
75
*/
76
Ptr<Ipv4RoutingProtocol>
Create
(
Ptr<Node>
node)
const override
;
77
78
/**
79
* Try and find the static routing protocol as either the main routing
80
* protocol or in the list of routing protocols associated with the
81
* Ipv4 provided.
82
*
83
* \param ipv4 the Ptr<Ipv4> to search for the static routing protocol
84
* \returns Ipv4StaticRouting pointer or 0 if not found
85
*/
86
Ptr<Ipv4StaticRouting>
GetStaticRouting
(
Ptr<Ipv4>
ipv4)
const
;
87
88
/**
89
* \brief Add a multicast route to a node and net device using explicit
90
* Ptr<Node> and Ptr<NetDevice>
91
*
92
* \param n The node.
93
* \param source Source address.
94
* \param group Multicast group.
95
* \param input Input NetDevice.
96
* \param output Output NetDevices.
97
*/
98
void
AddMulticastRoute
(
Ptr<Node>
n,
99
Ipv4Address
source,
100
Ipv4Address
group,
101
Ptr<NetDevice>
input,
102
NetDeviceContainer
output);
103
104
/**
105
* \brief Add a multicast route to a node and device using a name string
106
* previously associated to the node using the Object Name Service and a
107
* Ptr<NetDevice>
108
*
109
* \param n The node.
110
* \param source Source address.
111
* \param group Multicast group.
112
* \param input Input NetDevice.
113
* \param output Output NetDevices.
114
*/
115
void
AddMulticastRoute
(std::string n,
116
Ipv4Address
source,
117
Ipv4Address
group,
118
Ptr<NetDevice>
input,
119
NetDeviceContainer
output);
120
121
/**
122
* \brief Add a multicast route to a node and device using a Ptr<Node> and a
123
* name string previously associated to the device using the Object Name Service.
124
*
125
* \param n The node.
126
* \param source Source address.
127
* \param group Multicast group.
128
* \param inputName Input NetDevice.
129
* \param output Output NetDevices.
130
*/
131
void
AddMulticastRoute
(
Ptr<Node>
n,
132
Ipv4Address
source,
133
Ipv4Address
group,
134
std::string inputName,
135
NetDeviceContainer
output);
136
137
/**
138
* \brief Add a multicast route to a node and device using name strings
139
* previously associated to both the node and device using the Object Name
140
* Service.
141
*
142
* \param nName The node.
143
* \param source Source address.
144
* \param group Multicast group.
145
* \param inputName Input NetDevice.
146
* \param output Output NetDevices.
147
*/
148
void
AddMulticastRoute
(std::string nName,
149
Ipv4Address
source,
150
Ipv4Address
group,
151
std::string inputName,
152
NetDeviceContainer
output);
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 nd device of the node to add default route
162
*/
163
void
SetDefaultMulticastRoute
(
Ptr<Node>
n,
Ptr<NetDevice>
nd);
164
165
/**
166
* \brief Add a default route to the static routing protocol to forward
167
* packets out a particular interface
168
*
169
* Functionally equivalent to:
170
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
171
* \param n node
172
* \param ndName string with name previously associated to device using the
173
* Object Name Service
174
*/
175
void
SetDefaultMulticastRoute
(
Ptr<Node>
n, std::string ndName);
176
177
/**
178
* \brief Add a default route to the static routing protocol to forward
179
* packets out a particular interface
180
*
181
* Functionally equivalent to:
182
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
183
* \param nName string with name previously associated to node using the
184
* Object Name Service
185
* \param nd device of the node to add default route
186
*/
187
void
SetDefaultMulticastRoute
(std::string nName,
Ptr<NetDevice>
nd);
188
189
/**
190
* \brief Add a default route to the static routing protocol to forward
191
* packets out a particular interface
192
*
193
* Functionally equivalent to:
194
* route add 224.0.0.0 netmask 240.0.0.0 dev nd
195
* \param nName string with name previously associated to node using the
196
* Object Name Service
197
* \param ndName string with name previously associated to device using the
198
* Object Name Service
199
*/
200
void
SetDefaultMulticastRoute
(std::string nName, std::string ndName);
201
};
202
203
}
// namespace ns3
204
205
#endif
/* IPV4_STATIC_ROUTING_HELPER_H */
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::Ipv4RoutingHelper
a factory to create ns3::Ipv4RoutingProtocol objects
Definition:
ipv4-routing-helper.h:46
ns3::Ipv4StaticRoutingHelper
Helper class that adds ns3::Ipv4StaticRouting objects.
Definition:
ipv4-static-routing-helper.h:44
ns3::Ipv4StaticRoutingHelper::Copy
Ipv4StaticRoutingHelper * Copy() const override
Definition:
ipv4-static-routing-helper.cc:47
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:59
ns3::Ipv4StaticRoutingHelper::operator=
Ipv4StaticRoutingHelper & operator=(const Ipv4StaticRoutingHelper &)=delete
ns3::Ipv4StaticRoutingHelper::Ipv4StaticRoutingHelper
Ipv4StaticRoutingHelper()
Definition:
ipv4-static-routing-helper.cc:38
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:89
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:160
ns3::Ipv4StaticRoutingHelper::Create
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Definition:
ipv4-static-routing-helper.cc:53
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:43
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
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 Tue May 28 2024 23:35:37 for ns-3 by
1.9.6