A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::Ipv6InterfaceAddress Class Reference

IPv6 address associated with an interface. More...

#include <ipv6-interface-address.h>

Public Types

enum  Scope_e { HOST, LINKLOCAL, GLOBAL }
 Scope of address. More...
 
enum  State_e {
  TENTATIVE, DEPRECATED, PREFERRED, PERMANENT,
  HOMEADDRESS, TENTATIVE_OPTIMISTIC, INVALID
}
 State of an address associated with an interface. More...
 

Public Member Functions

 Ipv6InterfaceAddress ()
 Default constructor.
 
 Ipv6InterfaceAddress (Ipv6Address address)
 Constructor. Prefix is 64 by default. More...
 
 Ipv6InterfaceAddress (Ipv6Address address, Ipv6Prefix prefix)
 Constructor. More...
 
 Ipv6InterfaceAddress (const Ipv6InterfaceAddress &o)
 Copy constructor. More...
 
 ~Ipv6InterfaceAddress ()
 Destructor.
 
Ipv6Address GetAddress () const
 Get the IPv6 address. More...
 
uint32_t GetNsDadUid () const
 Get the latest DAD probe packet UID. More...
 
Ipv6Prefix GetPrefix () const
 Get the IPv6 prefix. More...
 
Ipv6InterfaceAddress::Scope_e GetScope () const
 Get address scope. More...
 
Ipv6InterfaceAddress::State_e GetState () const
 Get the address state. More...
 
void SetAddress (Ipv6Address address)
 Set IPv6 address (and scope). More...
 
void SetNsDadUid (uint32_t uid)
 Set the latest DAD probe packet UID. More...
 
void SetScope (Ipv6InterfaceAddress::Scope_e scope)
 Set the scope. More...
 
void SetState (Ipv6InterfaceAddress::State_e state)
 Set the state. More...
 

Private Attributes

Ipv6Address m_address
 The IPv6 address.
 
uint32_t m_nsDadUid
 Last DAD probe packet UID.
 
Ipv6Prefix m_prefix
 The IPv6 prefix.
 
Scope_e m_scope
 Scope of the address.
 
State_e m_state
 State of the address.
 

Friends

bool operator!= (Ipv6InterfaceAddress const &a, Ipv6InterfaceAddress const &b)
 
bool operator== (Ipv6InterfaceAddress const &a, Ipv6InterfaceAddress const &b)
 

Detailed Description

IPv6 address associated with an interface.

Definition at line 36 of file ipv6-interface-address.h.

Member Enumeration Documentation

Scope of address.

Enumerator
HOST 

Localhost (::1/128)

LINKLOCAL 

Link-local address (fe80::/64)

GLOBAL 

Global address (2000::/3)

Definition at line 58 of file ipv6-interface-address.h.

State of an address associated with an interface.

Enumerator
TENTATIVE 

Address is tentative, no packet can be sent unless DAD finished

DEPRECATED 

Address is deprecated and should not be used

PREFERRED 

Preferred address

PERMANENT 

Permanent address

HOMEADDRESS 

Address is a HomeAddress

TENTATIVE_OPTIMISTIC 

Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished

INVALID 

Invalid state (after a DAD failed)

Definition at line 43 of file ipv6-interface-address.h.

Constructor & Destructor Documentation

ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress ( Ipv6Address  address)

Constructor. Prefix is 64 by default.

Parameters
addressthe IPv6 address to set

Definition at line 43 of file ipv6-interface-address.cc.

References m_nsDadUid, m_prefix, NS_LOG_FUNCTION, SetAddress(), SetState(), and TENTATIVE_OPTIMISTIC.

ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress ( Ipv6Address  address,
Ipv6Prefix  prefix 
)

Constructor.

Parameters
addressIPv6 address to set
prefixIPv6 prefix

Definition at line 52 of file ipv6-interface-address.cc.

References m_nsDadUid, m_prefix, NS_LOG_FUNCTION, SetAddress(), SetState(), and TENTATIVE_OPTIMISTIC.

ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress ( const Ipv6InterfaceAddress o)

Copy constructor.

Parameters
oobject to copy

Definition at line 61 of file ipv6-interface-address.cc.

Member Function Documentation

uint32_t ns3::Ipv6InterfaceAddress::GetNsDadUid ( ) const

Get the latest DAD probe packet UID.

Returns
uid

Definition at line 141 of file ipv6-interface-address.cc.

References m_nsDadUid, and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::Icmpv6L4Protocol::HandleNS().

Ipv6InterfaceAddress::Scope_e ns3::Ipv6InterfaceAddress::GetScope ( void  ) const

Get address scope.

Returns
scope

Definition at line 128 of file ipv6-interface-address.cc.

References m_scope, and NS_LOG_FUNCTION_NOARGS.

Ipv6InterfaceAddress::State_e ns3::Ipv6InterfaceAddress::GetState ( void  ) const

Get the address state.

Returns
address state

Definition at line 116 of file ipv6-interface-address.cc.

References m_state, and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::Icmpv6L4Protocol::FunctionDadTimeout(), and ns3::Icmpv6L4Protocol::HandleNA().

void ns3::Ipv6InterfaceAddress::SetAddress ( Ipv6Address  address)

Set IPv6 address (and scope).

Parameters
addressIPv6 address to set

Definition at line 81 of file ipv6-interface-address.cc.

References GLOBAL, HOST, ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsLocalhost(), LINKLOCAL, m_address, m_prefix, m_scope, and NS_LOG_FUNCTION.

Referenced by Ipv6InterfaceAddress().

void ns3::Ipv6InterfaceAddress::SetNsDadUid ( uint32_t  uid)

Set the latest DAD probe packet UID.

Parameters
uidpacket uid

Definition at line 147 of file ipv6-interface-address.cc.

References m_nsDadUid, and NS_LOG_FUNCTION.

void ns3::Ipv6InterfaceAddress::SetScope ( Ipv6InterfaceAddress::Scope_e  scope)

Set the scope.

Parameters
scopethe scope of address

Definition at line 122 of file ipv6-interface-address.cc.

References m_scope, and NS_LOG_FUNCTION.

void ns3::Ipv6InterfaceAddress::SetState ( Ipv6InterfaceAddress::State_e  state)

Set the state.

Parameters
statethe state

Definition at line 110 of file ipv6-interface-address.cc.

References m_state, and NS_LOG_FUNCTION.

Referenced by Ipv6InterfaceAddress().


The documentation for this class was generated from the following files: