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.cc
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
#include "
radvd-prefix.h
"
10
11
#include <ns3/log.h>
12
13
namespace
ns3
14
{
15
16
NS_LOG_COMPONENT_DEFINE
(
"RadvdPrefix"
);
17
18
RadvdPrefix::RadvdPrefix
(
Ipv6Address
network,
19
uint8_t prefixLength,
20
uint32_t
preferredLifeTime,
21
uint32_t
validLifeTime,
22
bool
onLinkFlag,
23
bool
autonomousFlag,
24
bool
routerAddrFlag)
25
: m_network(network),
26
m_prefixLength(prefixLength),
27
m_preferredLifeTime(preferredLifeTime),
28
m_validLifeTime(validLifeTime),
29
m_onLinkFlag(onLinkFlag),
30
m_autonomousFlag(autonomousFlag),
31
m_routerAddrFlag(routerAddrFlag)
32
{
33
NS_LOG_FUNCTION
(
this
<< network << prefixLength << preferredLifeTime << validLifeTime
34
<< onLinkFlag << autonomousFlag << routerAddrFlag);
35
}
36
37
RadvdPrefix::~RadvdPrefix
()
38
{
39
NS_LOG_FUNCTION
(
this
);
40
}
41
42
Ipv6Address
43
RadvdPrefix::GetNetwork
()
const
44
{
45
NS_LOG_FUNCTION
(
this
);
46
return
m_network
;
47
}
48
49
void
50
RadvdPrefix::SetNetwork
(
Ipv6Address
network)
51
{
52
NS_LOG_FUNCTION
(
this
<< network);
53
m_network
= network;
54
}
55
56
uint8_t
57
RadvdPrefix::GetPrefixLength
()
const
58
{
59
NS_LOG_FUNCTION
(
this
);
60
return
m_prefixLength
;
61
}
62
63
void
64
RadvdPrefix::SetPrefixLength
(uint8_t prefixLength)
65
{
66
NS_LOG_FUNCTION
(
this
<< prefixLength);
67
m_prefixLength
= prefixLength;
68
}
69
70
uint32_t
71
RadvdPrefix::GetValidLifeTime
()
const
72
{
73
NS_LOG_FUNCTION
(
this
);
74
return
m_validLifeTime
;
75
}
76
77
void
78
RadvdPrefix::SetValidLifeTime
(
uint32_t
validLifeTime)
79
{
80
NS_LOG_FUNCTION
(
this
<< validLifeTime);
81
m_validLifeTime
= validLifeTime;
82
}
83
84
uint32_t
85
RadvdPrefix::GetPreferredLifeTime
()
const
86
{
87
NS_LOG_FUNCTION
(
this
);
88
return
m_preferredLifeTime
;
89
}
90
91
void
92
RadvdPrefix::SetPreferredLifeTime
(
uint32_t
preferredLifeTime)
93
{
94
NS_LOG_FUNCTION
(
this
<< preferredLifeTime);
95
m_preferredLifeTime
= preferredLifeTime;
96
}
97
98
bool
99
RadvdPrefix::IsOnLinkFlag
()
const
100
{
101
NS_LOG_FUNCTION
(
this
);
102
return
m_onLinkFlag
;
103
}
104
105
void
106
RadvdPrefix::SetOnLinkFlag
(
bool
onLinkFlag)
107
{
108
NS_LOG_FUNCTION
(
this
<< onLinkFlag);
109
m_onLinkFlag
= onLinkFlag;
110
}
111
112
bool
113
RadvdPrefix::IsAutonomousFlag
()
const
114
{
115
NS_LOG_FUNCTION
(
this
);
116
return
m_autonomousFlag
;
117
}
118
119
void
120
RadvdPrefix::SetAutonomousFlag
(
bool
autonomousFlag)
121
{
122
NS_LOG_FUNCTION
(
this
<< autonomousFlag);
123
m_autonomousFlag
= autonomousFlag;
124
}
125
126
bool
127
RadvdPrefix::IsRouterAddrFlag
()
const
128
{
129
NS_LOG_FUNCTION
(
this
);
130
return
m_routerAddrFlag
;
131
}
132
133
void
134
RadvdPrefix::SetRouterAddrFlag
(
bool
routerAddrFlag)
135
{
136
NS_LOG_FUNCTION
(
this
<< routerAddrFlag);
137
m_routerAddrFlag
= routerAddrFlag;
138
}
139
140
}
/* namespace ns3 */
ns3::Ipv6Address
Describes an IPv6 address.
Definition
ipv6-address.h:38
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
uint32_t
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition
log-macros-enabled.h:229
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
radvd-prefix.h
src
internet-apps
model
radvd-prefix.cc
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0