A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
radvd-prefix.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 Strasbourg University
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19
*/
20
21
#include "
radvd-prefix.h
"
22
#include <ns3/log.h>
23
24
namespace
ns3
25
{
26
27
NS_LOG_COMPONENT_DEFINE
(
"RadvdPrefix"
);
28
29
RadvdPrefix::RadvdPrefix
(
Ipv6Address
network, uint8_t prefixLength, uint32_t preferredLifeTime, uint32_t validLifeTime,
bool
onLinkFlag,
bool
autonomousFlag,
bool
routerAddrFlag)
30
: m_network (network),
31
m_prefixLength (prefixLength),
32
m_preferredLifeTime (preferredLifeTime),
33
m_validLifeTime (validLifeTime),
34
m_onLinkFlag (onLinkFlag),
35
m_autonomousFlag (autonomousFlag),
36
m_routerAddrFlag (routerAddrFlag)
37
{
38
NS_LOG_FUNCTION
(
this
<< network << prefixLength << preferredLifeTime << validLifeTime << onLinkFlag << autonomousFlag << routerAddrFlag);
39
}
40
41
RadvdPrefix::~RadvdPrefix
()
42
{
43
NS_LOG_FUNCTION
(
this
);
44
}
45
46
Ipv6Address
RadvdPrefix::GetNetwork
()
const
47
{
48
NS_LOG_FUNCTION
(
this
);
49
return
m_network
;
50
}
51
52
void
RadvdPrefix::SetNetwork
(
Ipv6Address
network)
53
{
54
NS_LOG_FUNCTION
(
this
<< network);
55
m_network
= network;
56
}
57
58
uint8_t
RadvdPrefix::GetPrefixLength
()
const
59
{
60
NS_LOG_FUNCTION
(
this
);
61
return
m_prefixLength
;
62
}
63
64
void
RadvdPrefix::SetPrefixLength
(uint8_t prefixLength)
65
{
66
NS_LOG_FUNCTION
(
this
<< prefixLength);
67
m_prefixLength
= prefixLength;
68
}
69
70
uint32_t
RadvdPrefix::GetValidLifeTime
()
const
71
{
72
NS_LOG_FUNCTION
(
this
);
73
return
m_validLifeTime
;
74
}
75
76
void
RadvdPrefix::SetValidLifeTime
(uint32_t validLifeTime)
77
{
78
NS_LOG_FUNCTION
(
this
<< validLifeTime);
79
m_validLifeTime
= validLifeTime;
80
}
81
82
uint32_t
RadvdPrefix::GetPreferredLifeTime
()
const
83
{
84
NS_LOG_FUNCTION
(
this
);
85
return
m_preferredLifeTime
;
86
}
87
88
void
RadvdPrefix::SetPreferredLifeTime
(uint32_t preferredLifeTime)
89
{
90
NS_LOG_FUNCTION
(
this
<< preferredLifeTime);
91
m_preferredLifeTime
= preferredLifeTime;
92
}
93
94
bool
RadvdPrefix::IsOnLinkFlag
()
const
95
{
96
NS_LOG_FUNCTION
(
this
);
97
return
m_onLinkFlag
;
98
}
99
100
void
RadvdPrefix::SetOnLinkFlag
(
bool
onLinkFlag)
101
{
102
NS_LOG_FUNCTION
(
this
<< onLinkFlag);
103
m_onLinkFlag
= onLinkFlag;
104
}
105
106
bool
RadvdPrefix::IsAutonomousFlag
()
const
107
{
108
NS_LOG_FUNCTION
(
this
);
109
return
m_autonomousFlag
;
110
}
111
112
void
RadvdPrefix::SetAutonomousFlag
(
bool
autonomousFlag)
113
{
114
NS_LOG_FUNCTION
(
this
<< autonomousFlag);
115
m_autonomousFlag
= autonomousFlag;
116
}
117
118
bool
RadvdPrefix::IsRouterAddrFlag
()
const
119
{
120
NS_LOG_FUNCTION
(
this
);
121
return
m_routerAddrFlag
;
122
}
123
124
void
RadvdPrefix::SetRouterAddrFlag
(
bool
routerAddrFlag)
125
{
126
NS_LOG_FUNCTION
(
this
<< routerAddrFlag);
127
m_routerAddrFlag
= routerAddrFlag;
128
}
129
130
}
/* namespace ns3 */
131
src
applications
model
radvd-prefix.cc
Generated on Tue May 14 2013 11:08:16 for ns-3 by
1.8.1.2