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
radvd-prefix.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 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
#ifndef RADVD_PREFIX_H
21
#define RADVD_PREFIX_H
22
23
#include "ns3/ipv6-address.h"
24
#include "ns3/simple-ref-count.h"
25
26
#include <stdint.h>
27
28
namespace
ns3
29
{
30
31
/**
32
* \ingroup radvd
33
* \brief Router prefix for radvd application.
34
*/
35
class
RadvdPrefix
:
public
SimpleRefCount
<RadvdPrefix>
36
{
37
public
:
38
/**
39
* \brief Constructor.
40
* \param network network prefix advertised
41
* \param prefixLength prefix length ( 0 < x <= 128)
42
* \param preferredLifeTime preferred life time in seconds (default 7 days)
43
* \param validLifeTime valid life time in seconds (default 30 days)
44
* \param onLinkFlag on link flag
45
* \param autonomousFlag autonomous link flag
46
* \param routerAddrFlag router address flag (for Mobile IPv6)
47
*/
48
RadvdPrefix
(
Ipv6Address
network,
49
uint8_t prefixLength,
50
uint32_t
preferredLifeTime = 604800,
51
uint32_t
validLifeTime = 2592000,
52
bool
onLinkFlag =
true
,
53
bool
autonomousFlag =
true
,
54
bool
routerAddrFlag =
false
);
55
56
/**
57
* \brief Destructor.
58
*/
59
~RadvdPrefix
();
60
61
/**
62
* \brief Get network prefix.
63
* \return network prefix
64
*/
65
Ipv6Address
GetNetwork
()
const
;
66
67
/**
68
* \brief Set network prefix.
69
* \param network network prefix
70
*/
71
void
SetNetwork
(
Ipv6Address
network);
72
73
/**
74
* \brief Get prefix length.
75
* \return prefix length
76
*/
77
uint8_t
GetPrefixLength
()
const
;
78
79
/**
80
* \brief Set prefix length.
81
* \param prefixLength prefix length
82
*/
83
void
SetPrefixLength
(uint8_t prefixLength);
84
85
/**
86
* \brief Get preferred lifetime.
87
* \return lifetime
88
*/
89
uint32_t
GetPreferredLifeTime
()
const
;
90
91
/**
92
* \brief Set preferred lifetime.
93
* \param preferredLifeTime lifetime
94
*/
95
void
SetPreferredLifeTime
(
uint32_t
preferredLifeTime);
96
97
/**
98
* \brief Get valid lifetime.
99
* \return lifetime
100
*/
101
uint32_t
GetValidLifeTime
()
const
;
102
103
/**
104
* \brief Set valid lifetime.
105
* \param validLifeTime lifetime
106
*/
107
void
SetValidLifeTime
(
uint32_t
validLifeTime);
108
109
/**
110
* \brief Is on-link flag ?
111
* \return true if on-link is activated, false otherwise
112
*/
113
bool
IsOnLinkFlag
()
const
;
114
115
/**
116
* \brief Set on-link flag.
117
* \param onLinkFlag value
118
*/
119
void
SetOnLinkFlag
(
bool
onLinkFlag);
120
121
/**
122
* \brief Is autonomous flag ?
123
* \return true if autonomous is activated, false otherwise
124
*/
125
bool
IsAutonomousFlag
()
const
;
126
127
/**
128
* \brief Set autonomous flag.
129
* \param autonomousFlag value
130
*/
131
void
SetAutonomousFlag
(
bool
autonomousFlag);
132
133
/**
134
* \brief Is router address flag ?
135
* \return true if router address is activated, false otherwise
136
*/
137
bool
IsRouterAddrFlag
()
const
;
138
139
/**
140
* \brief Set router address flag.
141
* \param routerAddrFlag value
142
*/
143
void
SetRouterAddrFlag
(
bool
routerAddrFlag);
144
145
private
:
146
/**
147
* \brief Network prefix.
148
*/
149
Ipv6Address
m_network
;
150
151
/**
152
* \brief Prefix length.
153
*/
154
uint8_t
m_prefixLength
;
155
156
/**
157
* \brief Preferred time.
158
*/
159
uint32_t
m_preferredLifeTime
;
160
161
/**
162
* \brief Valid time.
163
*/
164
uint32_t
m_validLifeTime
;
165
166
/**
167
* \brief On link flag, indicates that this prefix can be used for on-link determination.
168
*/
169
bool
m_onLinkFlag
;
170
171
/**
172
* \brief Autonomous flag, it is used for autonomous address configuration (\RFC{2462}).
173
*/
174
bool
m_autonomousFlag
;
175
176
/**
177
* \brief Router address flag, indicates that router address is sent instead
178
* of network prefix as is required by Mobile IPv6.
179
*/
180
bool
m_routerAddrFlag
;
181
};
182
183
}
/* namespace ns3 */
184
185
#endif
/* RADVD_PREFIX_H */
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:49
ns3::RadvdPrefix
Router prefix for radvd application.
Definition:
radvd-prefix.h:36
ns3::RadvdPrefix::SetAutonomousFlag
void SetAutonomousFlag(bool autonomousFlag)
Set autonomous flag.
Definition:
radvd-prefix.cc:131
ns3::RadvdPrefix::m_routerAddrFlag
bool m_routerAddrFlag
Router address flag, indicates that router address is sent instead of network prefix as is required b...
Definition:
radvd-prefix.h:180
ns3::RadvdPrefix::SetOnLinkFlag
void SetOnLinkFlag(bool onLinkFlag)
Set on-link flag.
Definition:
radvd-prefix.cc:117
ns3::RadvdPrefix::SetNetwork
void SetNetwork(Ipv6Address network)
Set network prefix.
Definition:
radvd-prefix.cc:61
ns3::RadvdPrefix::m_preferredLifeTime
uint32_t m_preferredLifeTime
Preferred time.
Definition:
radvd-prefix.h:159
ns3::RadvdPrefix::SetPreferredLifeTime
void SetPreferredLifeTime(uint32_t preferredLifeTime)
Set preferred lifetime.
Definition:
radvd-prefix.cc:103
ns3::RadvdPrefix::GetPreferredLifeTime
uint32_t GetPreferredLifeTime() const
Get preferred lifetime.
Definition:
radvd-prefix.cc:96
ns3::RadvdPrefix::SetValidLifeTime
void SetValidLifeTime(uint32_t validLifeTime)
Set valid lifetime.
Definition:
radvd-prefix.cc:89
ns3::RadvdPrefix::GetValidLifeTime
uint32_t GetValidLifeTime() const
Get valid lifetime.
Definition:
radvd-prefix.cc:82
ns3::RadvdPrefix::GetPrefixLength
uint8_t GetPrefixLength() const
Get prefix length.
Definition:
radvd-prefix.cc:68
ns3::RadvdPrefix::m_prefixLength
uint8_t m_prefixLength
Prefix length.
Definition:
radvd-prefix.h:154
ns3::RadvdPrefix::m_onLinkFlag
bool m_onLinkFlag
On link flag, indicates that this prefix can be used for on-link determination.
Definition:
radvd-prefix.h:169
ns3::RadvdPrefix::SetRouterAddrFlag
void SetRouterAddrFlag(bool routerAddrFlag)
Set router address flag.
Definition:
radvd-prefix.cc:145
ns3::RadvdPrefix::m_autonomousFlag
bool m_autonomousFlag
Autonomous flag, it is used for autonomous address configuration (RFC 2462).
Definition:
radvd-prefix.h:174
ns3::RadvdPrefix::GetNetwork
Ipv6Address GetNetwork() const
Get network prefix.
Definition:
radvd-prefix.cc:54
ns3::RadvdPrefix::m_network
Ipv6Address m_network
Network prefix.
Definition:
radvd-prefix.h:149
ns3::RadvdPrefix::IsRouterAddrFlag
bool IsRouterAddrFlag() const
Is router address flag ?
Definition:
radvd-prefix.cc:138
ns3::RadvdPrefix::~RadvdPrefix
~RadvdPrefix()
Destructor.
Definition:
radvd-prefix.cc:48
ns3::RadvdPrefix::m_validLifeTime
uint32_t m_validLifeTime
Valid time.
Definition:
radvd-prefix.h:164
ns3::RadvdPrefix::IsAutonomousFlag
bool IsAutonomousFlag() const
Is autonomous flag ?
Definition:
radvd-prefix.cc:124
ns3::RadvdPrefix::IsOnLinkFlag
bool IsOnLinkFlag() const
Is on-link flag ?
Definition:
radvd-prefix.cc:110
ns3::RadvdPrefix::SetPrefixLength
void SetPrefixLength(uint8_t prefixLength)
Set prefix length.
Definition:
radvd-prefix.cc:75
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:81
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet-apps
model
radvd-prefix.h
Generated on Tue May 28 2024 23:35:32 for ns-3 by
1.9.6