A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::Ipv6InterfaceAddress Class Reference

IPv6 address associated with an interface. More...

#include "ipv6-interface-address.h"

+ Collaboration diagram for ns3::Ipv6InterfaceAddress:

Public Types

enum  Scope_e { HOST , LINKLOCAL , GLOBAL }
 Address scope. 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 (const Ipv6InterfaceAddress &o)
 Copy constructor.
 
 Ipv6InterfaceAddress (Ipv6Address address)
 Constructor.
 
 Ipv6InterfaceAddress (Ipv6Address address, Ipv6Prefix prefix)
 Constructor.
 
 Ipv6InterfaceAddress (Ipv6Address address, Ipv6Prefix prefix, bool onLink)
 Constructor.
 
 ~Ipv6InterfaceAddress ()
 Destructor.
 
Ipv6Address GetAddress () const
 Get the IPv6 address.
 
uint32_t GetNsDadUid () const
 Get the latest DAD probe packet UID.
 
bool GetOnLink () const
 Get the on-link property.
 
Ipv6Prefix GetPrefix () const
 Get the IPv6 prefix.
 
Ipv6InterfaceAddress::Scope_e GetScope () const
 Get address scope.
 
Ipv6InterfaceAddress::State_e GetState () const
 Get the address state.
 
bool IsInSameSubnet (Ipv6Address b) const
 Checks if the address is in the same subnet.
 
void SetAddress (Ipv6Address address)
 Set IPv6 address (and scope).
 
void SetNsDadUid (uint32_t uid)
 Set the latest DAD probe packet UID.
 
void SetOnLink (bool onLink)
 Get the on-link property.
 
void SetScope (Ipv6InterfaceAddress::Scope_e scope)
 Set the scope.
 
void SetState (Ipv6InterfaceAddress::State_e state)
 Set the state.
 

Private Attributes

Ipv6Address m_address
 The IPv6 address.
 
uint32_t m_nsDadUid
 Last DAD probe packet UID.
 
bool m_onLink
 The address belongs to an on-link network.
 
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!= (const Ipv6InterfaceAddress &a, const Ipv6InterfaceAddress &b)
 Not equal to operator.
 
bool operator== (const Ipv6InterfaceAddress &a, const Ipv6InterfaceAddress &b)
 Equal to operator.
 

Detailed Description

IPv6 address associated with an interface.

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

Member Enumeration Documentation

◆ Scope_e

Address scope.

Enumerator
HOST 

Localhost (::1/128)

LINKLOCAL 

Link-local address (fe80::/64)

GLOBAL 

Global address (2000::/3)

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

◆ State_e

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

◆ Ipv6InterfaceAddress() [1/5]

ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress ( )

Default constructor.

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

References NS_LOG_FUNCTION.

◆ Ipv6InterfaceAddress() [2/5]

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_onLink, m_prefix, NS_LOG_FUNCTION, SetAddress(), SetState(), and TENTATIVE_OPTIMISTIC.

+ Here is the call graph for this function:

◆ Ipv6InterfaceAddress() [3/5]

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

Constructor.

Parameters
addressIPv6 address to set
prefixIPv6 prefix

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

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

+ Here is the call graph for this function:

◆ Ipv6InterfaceAddress() [4/5]

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

Constructor.

Parameters
addressIPv6 address to set
prefixIPv6 prefix
onLinkon-link property

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

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

+ Here is the call graph for this function:

◆ Ipv6InterfaceAddress() [5/5]

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

Copy constructor.

Parameters
oobject to copy

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

◆ ~Ipv6InterfaceAddress()

ns3::Ipv6InterfaceAddress::~Ipv6InterfaceAddress ( )

Destructor.

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ GetAddress()

◆ GetNsDadUid()

uint32_t ns3::Ipv6InterfaceAddress::GetNsDadUid ( ) const

Get the latest DAD probe packet UID.

Returns
uid

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

References m_nsDadUid, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ GetOnLink()

bool ns3::Ipv6InterfaceAddress::GetOnLink ( ) const

Get the on-link property.

Returns
on-link flag

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

References m_onLink, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6StaticRouting::NotifyInterfaceUp().

+ Here is the caller graph for this function:

◆ GetPrefix()

