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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7
*/
8
9
#include "
ipv6-route.h
"
10
11
#include "ns3/net-device.h"
12
13
#include <iostream>
14
15
namespace
ns3
16
{
17
18
Ipv6Route::Ipv6Route
()
19
{
20
}
21
22
Ipv6Route::~Ipv6Route
()
23
{
24
}
25
26
void
27
Ipv6Route::SetDestination
(
Ipv6Address
dest)
28
{
29
m_dest
= dest;
30
}
31
32
Ipv6Address
33
Ipv6Route::GetDestination
()
const
34
{
35
return
m_dest
;
36
}
37
38
void
39
Ipv6Route::SetSource
(
Ipv6Address
src)
40
{
41
m_source
= src;
42
}
43
44
Ipv6Address
45
Ipv6Route::GetSource
()
const
46
{
47
return
m_source
;
48
}
49
50
void
51
Ipv6Route::SetGateway
(
Ipv6Address
gw)
52
{
53
m_gateway
= gw;
54
}
55
56
Ipv6Address
57
Ipv6Route::GetGateway
()
const
58
{
59
return
m_gateway
;
60
}
61
62
void
63
Ipv6Route::SetOutputDevice
(
Ptr<NetDevice>
outputDevice)
64
{
65
m_outputDevice
= outputDevice;
66
}
67
68
Ptr<NetDevice>
69
Ipv6Route::GetOutputDevice
()
const
70
{
71
return
m_outputDevice
;
72
}
73
74
std::ostream&
75
operator<<
(std::ostream& os,
const
Ipv6Route
& route)
76
{
77
os <<
"source="
<< route.
GetSource
() <<
" dest="
<< route.
GetDestination
()
78
<<
" gw="
<< route.
GetGateway
();
79
return
os;
80
}
81
82
Ipv6MulticastRoute::Ipv6MulticastRoute
()
83
{
84
m_ttls
.clear();
85
}
86
87
Ipv6MulticastRoute::~Ipv6MulticastRoute
()
88
{
89
}
90
91
void
92
Ipv6MulticastRoute::SetGroup
(
const
Ipv6Address
group)
93
{
94
m_group
= group;
95
}
96
97
Ipv6Address
98
Ipv6MulticastRoute::GetGroup
()
const
99
{
100
return
m_group
;
101
}
102
103
void
104
Ipv6MulticastRoute::SetOrigin
(
const
Ipv6Address
origin)
105
{
106
m_origin
= origin;
107
}
108
109
Ipv6Address
110
Ipv6MulticastRoute::GetOrigin
()
const
111
{
112
return
m_origin
;
113
}
114
115
void
116
Ipv6MulticastRoute::SetParent
(
uint32_t
parent)
117
{
118
m_parent
= parent;
119
}
120
121
uint32_t
122
Ipv6MulticastRoute::GetParent
()
const
123
{
124
return
m_parent
;
125
}
126
127
void
128
Ipv6MulticastRoute::SetOutputTtl
(
uint32_t
oif,
uint32_t
ttl)
129
{
130
if
(ttl >=
MAX_TTL
)
131
{
132
// This TTL value effectively disables the interface
133
auto
iter =
m_ttls
.find(oif);
134
if
(iter !=
m_ttls
.end())
135
{
136
m_ttls
.erase(iter);
137
}
138
}
139
else
140
{
141
m_ttls
[oif] = ttl;
142
}
143
}
144
145
std::map<uint32_t, uint32_t>
146
Ipv6MulticastRoute::GetOutputTtlMap
()
const
147
{
148
return
m_ttls
;
149
}
150
151
std::ostream&
152
operator<<
(std::ostream& os,
const
Ipv6MulticastRoute
& route)
153
{
154
os <<
"origin="
<< route.
GetOrigin
() <<
" group="
<< route.
GetGroup
()
155
<<
" parent="
<< route.
GetParent
();
156
return
os;
157
}
158
159
}
/* namespace ns3 */
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::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
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:148
src
internet
model
ipv6-route.cc
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0