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

Router prefix information. More...

#include "ipv6-autoconfigured-prefix.h"

+ Inheritance diagram for ns3::Ipv6AutoconfiguredPrefix:
+ Collaboration diagram for ns3::Ipv6AutoconfiguredPrefix:

Public Member Functions

 Ipv6AutoconfiguredPrefix (Ptr< Node > node, uint32_t interface, Ipv6Address prefix, Ipv6Prefix mask, uint32_t preferredLifeTime, uint32_t validLifeTime, Ipv6Address router=Ipv6Address("::"))
 Constructor.
 
 ~Ipv6AutoconfiguredPrefix () override
 Destructor.
 
void FunctionPreferredTimeout ()
 Signal that the preferred time expired and start the valid timer.
 
void FunctionValidTimeout ()
 Signal that the valid time expired.
 
Ipv6Address GetDefaultGatewayRouter () const
 Get the default gateway address.
 
uint32_t GetId () const
 Get the prefix identifier.
 
uint32_t GetInterface () const
 Get the interface index.
 
Ipv6Prefix GetMask () const
 Get the bitmask prefix.
 
uint32_t GetPreferredLifeTime () const
 Get the prefix preferred life time.
 
Ipv6Address GetPrefix () const
 Get the prefix address.
 
uint32_t GetValidLifeTime () const
 Get the prefix valid life time.
 
bool IsPreferred () const
 Test if the prefix is preferred.
 
bool IsValid () const
 Test if the prefix is valid.
 
void MarkPreferredTime ()
 Set the prefix as preferred.
 
void MarkValidTime ()
 Set the prefix as valid.
 
void RemoveMe ()
 Remove this prefix from the prefix list.
 
void SetDefaultGatewayRouter (Ipv6Address router)
 Set the default gateway router.
 
void SetInterface (uint32_t interface)
 Set the interface.
 
void SetMask (Ipv6Prefix mask)
 Set the bitmask prefix.
 
void SetPreferred ()
 Set the prefix as preferred.
 
void SetPreferredLifeTime (uint32_t p)
 Set the prefix preferred life time.
 
void SetPrefix (Ipv6Address prefix)
 Set the prefix address.
 
void SetValid ()
 Set the prefix as valid.
 
void SetValidLifeTime (uint32_t v)
 Set the prefix valid life time.
 
void StartPreferredTimer ()
 Start the preferred timer.
 
void StartValidTimer ()
 Start the valid timer.
 
void StopPreferredTimer ()
 Stop the preferred timer.
 
void StopValidTimer ()
 Stop the valid timer.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Private Attributes

Ipv6Address m_defaultGatewayRouter
 Default gateway router.
 
uint32_t m_id
 the identifier of this prefix.
 
uint32_t m_interface
 The interface index (which is stored the address corresponding of the prefix).
 
Ipv6Prefix m_mask
 The prefix bitmask (length).
 
Ptr< Nodem_node
 The node.
 
bool m_preferred
 true if the prefix is preferred.
 
uint32_t m_preferredLifeTime
 the preferred life time.
 
Timer m_preferredTimer
 the timer for preferred life time.
 
Ipv6Address m_prefix
 The prefix IPv6 address.
 
bool m_valid
 true if the prefix is valid.
 
uint32_t m_validLifeTime
 the valid life time.
 
Timer m_validTimer
 the timer for valid life time.
 

Static Private Attributes

static uint32_t m_prefixId = 0
 a static identifier.
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

Router prefix information.

Definition at line 29 of file ipv6-autoconfigured-prefix.h.

Constructor & Destructor Documentation

◆ Ipv6AutoconfiguredPrefix()

ns3::Ipv6AutoconfiguredPrefix::Ipv6AutoconfiguredPrefix ( Ptr< Node > node,
uint32_t interface,
Ipv6Address prefix,
Ipv6Prefix mask,
uint32_t preferredLifeTime,
uint32_t validLifeTime,
Ipv6Address router = Ipv6Address("::") )

Constructor.