Ipv6Prefix ns3::Ipv6InterfaceAddress::GetPrefix ( ) const

Get the IPv6 prefix.

Returns
IPv6 prefix

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

References m_prefix, and NS_LOG_FUNCTION.

Referenced by ns3::Ipv6Interface::GetAddressMatchingDestination(), ns3::Ipv6StaticRouting::NotifyInterfaceUp(), and ns3::operator<<().

+ Here is the caller graph for this function:

◆ GetScope()

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

Get address scope.

Returns
scope

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

References m_scope, and NS_LOG_FUNCTION.

Referenced by ns3::RipNg::DoSendRouteUpdate(), ns3::Ipv6InterfaceContainer::GetLinkLocalAddress(), ns3::RipNg::HandleRequests(), ns3::operator<<(), and ns3::NeighborCacheHelper::PopulateNeighborEntriesIpv6().

+ Here is the caller graph for this function:

◆ GetState()

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

Get the address state.

Returns
address state

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

References m_state, and NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ IsInSameSubnet()

bool ns3::Ipv6InterfaceAddress::IsInSameSubnet ( Ipv6Address  b) const

Checks if the address is in the same subnet.

Parameters
bthe address to check
Returns
true if the address is in the same subnet.

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

References ns3::Ipv6Address::CombinePrefix(), ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsLinkLocalMulticast(), m_address, m_prefix, and NS_LOG_FUNCTION.

Referenced by ns3::NeighborCacheHelper::PopulateNeighborEntriesIpv6(), and ns3::NeighborCacheHelper::UpdateCacheByIpv6AddressAdded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAddress()

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

Set IPv6 address (and scope).

Parameters
addressIPv6 address to set

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

References GLOBAL, HOST, LINKLOCAL, m_address, m_prefix, m_scope, and NS_LOG_FUNCTION.

Referenced by Ipv6InterfaceAddress().

+ Here is the caller graph for this function:

◆ SetNsDadUid()

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

Set the latest DAD probe packet UID.

Parameters
uidpacket uid

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

References m_nsDadUid, and NS_LOG_FUNCTION.

◆ SetOnLink()

void ns3::Ipv6InterfaceAddress::SetOnLink ( bool  onLink)

Get the on-link property.

Parameters
onLinkthe on-link property

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

References m_onLink, and NS_LOG_FUNCTION.

◆ SetScope()

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

Set the scope.

Parameters
scopethe scope of address

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

References m_scope, and NS_LOG_FUNCTION.

◆ SetState()

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

Set the state.

Parameters
statethe state

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

References m_state, and NS_LOG_FUNCTION.

Referenced by Ipv6InterfaceAddress().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!=

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

Not equal to operator.

Parameters
athe first operand
bthe first operand
Returns
true if the operands are not equal

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

◆ operator==

bool operator== ( const Ipv6InterfaceAddress a,
const Ipv6InterfaceAddress b 
)
friend

Equal to operator.

Parameters
athe first operand
bthe first operand
Returns
true if the operands are equal

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

Member Data Documentation

◆ m_address

Ipv6Address ns3::Ipv6InterfaceAddress::m_address
private

The IPv6 address.

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

Referenced by GetAddress(), IsInSameSubnet(), and SetAddress().

◆ m_nsDadUid

uint32_t ns3::Ipv6InterfaceAddress::m_nsDadUid
private

Last DAD probe packet UID.

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

Referenced by Ipv6InterfaceAddress(), GetNsDadUid(), and SetNsDadUid().

◆ m_onLink

bool ns3::Ipv6InterfaceAddress::m_onLink
private

The address belongs to an on-link network.

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

Referenced by Ipv6InterfaceAddress(), GetOnLink(), and SetOnLink().

◆ m_prefix

Ipv6Prefix ns3::Ipv6InterfaceAddress::m_prefix
private

The IPv6 prefix.

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

Referenced by Ipv6InterfaceAddress(), GetPrefix(), IsInSameSubnet(), and SetAddress().

◆ m_scope

Scope_e ns3::Ipv6InterfaceAddress::m_scope
private

Scope of the address.

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

Referenced by GetScope(), SetAddress(), and SetScope().

◆ m_state

State_e ns3::Ipv6InterfaceAddress::m_state
private

State of the address.

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

Referenced by GetState(), and SetState().


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