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