Parameters
nodenode
interfaceinterface index
prefixIPv6 address
maskbitmask prefix
preferredLifeTimethe preferred life time
validLifeTimethe valid life time
routerif it the prefix that configure the default gateway

Definition at line 23 of file ipv6-autoconfigured-prefix.cc.

References m_defaultGatewayRouter, m_id, m_interface, m_mask, m_node, m_preferred, m_preferredLifeTime, m_prefix, m_prefixId, m_valid, m_validLifeTime, and NS_LOG_WARN.

◆ ~Ipv6AutoconfiguredPrefix()

ns3::Ipv6AutoconfiguredPrefix::~Ipv6AutoconfiguredPrefix ( )
override

Destructor.

Definition at line 49 of file ipv6-autoconfigured-prefix.cc.

Member Function Documentation

◆ FunctionPreferredTimeout()

void ns3::Ipv6AutoconfiguredPrefix::FunctionPreferredTimeout ( )

Signal that the preferred time expired and start the valid timer.

Definition at line 125 of file ipv6-autoconfigured-prefix.cc.

References m_preferred, m_prefix, MarkValidTime(), NS_LOG_INFO, and StartValidTimer().

Referenced by StartPreferredTimer().

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

◆ FunctionValidTimeout()

void ns3::Ipv6AutoconfiguredPrefix::FunctionValidTimeout ( )

Signal that the valid time expired.

Definition at line 134 of file ipv6-autoconfigured-prefix.cc.

References m_prefix, m_valid, NS_LOG_INFO, and RemoveMe().

Referenced by StartValidTimer().

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

◆ GetDefaultGatewayRouter()

Ipv6Address ns3::Ipv6AutoconfiguredPrefix::GetDefaultGatewayRouter ( ) const

Get the default gateway address.

Returns
IPv6 link-local address of the default router

Definition at line 60 of file ipv6-autoconfigured-prefix.cc.

References m_defaultGatewayRouter.

◆ GetId()

uint32_t ns3::Ipv6AutoconfiguredPrefix::GetId ( ) const

Get the prefix identifier.

Returns
id of the prefix.

Definition at line 207 of file ipv6-autoconfigured-prefix.cc.

References m_id.

◆ GetInterface()

uint32_t ns3::Ipv6AutoconfiguredPrefix::GetInterface ( ) const

Get the interface index.

Returns
interface index

Definition at line 72 of file ipv6-autoconfigured-prefix.cc.

References m_interface.

◆ GetMask()

Ipv6Prefix ns3::Ipv6AutoconfiguredPrefix::GetMask ( ) const

Get the bitmask prefix.

Returns
bitmask prefix

Definition at line 237 of file ipv6-autoconfigured-prefix.cc.

References m_mask.

◆ GetPreferredLifeTime()

uint32_t ns3::Ipv6AutoconfiguredPrefix::GetPreferredLifeTime ( ) const

Get the prefix preferred life time.

Returns
preferred life time

Definition at line 89 of file ipv6-autoconfigured-prefix.cc.

References m_preferredLifeTime.

◆ GetPrefix()

Ipv6Address ns3::Ipv6AutoconfiguredPrefix::GetPrefix ( ) const

Get the prefix address.

Returns
prefix address

Definition at line 225 of file ipv6-autoconfigured-prefix.cc.

References m_prefix.

◆ GetValidLifeTime()

uint32_t ns3::Ipv6AutoconfiguredPrefix::GetValidLifeTime ( ) const

Get the prefix valid life time.

Returns
valid life time

Definition at line 106 of file ipv6-autoconfigured-prefix.cc.

References m_validLifeTime.

◆ IsPreferred()

bool ns3::Ipv6AutoconfiguredPrefix::IsPreferred ( ) const

Test if the prefix is preferred.

Returns
true if prefix is in preferred state, false otherwise

Definition at line 213 of file ipv6-autoconfigured-prefix.cc.

References m_preferred.

◆ IsValid()

bool ns3::Ipv6AutoconfiguredPrefix::IsValid ( ) const

Test if the prefix is valid.

