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.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007-2009 Strasbourg University
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
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18
*/
19
20
#include "
ipv6-route.h
"
21
22
#include "ns3/net-device.h"
23
24
#include <iostream>
25
26
namespace
ns3
27
{
28
29
Ipv6Route::Ipv6Route
()
30
{
31
}
32
33
Ipv6Route::~Ipv6Route
()
34
{
35
}
36
37
void
38
Ipv6Route::SetDestination
(
Ipv6Address
dest)
39
{
40
m_dest
= dest;
41
}
42
43
Ipv6Address
44
Ipv6Route::GetDestination
()
const
45
{
46
return
m_dest
;
47
}
48
49
void
50
Ipv6Route::SetSource
(
Ipv6Address
src)
51
{
52
m_source
= src;
53
}
54
55
Ipv6Address
56
Ipv6Route::GetSource
()
const
57
{
58
return
m_source
;
59
}
60
61
void
62
Ipv6Route::SetGateway
(
Ipv6Address
gw)
63
{
64
m_gateway
= gw;
65
}
66
67
Ipv6Address
68
Ipv6Route::GetGateway
()
const
69
{
70
return
m_gateway
;
71
}
72
73
void
74
Ipv6Route::SetOutputDevice
(
Ptr<NetDevice>
outputDevice)
75
{
76
m_outputDevice
= outputDevice;
77
}
78
79
Ptr<NetDevice>
80
Ipv6Route::GetOutputDevice
()
const
81
{
82
return
m_outputDevice
;
83
}
84
85
std::ostream&
86
operator<<
(std::ostream& os,
const
Ipv6Route
& route)
87
{
88
os <<
"source="
<< route.
GetSource
() <<
" dest="
<< route.
GetDestination
()
89
<<
" gw="
<< route.
GetGateway
();
90
return
os;
91
}
92
93
Ipv6MulticastRoute::Ipv6MulticastRoute
()
94
{
95
m_ttls
.clear();
96
}
97
98
Ipv6MulticastRoute::~Ipv6MulticastRoute
()
99
{
100
}
101
102
void
103
Ipv6MulticastRoute::SetGroup
(
const
Ipv6Address
group)
104
{
105
m_group
= group;
106
}
107
108
Ipv6Address
109
Ipv6MulticastRoute::GetGroup
()
const
110
{
111
return
m_group
;
112
}
113
114
void
115
Ipv6MulticastRoute::SetOrigin
(
const
Ipv6Address
origin)
116
{
117
m_origin
= origin;
118
}
119
120
Ipv6Address
121
Ipv6MulticastRoute::GetOrigin
()
const
122
{
123
return
m_origin
;
124
}
125
126
void
127
Ipv6MulticastRoute::SetParent
(
uint32_t
parent)
128
{
129
m_parent
= parent;
130
}
131
132
uint32_t
133
Ipv6MulticastRoute::GetParent
()
const
134
{
135
return
m_parent
;
136
}
137
138
void
139
Ipv6MulticastRoute::SetOutputTtl
(
uint32_t
oif,
uint32_t
ttl)
140
{
141
if
(ttl >=
MAX_TTL
)
142
{
143
// This TTL value effectively disables the interface
144
std::map<uint32_t, uint32_t>::iterator iter;
145
iter =
m_ttls
.find(oif);
146
if
(iter !=
m_ttls
.end())
147
{
148
m_ttls
.erase(iter);
149
}
150
}
151
else
152
{
153
m_ttls
[oif] = ttl;
154
}
155
}
156
157
std::map<uint32_t, uint32_t>
158
Ipv6MulticastRoute::GetOutputTtlMap
()
const
159
{
160
return
(
m_ttls
);
161
}
162
163
std::ostream&
164
operator<<
(std::ostream& os,
const
Ipv6MulticastRoute
& route)
165
{
166
os <<
"origin="
<< route.
GetOrigin
() <<
" group="
<< route.
GetGroup
()
167
<<
" parent="
<< route.
GetParent
();
168
return
os;
169
}
170
171
}
/* namespace ns3 */
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
ns3::Ipv6MulticastRoute
IPv6 multicast route entry.
Definition:
ipv6-route.h:138
ns3::Ipv6MulticastRoute::SetOrigin
void SetOrigin(const Ipv6Address origin)
Set origin address.
Definition:
ipv6-route.cc:115
ns3::Ipv6MulticastRoute::GetOutputTtlMap
std::map< uint32_t, uint32_t > GetOutputTtlMap() const
Definition:
ipv6-route.cc:158
ns3::Ipv6MulticastRoute::m_origin
Ipv6Address m_origin
IPv6 origin (source).
Definition:
ipv6-route.h:217
ns3::Ipv6MulticastRoute::GetOrigin
Ipv6Address GetOrigin() const
Get source address.
Definition:
ipv6-route.cc:121
ns3::Ipv6MulticastRoute::MAX_TTL
static const uint32_t MAX_TTL
Maximum Time-To-Live (TTL).
Definition:
ipv6-route.h:148
ns3::Ipv6MulticastRoute::Ipv6MulticastRoute
Ipv6MulticastRoute()
Constructor.
Definition:
ipv6-route.cc:93
ns3::Ipv6MulticastRoute::m_group
Ipv6Address m_group
IPv6 group.
Definition:
ipv6-route.h:212
ns3::Ipv6MulticastRoute::GetParent
uint32_t GetParent() const
Get parent for this route.
Definition:
ipv6-route.cc:133
ns3::Ipv6MulticastRoute::SetParent
void SetParent(uint32_t iif)
Set parent for this route.
Definition:
ipv6-route.cc:127
ns3::Ipv6MulticastRoute::m_parent
uint32_t m_parent
Source interface.
Definition:
ipv6-route.h:222
ns3::Ipv6MulticastRoute::m_ttls
std::map< uint32_t, uint32_t > m_ttls
TTLs.
Definition:
ipv6-route.h:227
ns3::Ipv6MulticastRoute::SetGroup
void SetGroup(const Ipv6Address group)
Set IPv6 group.
Definition:
ipv6-route.cc:103
ns3::Ipv6MulticastRoute::GetGroup
Ipv6Address GetGroup() const
Get IPv6 group.
Definition:
ipv6-route.cc:109
ns3::Ipv6MulticastRoute::SetOutputTtl
void SetOutputTtl(uint32_t oif, uint32_t ttl)
set output TTL for this route.
Definition:
ipv6-route.cc:139
ns3::Ipv6MulticastRoute::~Ipv6MulticastRoute
virtual ~Ipv6MulticastRoute()
Destructor.
Definition:
ipv6-route.cc:98
ns3::Ipv6Route
IPv6 route cache entry.
Definition:
ipv6-route.h:41
ns3::Ipv6Route::SetGateway
void SetGateway(Ipv6Address gw)
Set gateway address.
Definition:
ipv6-route.cc:62
ns3::Ipv6Route::SetSource
void SetSource(Ipv6Address src)
Set source address.
Definition:
ipv6-route.cc:50
ns3::Ipv6Route::~Ipv6Route
virtual ~Ipv6Route()
Destructor.
Definition:
ipv6-route.cc:33
ns3::Ipv6Route::GetDestination
Ipv6Address GetDestination() const
Get destination address.
Definition:
ipv6-route.cc:44
ns3::Ipv6Route::SetDestination
void SetDestination(Ipv6Address dest)
Set destination address.
Definition:
ipv6-route.cc:38
ns3::Ipv6Route::m_outputDevice
Ptr< NetDevice > m_outputDevice
Output device.
Definition:
ipv6-route.h:120
ns3::Ipv6Route::GetSource
Ipv6Address GetSource() const
Get source address.
Definition:
ipv6-route.cc:56
ns3::Ipv6Route::m_source
Ipv6Address m_source
source address.
Definition:
ipv6-route.h:110
ns3::Ipv6Route::m_dest
Ipv6Address m_dest
Destination address.
Definition:
ipv6-route.h:105
ns3::Ipv6Route::GetOutputDevice
Ptr< NetDevice > GetOutputDevice() const
Get output device.
Definition:
ipv6-route.cc:80
ns3::Ipv6Route::m_gateway
Ipv6Address m_gateway
Gateway address.
Definition:
ipv6-route.h:115
ns3::Ipv6Route::GetGateway
Ipv6Address GetGateway() const
Get gateway address.
Definition:
ipv6-route.cc:68
ns3::Ipv6Route::Ipv6Route
Ipv6Route()
Constructor.
Definition:
ipv6-route.cc:29
ns3::Ipv6Route::SetOutputDevice
void SetOutputDevice(Ptr< NetDevice > outputDevice)
Set output device for outgoing packets.
Definition:
ipv6-route.cc:74
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
uint32_t
ipv6-route.h
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:129
src
internet
model
ipv6-route.cc
Generated on Sun Jul 2 2023 18:21:40 for ns-3 by
1.9.6