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
ipv6-route.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007-2009 Strasbourg University
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7
*/
8
9
#ifndef IPV6_ROUTE_H
10
#define IPV6_ROUTE_H
11
12
#include "ns3/ipv6-address.h"
13
#include "ns3/simple-ref-count.h"
14
15
#include <list>
16
#include <map>
17
#include <ostream>
18
19
namespace
ns3
20
{
21
22
class
NetDevice;
23
24
/**
25
* \ingroup ipv6Routing
26
*
27
* \brief IPv6 route cache entry.
28
*/
29
class
Ipv6Route
:
public
SimpleRefCount
<Ipv6Route>
30
{
31
public
:
32
/**
33
* \brief Constructor.
34
*/
35
Ipv6Route
();
36
37
/**
38
* \brief Destructor.
39
*/
40
virtual
~Ipv6Route
();
41
42
/**
43
* \brief Set destination address.
44
* \param dest IPv6 destination address
45
*/
46
void
SetDestination
(
Ipv6Address
dest);
47
48
/**
49
* \brief Get destination address.
50
* \return destination address
51
*/
52
Ipv6Address
GetDestination
()
const
;
53
54
/**
55
* \brief Set source address.
56
* \param src IPv6 source address
57
*/
58
void
SetSource
(
Ipv6Address
src);
59
60
/**
61
* \brief Get source address.
62
* \return source address
63
*/
64
Ipv6Address
GetSource
()
const
;
65
66
/**
67
* \brief Set gateway address.
68
* \param gw IPv6 gateway address
69
*/
70
void
SetGateway
(
Ipv6Address
gw);
71
72
/**
73
* \brief Get gateway address.
74
* \return gateway address
75
*/
76
Ipv6Address
GetGateway
()
const
;
77
78
/**
79
* \brief Set output device for outgoing packets.
80
* \param outputDevice output device
81
*/
82
void
SetOutputDevice
(
Ptr<NetDevice>
outputDevice);
83
84
/**
85
* \brief Get output device.
86
* \return output device
87
*/
88
Ptr<NetDevice>
GetOutputDevice
()
const
;
89
90
private
:
91
/**
92
* \brief Destination address.
93
*/
94
Ipv6Address
m_dest
;
95
96
/**
97
* \brief source address.
98
*/
99
Ipv6Address
m_source
;
100
101
/**
102
* \brief Gateway address.
103
*/
104
Ipv6Address
m_gateway
;
105
106
/**
107
* \brief Output device.
108
*/
109
Ptr<NetDevice>
m_outputDevice
;
110
};
111
112
/**
113
* \brief Stream insertion operator.
114
*
115
* \param os the reference to the output stream
116
* \param route the Ipv6 route
117
* \returns the reference to the output stream
118
*/
119
std::ostream&
operator<<
(std::ostream& os,
const
Ipv6Route
& route);
120
121
/**
122
* \ingroup ipv6Routing
123
*
124
* \brief IPv6 multicast route entry.
125
*/
126
class
Ipv6MulticastRoute
:
public
SimpleRefCount
<Ipv6MulticastRoute>
127
{
128
public
:
129
/**
130
* \brief Maximum number of multicast interfaces on a router.
131
*/
132
static
const
uint32_t
MAX_INTERFACES
= 16;
133
134
/**
135
* \brief Maximum Time-To-Live (TTL).
136
*/
137
static
const
uint32_t
MAX_TTL
= 255;
138
139
/**
140
* \brief Constructor.
141
*/
142
Ipv6MulticastRoute
();
143
144
/**
145
* \brief Destructor.
146
*/
147
virtual
~Ipv6MulticastRoute
();
148
149
/**
150
* \brief Set IPv6 group.
151
* \param group Ipv6Address of the multicast group
152
*/
153
void
SetGroup
(
const
Ipv6Address
group);
154
155
/**
156
* \brief Get IPv6 group.
157
* \return Ipv6Address of the multicast group
158
*/
159
Ipv6Address
GetGroup
()
const
;
160
161
/**
162
* \brief Set origin address.
163
* \param origin Ipv6Address of the origin address
164
*/
165
void
SetOrigin
(
const
Ipv6Address
origin);
166
167
/**
168
* \brief Get source address.
169
* \return Ipv6Address of the origin address
170
*/
171
Ipv6Address
GetOrigin
()
const
;
172
173
/**
174
* \brief Set parent for this route.
175
* \param iif Parent (input interface) for this route
176
*/
177
void
SetParent
(
uint32_t
iif);
178
179
/**
180
* \brief Get parent for this route.
181
* \return Parent (input interface) for this route
182
*/
183
uint32_t
GetParent
()
const
;
184
185
/**
186
* \brief set output TTL for this route.
187
* \param oif Outgoing interface index
188
* \param ttl time-to-live for this route
189
*/
190
void
SetOutputTtl
(
uint32_t
oif,
uint32_t
ttl);
191
192
/**
193
* \return map of output interface Ids and TTLs for this route
194
*/
195
std::map<uint32_t, uint32_t>
GetOutputTtlMap
()
const
;
196
197
private
:
198
/**
199
* \brief IPv6 group.
200
*/
201
Ipv6Address
m_group
;
202
203
/**
204
* \brief IPv6 origin (source).
205
*/
206
Ipv6Address
m_origin
;
207
208
/**
209
* \brief Source interface.
210
*/
211
uint32_t
m_parent
;
212
213
/**
214
* \brief TTLs.
215
*/
216
std::map<uint32_t, uint32_t>
m_ttls
;
217
};
218
219
/**
220
* \brief Stream insertion operator.
221
*
222
* \param os the reference to the output stream
223
* \param route the Ipv6 multicast route
224
* \returns the reference to the output stream
225
*/
226
std::ostream&
operator<<
(std::ostream& os,
const
Ipv6MulticastRoute
& route);
227
228
}
/* namespace ns3 */
229
230
#endif
/* IPV6_ROUTE_H */
ns3::Ipv6Address
Describes an IPv6 address.
Definition
ipv6-address.h:38
ns3::Ipv6MulticastRoute
IPv6 multicast route entry.
Definition
ipv6-route.h:127
ns3::Ipv6MulticastRoute::SetOrigin
void SetOrigin(const Ipv6Address origin)
Set origin address.
Definition
ipv6-route.cc:104
ns3::Ipv6MulticastRoute::GetOutputTtlMap
std::map< uint32_t, uint32_t > GetOutputTtlMap() const
Definition
ipv6-route.cc:146
ns3::Ipv6MulticastRoute::m_origin
Ipv6Address m_origin
IPv6 origin (source).
Definition
ipv6-route.h:206
ns3::Ipv6MulticastRoute::GetOrigin
Ipv6Address GetOrigin() const
Get source address.
Definition
ipv6-route.cc:110
ns3::Ipv6MulticastRoute::MAX_TTL
static const uint32_t MAX_TTL
Maximum Time-To-Live (TTL).
Definition
ipv6-route.h:137
ns3::Ipv6MulticastRoute::Ipv6MulticastRoute
Ipv6MulticastRoute()
Constructor.
Definition
ipv6-route.cc:82
ns3::Ipv6MulticastRoute::MAX_INTERFACES
static const uint32_t MAX_INTERFACES
Maximum number of multicast interfaces on a router.
Definition
ipv6-route.h:132
ns3::Ipv6MulticastRoute::m_group
Ipv6Address m_group
IPv6 group.
Definition
ipv6-route.h:201
ns3::Ipv6MulticastRoute::GetParent
uint32_t GetParent() const
Get parent for this route.
Definition
ipv6-route.cc:122
ns3::Ipv6MulticastRoute::SetParent
void SetParent(uint32_t iif)
Set parent for this route.
Definition
ipv6-route.cc:116
ns3::Ipv6MulticastRoute::m_parent
uint32_t m_parent
Source interface.
Definition
ipv6-route.h:211
ns3::Ipv6MulticastRoute::m_ttls
std::map< uint32_t, uint32_t > m_ttls
TTLs.
Definition
ipv6-route.h:216
ns3::Ipv6MulticastRoute::SetGroup
void SetGroup(const Ipv6Address group)
Set IPv6 group.
Definition
ipv6-route.cc:92
ns3::Ipv6MulticastRoute::GetGroup
Ipv6Address GetGroup() const
Get IPv6 group.
Definition
ipv6-route.cc:98
ns3::Ipv6MulticastRoute::SetOutputTtl
void SetOutputTtl(uint32_t oif, uint32_t ttl)
set output TTL for this route.
Definition
ipv6-route.cc:128
ns3::Ipv6MulticastRoute::~Ipv6MulticastRoute
virtual ~Ipv6MulticastRoute()
Destructor.
Definition
ipv6-route.cc:87
ns3::Ipv6Route
IPv6 route cache entry.
Definition
ipv6-route.h:30
ns3::Ipv6Route::SetGateway
void SetGateway(Ipv6Address gw)
Set gateway address.
Definition
ipv6-route.cc:51
ns3::Ipv6Route::SetSource
void SetSource(Ipv6Address src)
Set source address.
Definition
ipv6-route.cc:39
ns3::Ipv6Route::~Ipv6Route
virtual ~Ipv6Route()
Destructor.
Definition
ipv6-route.cc:22
ns3::Ipv6Route::GetDestination
Ipv6Address GetDestination() const
Get destination address.
Definition
ipv6-route.cc:33
ns3::Ipv6Route::SetDestination
void SetDestination(Ipv6Address dest)
Set destination address.
Definition
ipv6-route.cc:27
ns3::Ipv6Route::m_outputDevice
Ptr< NetDevice > m_outputDevice
Output device.
Definition
ipv6-route.h:109
ns3::Ipv6Route::GetSource
Ipv6Address GetSource() const
Get source address.
Definition
ipv6-route.cc:45
ns3::Ipv6Route::m_source
Ipv6Address m_source
source address.
Definition
ipv6-route.h:99
ns3::Ipv6Route::m_dest
Ipv6Address m_dest
Destination address.
Definition
ipv6-route.h:94
ns3::Ipv6Route::GetOutputDevice
Ptr< NetDevice > GetOutputDevice() const
Get output device.
Definition
ipv6-route.cc:69
ns3::Ipv6Route::m_gateway
Ipv6Address m_gateway
Gateway address.
Definition
ipv6-route.h:104
ns3::Ipv6Route::GetGateway
Ipv6Address GetGateway() const
Get gateway address.
Definition
ipv6-route.cc:57
ns3::Ipv6Route::Ipv6Route
Ipv6Route()
Constructor.
Definition
ipv6-route.cc:18
ns3::Ipv6Route::SetOutputDevice
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Set output device for outgoing packets.
Definition
ipv6-route.cc:63
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SimpleRefCount
A template-based reference counting class.
Definition
simple-ref-count.h:70
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition
angles.cc:148
src
internet
model
ipv6-route.h
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0