Returns
true if prefix is in valid state, false otherwise

Definition at line 219 of file ipv6-autoconfigured-prefix.cc.

References m_valid.

◆ MarkPreferredTime()

void ns3::Ipv6AutoconfiguredPrefix::MarkPreferredTime ( )

Set the prefix as preferred.

Definition at line 112 of file ipv6-autoconfigured-prefix.cc.

References m_preferred.

◆ MarkValidTime()

void ns3::Ipv6AutoconfiguredPrefix::MarkValidTime ( )

Set the prefix as valid.

Definition at line 118 of file ipv6-autoconfigured-prefix.cc.

References m_preferred, and m_valid.

Referenced by FunctionPreferredTimeout().

+ Here is the caller graph for this function:

◆ RemoveMe()

void ns3::Ipv6AutoconfiguredPrefix::RemoveMe ( )

Remove this prefix from the prefix list.

Definition at line 186 of file ipv6-autoconfigured-prefix.cc.

References ns3::Object::GetObject(), m_defaultGatewayRouter, m_interface, m_mask, m_node, m_prefix, and NS_LOG_INFO.

Referenced by FunctionValidTimeout().

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

◆ SetDefaultGatewayRouter()

void ns3::Ipv6AutoconfiguredPrefix::SetDefaultGatewayRouter ( Ipv6Address router)

Set the default gateway router.

Parameters
routerIPv6 link-local address of the default router

Definition at line 54 of file ipv6-autoconfigured-prefix.cc.

References m_defaultGatewayRouter.

◆ SetInterface()

void ns3::Ipv6AutoconfiguredPrefix::SetInterface ( uint32_t interface)

Set the interface.

Parameters
interfaceinterface index to set

Definition at line 66 of file ipv6-autoconfigured-prefix.cc.

References m_interface.

◆ SetMask()

void ns3::Ipv6AutoconfiguredPrefix::SetMask ( Ipv6Prefix mask)

Set the bitmask prefix.

Parameters
maskprefix

Definition at line 243 of file ipv6-autoconfigured-prefix.cc.

References m_mask.

◆ SetPreferred()

void ns3::Ipv6AutoconfiguredPrefix::SetPreferred ( )

Set the prefix as preferred.

Definition at line 194 of file ipv6-autoconfigured-prefix.cc.

References m_preferred.

◆ SetPreferredLifeTime()

void ns3::Ipv6AutoconfiguredPrefix::SetPreferredLifeTime ( uint32_t p)

Set the prefix preferred life time.

Parameters
pthe prefix preferred life time

Definition at line 78 of file ipv6-autoconfigured-prefix.cc.

References m_preferredLifeTime, m_validLifeTime, and NS_LOG_WARN.

◆ SetPrefix()

void ns3::Ipv6AutoconfiguredPrefix::SetPrefix ( Ipv6Address prefix)

Set the prefix address.

Parameters
prefixprefix address to set

Definition at line 231 of file ipv6-autoconfigured-prefix.cc.

References m_prefix.

◆ SetValid()

void ns3::Ipv6AutoconfiguredPrefix::SetValid ( )

Set the prefix as valid.

Definition at line 200 of file ipv6-autoconfigured-prefix.cc.

References m_preferred, and m_valid.

◆ SetValidLifeTime()

void ns3::Ipv6AutoconfiguredPrefix::SetValidLifeTime ( uint32_t v)

Set the prefix valid life time.

Parameters
vthe prefix valid life time

Definition at line 95 of file ipv6-autoconfigured-prefix.cc.

References m_preferredLifeTime, m_validLifeTime, and NS_LOG_WARN.

◆ StartPreferredTimer()

void ns3::Ipv6AutoconfiguredPrefix::StartPreferredTimer ( )

Start the preferred timer.

Definition at line 142 of file ipv6-autoconfigured-prefix.cc.

References FunctionPreferredTimeout(), m_preferredLifeTime, m_preferredTimer, m_prefix, NS_LOG_INFO, ns3::Timer::Schedule(), ns3::Seconds(), ns3::Timer::SetDelay(), and ns3::Timer::SetFunction().

