Router prefix information. More...
#include "ipv6-autoconfigured-prefix.h"
Public Member Functions | |
Ipv6AutoconfiguredPrefix (Ptr< Node > node, uint32_t interface, Ipv6Address prefix, Ipv6Prefix mask, uint32_t preferredLifeTime, uint32_t validLifeTime, Ipv6Address router=Ipv6Address("::")) | |
Constructor. More... | |
~Ipv6AutoconfiguredPrefix () override | |
Destructor. More... | |
void | FunctionPreferredTimeout () |
Signal that the preferred time expired and start the valid timer. More... | |
void | FunctionValidTimeout () |
Signal that the valid time expired. More... | |
Ipv6Address | GetDefaultGatewayRouter () const |
Get the default gateway address. More... | |
uint32_t | GetId () const |
Get the prefix identifier. More... | |
uint32_t | GetInterface () const |
Get the interface index. More... | |
Ipv6Prefix | GetMask () const |
Get the bitmask prefix. More... | |
uint32_t | GetPreferredLifeTime () const |
Get the prefix preferred life time. More... | |
Ipv6Address | GetPrefix () const |
Get the prefix address. More... | |
uint32_t | GetValidLifeTime () const |
Get the prefix valid life time. More... | |
bool | IsPreferred () const |
Test if the prefix is preferred. More... | |
bool | IsValid () const |
Test if the prefix is valid. More... | |
void | MarkPreferredTime () |
Set the prefix as preferred. More... | |
void | MarkValidTime () |
Set the prefix as valid. More... | |
void | RemoveMe () |
Remove this prefix from the prefix list. More... | |
void | SetDefaultGatewayRouter (Ipv6Address router) |
Set the default gateway router. More... | |
void | SetInterface (uint32_t interface) |
Set the interface. More... | |
void | SetMask (Ipv6Prefix mask) |
Set the bitmask prefix. More... | |
void | SetPreferred () |
Set the prefix as preferred. More... | |
void | SetPreferredLifeTime (uint32_t p) |
Set the prefix preferred life time. More... | |
void | SetPrefix (Ipv6Address prefix) |
Set the prefix address. More... | |
void | SetValid () |
Set the prefix as valid. More... | |
void | SetValidLifeTime (uint32_t v) |
Set the prefix valid life time. More... | |
void | StartPreferredTimer () |
Start the preferred timer. More... | |
void | StartValidTimer () |
Start the valid timer. More... | |
void | StopPreferredTimer () |
Stop the preferred timer. More... | |
void | StopValidTimer () |
Stop the valid timer. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Private Attributes | |
Ipv6Address | m_defaultGatewayRouter |
Default gateway router. More... | |
uint32_t | m_id |
the identifier of this prefix. More... | |
uint32_t | m_interface |
The interface index (which is stored the address corresponding of the prefix). More... | |
Ipv6Prefix | m_mask |
The prefix bitmask (length). More... | |
Ptr< Node > | m_node |
The node. More... | |
bool | m_preferred |
true if the prefix is preferred. More... | |
uint32_t | m_preferredLifeTime |
the preferred life time. More... | |
Timer | m_preferredTimer |
the timer for preferred life time. More... | |
Ipv6Address | m_prefix |
The prefix IPv6 address. More... | |
bool | m_valid |
true if the prefix is valid. More... | |
uint32_t | m_validLifeTime |
the valid life time. More... | |
Timer | m_validTimer |
the timer for valid life time. More... | |
Static Private Attributes | |
static uint32_t | m_prefixId = 0 |
a static identifier. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose () |
Destructor implementation. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Router prefix information.
Definition at line 40 of file ipv6-autoconfigured-prefix.h.
ns3::Ipv6AutoconfiguredPrefix::Ipv6AutoconfiguredPrefix | ( | Ptr< Node > | node, |
uint32_t | interface, | ||
Ipv6Address | prefix, | ||
Ipv6Prefix | mask, | ||
uint32_t | preferredLifeTime, | ||
uint32_t | validLifeTime, | ||
Ipv6Address | router = Ipv6Address("::") |
||
) |
Constructor.
node | node |
interface | interface index |
prefix | IPv6 address |
mask | bitmask prefix |
preferredLifeTime | the preferred life time |
validLifeTime | the valid life time |
router | if it the prefix that configure the default gateway |
Definition at line 34 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.
|
override |
Destructor.
Definition at line 60 of file ipv6-autoconfigured-prefix.cc.
void ns3::Ipv6AutoconfiguredPrefix::FunctionPreferredTimeout | ( | ) |
Signal that the preferred time expired and start the valid timer.
Definition at line 136 of file ipv6-autoconfigured-prefix.cc.
References m_preferred, m_prefix, MarkValidTime(), NS_LOG_INFO, and StartValidTimer().
Referenced by StartPreferredTimer().
void ns3::Ipv6AutoconfiguredPrefix::FunctionValidTimeout | ( | ) |
Signal that the valid time expired.
Definition at line 145 of file ipv6-autoconfigured-prefix.cc.
References m_prefix, m_valid, NS_LOG_INFO, and RemoveMe().
Referenced by StartValidTimer().
Ipv6Address ns3::Ipv6AutoconfiguredPrefix::GetDefaultGatewayRouter | ( | ) | const |
Get the default gateway address.
Definition at line 71 of file ipv6-autoconfigured-prefix.cc.
References m_defaultGatewayRouter.
uint32_t ns3::Ipv6AutoconfiguredPrefix::GetId | ( | void | ) | const |
Get the prefix identifier.
Definition at line 218 of file ipv6-autoconfigured-prefix.cc.
References m_id.
uint32_t ns3::Ipv6AutoconfiguredPrefix::GetInterface | ( | ) | const |
Get the interface index.
Definition at line 83 of file ipv6-autoconfigured-prefix.cc.
References m_interface.
Ipv6Prefix ns3::Ipv6AutoconfiguredPrefix::GetMask | ( | ) | const |
Get the bitmask prefix.
Definition at line 248 of file ipv6-autoconfigured-prefix.cc.
References m_mask.
uint32_t ns3::Ipv6AutoconfiguredPrefix::GetPreferredLifeTime | ( | ) | const |
Get the prefix preferred life time.
Definition at line 100 of file ipv6-autoconfigured-prefix.cc.
References m_preferredLifeTime.
Ipv6Address ns3::Ipv6AutoconfiguredPrefix::GetPrefix | ( | ) | const |
Get the prefix address.
Definition at line 236 of file ipv6-autoconfigured-prefix.cc.
References m_prefix.
uint32_t ns3::Ipv6AutoconfiguredPrefix::GetValidLifeTime | ( | ) | const |
Get the prefix valid life time.
Definition at line 117 of file ipv6-autoconfigured-prefix.cc.
References m_validLifeTime.
bool ns3::Ipv6AutoconfiguredPrefix::IsPreferred | ( | ) | const |
Test if the prefix is preferred.
Definition at line 224 of file ipv6-autoconfigured-prefix.cc.
References m_preferred.
bool ns3::Ipv6AutoconfiguredPrefix::IsValid | ( | ) | const |
Test if the prefix is valid.
Definition at line 230 of file ipv6-autoconfigured-prefix.cc.
References m_valid.
void ns3::Ipv6AutoconfiguredPrefix::MarkPreferredTime | ( | ) |
Set the prefix as preferred.
Definition at line 123 of file ipv6-autoconfigured-prefix.cc.
References m_preferred.
void ns3::Ipv6AutoconfiguredPrefix::MarkValidTime | ( | ) |
Set the prefix as valid.
Definition at line 129 of file ipv6-autoconfigured-prefix.cc.
References m_preferred, and m_valid.
Referenced by FunctionPreferredTimeout().
void ns3::Ipv6AutoconfiguredPrefix::RemoveMe | ( | ) |
Remove this prefix from the prefix list.
Definition at line 197 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().
void ns3::Ipv6AutoconfiguredPrefix::SetDefaultGatewayRouter | ( | Ipv6Address | router | ) |
Set the default gateway router.
router | IPv6 link-local address of the default router |
Definition at line 65 of file ipv6-autoconfigured-prefix.cc.
References m_defaultGatewayRouter.
void ns3::Ipv6AutoconfiguredPrefix::SetInterface | ( | uint32_t | interface | ) |
Set the interface.
interface | interface index to set |
Definition at line 77 of file ipv6-autoconfigured-prefix.cc.
References m_interface.
void ns3::Ipv6AutoconfiguredPrefix::SetMask | ( | Ipv6Prefix | mask | ) |
Set the bitmask prefix.
mask | prefix |
Definition at line 254 of file ipv6-autoconfigured-prefix.cc.
References m_mask.
void ns3::Ipv6AutoconfiguredPrefix::SetPreferred | ( | ) |
Set the prefix as preferred.
Definition at line 205 of file ipv6-autoconfigured-prefix.cc.
References m_preferred.
void ns3::Ipv6AutoconfiguredPrefix::SetPreferredLifeTime | ( | uint32_t | p | ) |
Set the prefix preferred life time.
p | the prefix preferred life time |
Definition at line 89 of file ipv6-autoconfigured-prefix.cc.
References m_preferredLifeTime, m_validLifeTime, and NS_LOG_WARN.
void ns3::Ipv6AutoconfiguredPrefix::SetPrefix | ( | Ipv6Address | prefix | ) |
Set the prefix address.
prefix | prefix address to set |
Definition at line 242 of file ipv6-autoconfigured-prefix.cc.
References m_prefix.
void ns3::Ipv6AutoconfiguredPrefix::SetValid | ( | ) |
Set the prefix as valid.
Definition at line 211 of file ipv6-autoconfigured-prefix.cc.
References m_preferred, and m_valid.
void ns3::Ipv6AutoconfiguredPrefix::SetValidLifeTime | ( | uint32_t | v | ) |
Set the prefix valid life time.
v | the prefix valid life time |
Definition at line 106 of file ipv6-autoconfigured-prefix.cc.
References m_preferredLifeTime, m_validLifeTime, and NS_LOG_WARN.
void ns3::Ipv6AutoconfiguredPrefix::StartPreferredTimer | ( | ) |
Start the preferred timer.
Definition at line 153 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().
Referenced by ns3::Ipv6L3Protocol::AddAutoconfiguredAddress().
void ns3::Ipv6AutoconfiguredPrefix::StartValidTimer | ( | ) |
Start the valid timer.
Definition at line 165 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().
void ns3::Ipv6AutoconfiguredPrefix::StopPreferredTimer | ( | ) |
Stop the preferred timer.
Definition at line 177 of file ipv6-autoconfigured-prefix.cc.
References ns3::Timer::Cancel(), ns3::Timer::IsRunning(), m_preferredTimer, m_prefix, and NS_LOG_INFO.
void ns3::Ipv6AutoconfiguredPrefix::StopValidTimer | ( | ) |
Stop the valid timer.
Definition at line 187 of file ipv6-autoconfigured-prefix.cc.
References ns3::Timer::Cancel(), ns3::Timer::IsRunning(), m_prefix, m_validTimer, and NS_LOG_INFO.
|
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 244 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), GetDefaultGatewayRouter(), RemoveMe(), and SetDefaultGatewayRouter().
|
private |
the identifier of this prefix.
Definition at line 220 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), and GetId().
|
private |
The interface index (which is stored the address corresponding of the prefix).
Definition at line 250 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), GetInterface(), RemoveMe(), and SetInterface().
|
private |
The prefix bitmask (length).
Definition at line 235 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), GetMask(), RemoveMe(), and SetMask().
The node.
Definition at line 225 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), and RemoveMe().
|
private |
true if the prefix is preferred.
Definition at line 265 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), FunctionPreferredTimeout(), IsPreferred(), MarkPreferredTime(), MarkValidTime(), SetPreferred(), and SetValid().
|
private |
the preferred life time.
Definition at line 260 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), GetPreferredLifeTime(), SetPreferredLifeTime(), SetValidLifeTime(), StartPreferredTimer(), and StartValidTimer().
|
private |
the timer for preferred life time.
Definition at line 275 of file ipv6-autoconfigured-prefix.h.
Referenced by StartPreferredTimer(), and StopPreferredTimer().
|
private |
The prefix IPv6 address.
Definition at line 230 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), FunctionPreferredTimeout(), FunctionValidTimeout(), GetPrefix(), RemoveMe(), SetPrefix(), StartPreferredTimer(), StartValidTimer(), StopPreferredTimer(), and StopValidTimer().
|
staticprivate |
a static identifier.
Definition at line 215 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix().
|
private |
true if the prefix is valid.
Definition at line 270 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), FunctionValidTimeout(), IsValid(), MarkValidTime(), and SetValid().
|
private |
the valid life time.
Definition at line 255 of file ipv6-autoconfigured-prefix.h.
Referenced by Ipv6AutoconfiguredPrefix(), GetValidLifeTime(), SetPreferredLifeTime(), SetValidLifeTime(), and StartValidTimer().
|
private |
the timer for valid life time.
Definition at line 280 of file ipv6-autoconfigured-prefix.h.
Referenced by StartValidTimer(), and StopValidTimer().