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
ipv6-interface-address.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007-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
#ifndef IPV6_INTERFACE_ADDRESS_H
22
#define IPV6_INTERFACE_ADDRESS_H
23
24
#include <stdint.h>
25
26
#include "ns3/ipv6-address.h"
27
28
namespace
ns3
29
{
30
36
class
Ipv6InterfaceAddress
37
{
38
public
:
43
enum
State_e
44
{
45
TENTATIVE
,
46
DEPRECATED
,
47
PREFERRED
,
48
PERMANENT
,
49
HOMEADDRESS
,
50
TENTATIVE_OPTIMISTIC
,
51
INVALID
,
52
};
53
58
enum
Scope_e
59
{
60
HOST
,
61
LINKLOCAL
,
62
GLOBAL
,
63
};
64
68
Ipv6InterfaceAddress
();
69
74
Ipv6InterfaceAddress
(
Ipv6Address
address
);
75
81
Ipv6InterfaceAddress
(
Ipv6Address
address
,
Ipv6Prefix
prefix);
82
87
Ipv6InterfaceAddress
(
const
Ipv6InterfaceAddress
& o);
88
92
~Ipv6InterfaceAddress
();
93
98
void
SetAddress
(
Ipv6Address
address
);
99
104
Ipv6Address
GetAddress
()
const
;
105
110
Ipv6Prefix
GetPrefix
()
const
;
111
116
void
SetState
(
Ipv6InterfaceAddress::State_e
state);
117
122
Ipv6InterfaceAddress::State_e
GetState
()
const
;
123
128
void
SetScope
(
Ipv6InterfaceAddress::Scope_e
scope);
129
134
Ipv6InterfaceAddress::Scope_e
GetScope
()
const
;
135
140
void
SetNsDadUid
(uint32_t uid);
141
146
uint32_t
GetNsDadUid
()
const
;
147
148
#if 0
149
153
void
StartDadTimer (
Ptr<Ipv6Interface>
interface);
154
158
void
StopDadTimer ();
159
#endif
160
161
private
:
165
Ipv6Address
m_address
;
166
170
Ipv6Prefix
m_prefix
;
171
175
State_e
m_state
;
176
180
Scope_e
m_scope
;
181
189
friend
bool
operator ==
(
Ipv6InterfaceAddress
const
& a,
Ipv6InterfaceAddress
const
& b);
190
198
friend
bool
operator !=
(
Ipv6InterfaceAddress
const
& a,
Ipv6InterfaceAddress
const
& b);
199
203
uint32_t
m_nsDadUid
;
204
};
205
213
std::ostream&
operator<<
(std::ostream& os,
const
Ipv6InterfaceAddress
&addr);
214
215
/* follow Ipv4InterfaceAddress way, maybe not inline them */
216
inline
bool
operator ==
(
const
Ipv6InterfaceAddress
& a,
const
Ipv6InterfaceAddress
& b)
217
{
218
return
(a.
m_address
== b.
m_address
&& a.
m_prefix
== b.
m_prefix
&&
219
a.
m_state
== b.
m_state
&& a.
m_scope
== b.
m_scope
);
220
}
221
222
inline
bool
operator !=
(
const
Ipv6InterfaceAddress
& a,
const
Ipv6InterfaceAddress
& b)
223
{
224
return
(a.
m_address
!= b.
m_address
|| a.
m_prefix
!= b.
m_prefix
||
225
a.
m_state
!= b.
m_state
|| a.
m_scope
!= b.
m_scope
);
226
}
227
228
}
/* namespace ns3 */
229
230
#endif
/* IPV6_INTERFACE_ADDRESS_H */
231
ns3::Ipv6InterfaceAddress::m_state
State_e m_state
State of the address.
Definition:
ipv6-interface-address.h:175
ns3::Ipv6InterfaceAddress::SetScope
void SetScope(Ipv6InterfaceAddress::Scope_e scope)
Set the scope.
Definition:
ipv6-interface-address.cc:129
ns3::Ipv6InterfaceAddress::GetNsDadUid
uint32_t GetNsDadUid() const
Get the latest DAD probe packet UID.
Definition:
ipv6-interface-address.cc:162
ns3::Ptr< Ipv6Interface >
ns3::Ipv6InterfaceAddress::operator!=
friend bool operator!=(Ipv6InterfaceAddress const &a, Ipv6InterfaceAddress const &b)
Not equal to operator.
Definition:
ipv6-interface-address.h:222
ns3::Ipv6InterfaceAddress::PREFERRED
Preferred address.
Definition:
ipv6-interface-address.h:47
ns3::Ipv6InterfaceAddress::SetNsDadUid
void SetNsDadUid(uint32_t uid)
Set the latest DAD probe packet UID.
Definition:
ipv6-interface-address.cc:168
ns3::Ipv6InterfaceAddress
IPv6 address associated with an interface.
Definition:
ipv6-interface-address.h:36
ns3::Ipv6InterfaceAddress::LINKLOCAL
Link-local address (fe80::/64)
Definition:
ipv6-interface-address.h:61
ns3::Ipv6InterfaceAddress::m_nsDadUid
uint32_t m_nsDadUid
Last DAD probe packet UID.
Definition:
ipv6-interface-address.h:203
ns3::Ipv6InterfaceAddress::INVALID
Invalid state (after a DAD failed)
Definition:
ipv6-interface-address.h:51
ns3::Ipv6InterfaceAddress::GetAddress
Ipv6Address GetAddress() const
Get the IPv6 address.
Definition:
ipv6-interface-address.cc:76
ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress
Ipv6InterfaceAddress()
Default constructor.
Definition:
ipv6-interface-address.cc:34
ns3::Ipv6InterfaceAddress::m_address
Ipv6Address m_address
The IPv6 address.
Definition:
ipv6-interface-address.h:165
ns3::Ipv6InterfaceAddress::HOST
Localhost (::1/128)
Definition:
ipv6-interface-address.h:60
ns3::Ipv6InterfaceAddress::SetState
void SetState(Ipv6InterfaceAddress::State_e state)
Set the state.
Definition:
ipv6-interface-address.cc:117
ns3::Ipv6InterfaceAddress::GetPrefix
Ipv6Prefix GetPrefix() const
Get the IPv6 prefix.
Definition:
ipv6-interface-address.cc:111
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:43
ns3::operator!=
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Definition:
callback.h:1213
ns3::Ipv6InterfaceAddress::GLOBAL
Global address (2000::/3)
Definition:
ipv6-interface-address.h:62
ns3::Ipv6InterfaceAddress::GetState
Ipv6InterfaceAddress::State_e GetState() const
Get the address state.
Definition:
ipv6-interface-address.cc:123
ns3::Ipv6InterfaceAddress::Scope_e
Scope_e
Address scope.
Definition:
ipv6-interface-address.h:58
ns3::Ipv6InterfaceAddress::operator==
friend bool operator==(Ipv6InterfaceAddress const &a, Ipv6InterfaceAddress const &b)
Equal to operator.
Definition:
ipv6-interface-address.h:216
ns3::Ipv6InterfaceAddress::PERMANENT
Permanent address.
Definition:
ipv6-interface-address.h:48
ns3::Ipv6InterfaceAddress::~Ipv6InterfaceAddress
~Ipv6InterfaceAddress()
Destructor.
Definition:
ipv6-interface-address.cc:71
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:46
ns3::Ipv6InterfaceAddress::SetAddress
void SetAddress(Ipv6Address address)
Set IPv6 address (and scope).
Definition:
ipv6-interface-address.cc:82
ns3::Ipv6InterfaceAddress::GetScope
Ipv6InterfaceAddress::Scope_e GetScope() const
Get address scope.
Definition:
ipv6-interface-address.cc:135
ns3::Ipv6InterfaceAddress::m_prefix
Ipv6Prefix m_prefix
The IPv6 prefix.
Definition:
ipv6-interface-address.h:170
ns3::Ipv6InterfaceAddress::State_e
State_e
State of an address associated with an interface.
Definition:
ipv6-interface-address.h:43
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.cc:89
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition:
ipv6-address.h:387
ns3::Ipv6InterfaceAddress::m_scope
Scope_e m_scope
Scope of the address.
Definition:
ipv6-interface-address.h:180
ns3::Ipv6InterfaceAddress::TENTATIVE_OPTIMISTIC
Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished...
Definition:
ipv6-interface-address.h:50
first.address
tuple address
Definition:
first.py:37
ns3::Ipv6InterfaceAddress::HOMEADDRESS
Address is a HomeAddress.
Definition:
ipv6-interface-address.h:49
ns3::Ipv6InterfaceAddress::DEPRECATED
Address is deprecated and should not be used.
Definition:
ipv6-interface-address.h:46
ns3::Ipv6InterfaceAddress::TENTATIVE
Address is tentative, no packet can be sent unless DAD finished.
Definition:
ipv6-interface-address.h:45
src
internet
model
ipv6-interface-address.h
Generated on Sat Apr 19 2014 14:06:56 for ns-3 by
1.8.6