+ Here is the call graph for this function:

◆ StartValidTimer()

void ns3::Ipv6AutoconfiguredPrefix::StartValidTimer ( )

Start the valid timer.

Definition at line 154 of file ipv6-autoconfigured-prefix.cc.

References FunctionValidTimeout(), m_preferredLifeTime, m_prefix, m_validLifeTime, m_validTimer, NS_LOG_INFO, ns3::Timer::Schedule(), ns3::Seconds(), ns3::Timer::SetDelay(), and ns3::Timer::SetFunction().

Referenced by FunctionPreferredTimeout().

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

◆ StopPreferredTimer()

void ns3::Ipv6AutoconfiguredPrefix::StopPreferredTimer ( )

Stop the preferred timer.

Definition at line 166 of file ipv6-autoconfigured-prefix.cc.

References ns3::Timer::Cancel(), ns3::Timer::IsRunning(), m_preferredTimer, m_prefix, and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ StopValidTimer()

void ns3::Ipv6AutoconfiguredPrefix::StopValidTimer ( )

Stop the valid timer.

Definition at line 176 of file ipv6-autoconfigured-prefix.cc.

References ns3::Timer::Cancel(), ns3::Timer::IsRunning(), m_prefix, m_validTimer, and NS_LOG_INFO.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_defaultGatewayRouter

Ipv6Address ns3::Ipv6AutoconfiguredPrefix::m_defaultGatewayRouter
private

Default gateway router.

If the RA received also configured the default gateway, this variable has the link-local address. Otherwise this is "::"

Definition at line 233 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix(), GetDefaultGatewayRouter(), RemoveMe(), and SetDefaultGatewayRouter().

◆ m_id

uint32_t ns3::Ipv6AutoconfiguredPrefix::m_id
private

the identifier of this prefix.

Definition at line 209 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix(), and GetId().

◆ m_interface

uint32_t ns3::Ipv6AutoconfiguredPrefix::m_interface
private

The interface index (which is stored the address corresponding of the prefix).

Definition at line 239 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix(), GetInterface(), RemoveMe(), and SetInterface().

◆ m_mask

Ipv6Prefix ns3::Ipv6AutoconfiguredPrefix::m_mask
private

The prefix bitmask (length).

Definition at line 224 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix(), GetMask(), RemoveMe(), and SetMask().

◆ m_node

Ptr<Node> ns3::Ipv6AutoconfiguredPrefix::m_node
private

The node.

Definition at line 214 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix(), and RemoveMe().

◆ m_preferred

bool ns3::Ipv6AutoconfiguredPrefix::m_preferred
private

◆ m_preferredLifeTime

uint32_t ns3::Ipv6AutoconfiguredPrefix::m_preferredLifeTime
private

◆ m_preferredTimer

Timer ns3::Ipv6AutoconfiguredPrefix::m_preferredTimer
private

the timer for preferred life time.

Definition at line 264 of file ipv6-autoconfigured-prefix.h.

Referenced by StartPreferredTimer(), and StopPreferredTimer().

◆ m_prefix

◆ m_prefixId

uint32_t ns3::Ipv6AutoconfiguredPrefix::m_prefixId = 0
staticprivate

a static identifier.

Definition at line 204 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix().

◆ m_valid

bool ns3::Ipv6AutoconfiguredPrefix::m_valid
private

true if the prefix is valid.

Definition at line 259 of file ipv6-autoconfigured-prefix.h.

Referenced by Ipv6AutoconfiguredPrefix(), FunctionValidTimeout(), IsValid(), MarkValidTime(), and SetValid().

◆ m_validLifeTime

uint32_t ns3::Ipv6AutoconfiguredPrefix::m_validLifeTime
private

◆ m_validTimer

Timer ns3::Ipv6AutoconfiguredPrefix::m_validTimer
private

the timer for valid life time.

Definition at line 269 of file ipv6-autoconfigured-prefix.h.

Referenced by StartValidTimer(), and StopValidTimer().


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