A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::GlobalRoutingLSA< T > Class Template Reference

a Link State Advertisement (LSA) for a router, used in global routing. More...

#include "global-router-interface.h"

Inheritance diagram for ns3::GlobalRoutingLSA< T >:
Collaboration diagram for ns3::GlobalRoutingLSA< T >:

Public Types

enum  LSType {
  Unknown = 0 , RouterLSA , NetworkLSA , SummaryLSA ,
  SummaryLSA_ASBR , ASExternalLSAs
}
 corresponds to LS type field of RFC 2328 OSPF LSA header More...
enum  SPFStatus { LSA_SPF_NOT_EXPLORED = 0 , LSA_SPF_CANDIDATE , LSA_SPF_IN_SPFTREE }
 Enumeration of the possible values of the status flag in the Routing Link State Advertisements. More...

Public Member Functions

 GlobalRoutingLSA ()
 Create a blank Global Routing Link State Advertisement.
 GlobalRoutingLSA (GlobalRoutingLSA &lsa)
 Copy constructor for a Global Routing Link State Advertisement.
 GlobalRoutingLSA (SPFStatus status, IpAddress linkStateId, IpAddress advertisingRtr)
 Create an initialized Global Routing Link State Advertisement.
 ~GlobalRoutingLSA ()
 Destroy an existing Global Routing Link State Advertisement.
uint32_t AddAttachedRouter (IpAddress addr)
 Add an attached router to the list in the NetworkLSA.
uint32_t AddLinkRecord (GlobalRoutingLinkRecord< T > *lr)
 Add a given Global Routing Link Record to the LSA.
void ClearLinkRecords ()
 Release all of the Global Routing Link Records present in the Global Routing Link State Advertisement and make the list of link records empty.
void CopyLinkRecords (const GlobalRoutingLSA &lsa)
 Copy any Global Routing Link Records in a given Global Routing Link State Advertisement to the current LSA.
IpAddress GetAdvertisingRouter () const
 Get the Advertising Router as defined by the OSPF spec.
IpAddress GetAttachedRouter (uint32_t n) const
 Return an Ipv4Address corresponding to the specified attached router.
GlobalRoutingLinkRecord< T > * GetLinkRecord (uint32_t n) const
 Return a pointer to the specified Global Routing Link Record.
IpAddress GetLinkStateId () const
 Get the Link State ID as defined by the OSPF spec.
LSType GetLSType () const
 Return the LSType field of the LSA.
uint32_t GetNAttachedRouters () const
 Return the number of attached routers listed in the NetworkLSA.
IpMaskOrPrefix GetNetworkLSANetworkMask () const
 For a Network LSA, get the Network Mask field that precedes the list of attached routers.
uint32_t GetNLinkRecords () const
 Return the number of Global Routing Link Records in the LSA.
Ptr< NodeGetNode () const
 Get the Node pointer of the node that originated this LSA.
SPFStatus GetStatus () const
 Get the SPF status of the advertisement.
bool IsEmpty () const
 Check to see if the list of Global Routing Link Records present in the Global Routing Link State Advertisement is empty.
GlobalRoutingLSAoperator= (const GlobalRoutingLSA &lsa)
 Assignment operator for a Global Routing Link State Advertisement.
void Print (std::ostream &os) const
 Print the contents of the Global Routing Link State Advertisement and any Global Routing Link Records present in the list.
void SetAdvertisingRouter (IpAddress rtr)
 Set the Advertising Router as defined by the OSPF spec.
void SetLinkStateId (IpAddress addr)
 Set the Link State ID is defined by the OSPF spec.
void SetLSType (LSType typ)
 Set the LS type field of the LSA.
void SetNetworkLSANetworkMask (IpMaskOrPrefix mask)
 For a Network LSA, set the Network Mask field that precedes the list of attached routers.
void SetNode (Ptr< Node > node)
 Set the Node pointer of the node that originated this LSA.
void SetStatus (SPFStatus status)
 Set the SPF status of the advertisement.

Private Types

using Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
 Alias for Ipv4 and Ipv6 classes.
using IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
 Alias for Ipv4Address and Ipv6Address classes.
using IpHeader = typename std::conditional_t<IsIpv4, Ipv4Header, Ipv6Header>
 Alias for Ipv4Header and Ipv6Header classes.
using IpInterfaceAddress
 Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.
using IpMaskOrPrefix = typename std::conditional_t<IsIpv4, Ipv4Mask, Ipv6Prefix>
 Alias for Ipv4Mask And Ipv6Prefix.
using IpRoute = typename std::conditional_t<IsIpv4, Ipv4Route, Ipv6Route>
 Alias for Ipv4Route and Ipv6Route classes.
using IpRoutingTableEntry
 Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes.
typedef std::list< IpAddressListOfAttachedRouters_t
 A convenience typedef to avoid too much writers cramp.
typedef std::list< GlobalRoutingLinkRecord< T > * > ListOfLinkRecords_t
 A convenience typedef to avoid too much writers cramp.

Private Attributes

IpAddress m_advertisingRtr
 The Advertising Router is defined by the OSPF spec.
ListOfAttachedRouters_t m_attachedRouters
 Each Network LSA contains a list of attached routers.
ListOfLinkRecords_t m_linkRecords
 Each Link State Advertisement contains a number of Link Records that describe the kinds of links that are attached to a given node.
IpAddress m_linkStateId
 The Link State ID is defined by the OSPF spec.
LSType m_lsType
 The type of the LSA.
IpMaskOrPrefix m_networkLSANetworkMask
 Each Network LSA contains the network mask of the attached network.
uint32_t m_node_id
 node ID
SPFStatus m_status
 This is a tristate flag used internally in the SPF computation to mark if an SPFVertex (a data structure representing a vertex in the SPF tree – a router) is new, is a candidate for a shortest path, or is in its proper position in the tree.

Static Private Attributes

static constexpr bool IsIpv4 = std::is_same_v<Ipv4Manager, T>
 Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.

Detailed Description

template<typename T>
class ns3::GlobalRoutingLSA< T >

a Link State Advertisement (LSA) for a router, used in global routing.

Roughly equivalent to a global incarnation of the OSPF link state header combined with a list of Link Records. Since it's global, there's no need for age or sequence number. See RFC 2328, Appendix A.

Definition at line 336 of file global-router-interface.h.

Member Typedef Documentation

◆ Ip

template<typename T>
using ns3::GlobalRoutingLSA< T >::Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
private

Alias for Ipv4 and Ipv6 classes.

Definition at line 344 of file global-router-interface.h.

◆ IpAddress

template<typename T>
using ns3::GlobalRoutingLSA< T >::IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
private

Alias for Ipv4Address and Ipv6Address classes.

Definition at line 347 of file global-router-interface.h.

◆ IpHeader

template<typename T>
using ns3::GlobalRoutingLSA< T >::IpHeader = typename std::conditional_t<IsIpv4, Ipv4Header, Ipv6Header>
private

Alias for Ipv4Header and Ipv6Header classes.

Definition at line 353 of file global-router-interface.h.

◆ IpInterfaceAddress

template<typename T>
using ns3::GlobalRoutingLSA< T >::IpInterfaceAddress
private
Initial value:
typename std::conditional_t<IsIpv4, Ipv4InterfaceAddress, Ipv6InterfaceAddress>

Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.

Definition at line 356 of file global-router-interface.h.

◆ IpMaskOrPrefix

template<typename T>
using ns3::GlobalRoutingLSA< T >::IpMaskOrPrefix = typename std::conditional_t<IsIpv4, Ipv4Mask, Ipv6Prefix>
private

Alias for Ipv4Mask And Ipv6Prefix.

Definition at line 364 of file global-router-interface.h.

◆ IpRoute

template<typename T>
using ns3::GlobalRoutingLSA< T >::IpRoute = typename std::conditional_t<IsIpv4, Ipv4Route, Ipv6Route>
private

Alias for Ipv4Route and Ipv6Route classes.

Definition at line 350 of file global-router-interface.h.

◆ IpRoutingTableEntry

template<typename T>
using ns3::GlobalRoutingLSA< T >::IpRoutingTableEntry
private
Initial value:
typename std::conditional_t<IsIpv4, Ipv4RoutingTableEntry, Ipv6RoutingTableEntry>

Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes.

Definition at line 360 of file global-router-interface.h.

◆ ListOfAttachedRouters_t

template<typename T>
typedef std::list<IpAddress> ns3::GlobalRoutingLSA< T >::ListOfAttachedRouters_t
private

A convenience typedef to avoid too much writers cramp.

Definition at line 663 of file global-router-interface.h.

◆ ListOfLinkRecords_t

template<typename T>
typedef std::list<GlobalRoutingLinkRecord<T>*> ns3::GlobalRoutingLSA< T >::ListOfLinkRecords_t
private

A convenience typedef to avoid too much writers cramp.

Definition at line 641 of file global-router-interface.h.

Member Enumeration Documentation

◆ LSType

template<typename T>
enum ns3::GlobalRoutingLSA::LSType

corresponds to LS type field of RFC 2328 OSPF LSA header

Enumerator
Unknown 

Uninitialized Type.

RouterLSA 
NetworkLSA 
SummaryLSA 
SummaryLSA_ASBR 
ASExternalLSAs 

Definition at line 371 of file global-router-interface.h.

◆ SPFStatus

template<typename T>
enum ns3::GlobalRoutingLSA::SPFStatus

Enumeration of the possible values of the status flag in the Routing Link State Advertisements.

Enumerator
LSA_SPF_NOT_EXPLORED 

New vertex not yet considered.

LSA_SPF_CANDIDATE 

Vertex is in the SPF candidate queue.

LSA_SPF_IN_SPFTREE 

Vertex is in the SPF tree.

Definition at line 386 of file global-router-interface.h.

Constructor & Destructor Documentation

◆ GlobalRoutingLSA() [1/3]

template<typename T>
ns3::GlobalRoutingLSA< T >::GlobalRoutingLSA ( )

Create a blank Global Routing Link State Advertisement.

On completion Ipv4Address variables initialized to 0.0.0.0 and the list of Link State Records is empty.

Definition at line 171 of file global-router-interface.cc.

References GlobalRoutingLSA(), m_linkStateId, m_lsType, and Unknown.

Referenced by GlobalRoutingLSA(), GlobalRoutingLSA(), CopyLinkRecords(), and operator=().

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

◆ GlobalRoutingLSA() [2/3]

template<typename T>
ns3::GlobalRoutingLSA< T >::GlobalRoutingLSA ( GlobalRoutingLSA< T >::SPFStatus status,
IpAddress linkStateId,
IpAddress advertisingRtr )

Create an initialized Global Routing Link State Advertisement.

On completion the list of Link State Records is empty.

Parameters
statusThe status to of the new LSA.
linkStateIdThe Ipv4Address for the link state ID field.
advertisingRtrThe Ipv4Address for the advertising router field.

Definition at line 185 of file global-router-interface.cc.

◆ GlobalRoutingLSA() [3/3]

template<typename T>
ns3::GlobalRoutingLSA< T >::GlobalRoutingLSA ( GlobalRoutingLSA< T > & lsa)

Copy constructor for a Global Routing Link State Advertisement.

Takes a piece of memory and constructs a semantically identical copy of the given LSA.

Parameters
lsaThe existing LSA to be used as the source.

Definition at line 201 of file global-router-interface.cc.

References GlobalRoutingLSA(), IsEmpty(), m_advertisingRtr, m_linkStateId, m_lsType, m_networkLSANetworkMask, m_node_id, m_status, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ ~GlobalRoutingLSA()

template<typename T>
ns3::GlobalRoutingLSA< T >::~GlobalRoutingLSA ( )

Destroy an existing Global Routing Link State Advertisement.

Any Global Routing Link Records present in the list are freed.

Definition at line 254 of file global-router-interface.cc.

References ClearLinkRecords(), and NS_LOG_FUNCTION.

Here is the call graph for this function:

Member Function Documentation

◆ AddAttachedRouter()

template<typename T>
uint32_t ns3::GlobalRoutingLSA< T >::AddAttachedRouter ( IpAddress addr)

Add an attached router to the list in the NetworkLSA.

Parameters
addrThe Ipv4Address of the interface on the network link
Returns
The number of addresses in the list.

Definition at line 395 of file global-router-interface.cc.

References m_attachedRouters, and NS_LOG_FUNCTION.

◆ AddLinkRecord()

template<typename T>
uint32_t ns3::GlobalRoutingLSA< T >::AddLinkRecord ( GlobalRoutingLinkRecord< T > * lr)

Add a given Global Routing Link Record to the LSA.

Parameters
lrThe Global Routing Link Record to be added.
Returns
The number of link records in the list.

Definition at line 281 of file global-router-interface.cc.

References m_linkRecords, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouter< T >::ProcessBridgedBroadcastLink(), ns3::GlobalRouter< T >::ProcessPointToPointLink(), and ns3::GlobalRouter< T >::ProcessSingleBroadcastLink().

Here is the caller graph for this function:

◆ ClearLinkRecords()

template<typename T>
void ns3::GlobalRoutingLSA< T >::ClearLinkRecords ( )

Release all of the Global Routing Link Records present in the Global Routing Link State Advertisement and make the list of link records empty.

Definition at line 262 of file global-router-interface.cc.

References m_linkRecords, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by ~GlobalRoutingLSA().

Here is the caller graph for this function:

◆ CopyLinkRecords()

template<typename T>
void ns3::GlobalRoutingLSA< T >::CopyLinkRecords ( const GlobalRoutingLSA< T > & lsa)

Copy any Global Routing Link Records in a given Global Routing Link State Advertisement to the current LSA.

Existing Link Records are not deleted – this is a concatenation of Link Records.

See also
ClearLinkRecords ()
Parameters
lsaThe LSA to copy the Link Records from.

Definition at line 232 of file global-router-interface.cc.

References GlobalRoutingLSA(), and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ GetAdvertisingRouter()

template<typename T>
GlobalRoutingLSA< T >::IpAddress ns3::GlobalRoutingLSA< T >::GetAdvertisingRouter ( ) const

Get the Advertising Router as defined by the OSPF spec.

We always set it to the router ID of the router making the advertisement.

See also
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()
Returns
The Ipv4Address stored as the advertising router.

Definition at line 355 of file global-router-interface.cc.

References m_advertisingRtr, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl< T >::ProcessASExternals(), and ns3::GlobalRouteManagerImpl< T >::SPFAddASExternal().

Here is the caller graph for this function:

◆ GetAttachedRouter()

template<typename T>
GlobalRoutingLSA< T >::IpAddress ns3::GlobalRoutingLSA< T >::GetAttachedRouter ( uint32_t n) const

Return an Ipv4Address corresponding to the specified attached router.

Parameters
nThe attached router number desired (number in the list).
Returns
The Ipv4Address of the requested router

Definition at line 412 of file global-router-interface.cc.

References m_attachedRouters, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ GetLinkRecord()

template<typename T>
GlobalRoutingLinkRecord< T > * ns3::GlobalRoutingLSA< T >::GetLinkRecord ( uint32_t n) const

Return a pointer to the specified Global Routing Link Record.

Parameters
nThe LSA number desired.
Returns
The number of link records in the list.

Definition at line 298 of file global-router-interface.cc.

References m_linkRecords, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl< T >::CheckForStubNode(), ns3::GlobalRouteManagerLSDB< T >::GetLSAByLinkData(), and ns3::GlobalRouteManagerImpl< T >::SPFIntraAddRouter().

Here is the caller graph for this function:

◆ GetLinkStateId()

template<typename T>
GlobalRoutingLSA< T >::IpAddress ns3::GlobalRoutingLSA< T >::GetLinkStateId ( ) const

Get the Link State ID as defined by the OSPF spec.

We always set it to the router ID of the router making the advertisement.

See also
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()
Returns
The Ipv4Address stored as the link state ID.

Definition at line 339 of file global-router-interface.cc.

References m_linkStateId, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl< T >::CheckForStubNode(), ns3::GlobalRouteManagerImpl< T >::ProcessASExternals(), ns3::GlobalRouteManagerImpl< T >::SPFAddASExternal(), ns3::GlobalRouteManagerImpl< T >::SPFCalculate(), ns3::GlobalRouteManagerImpl< T >::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl< T >::SPFIntraAddTransit(), ns3::GlobalRouteManagerImpl< T >::SPFNext(), ns3::GlobalRouteManagerImpl< T >::SPFNexthopCalculation(), and ns3::GlobalRouteManagerImpl< T >::SPFProcessStubs().

Here is the caller graph for this function:

◆ GetLSType()

template<typename T>
GlobalRoutingLSA< T >::LSType ns3::GlobalRoutingLSA< T >::GetLSType ( ) const

Return the LSType field of the LSA.

Returns
The LS Type.

Definition at line 323 of file global-router-interface.cc.

References m_lsType, and NS_LOG_FUNCTION.

Referenced by ns3::SPFVertex< T >::SPFVertex(), ns3::GlobalRouteManagerLSDB< T >::Insert(), and ns3::GlobalRouteManagerImpl< T >::SPFNexthopCalculation().

Here is the caller graph for this function:

◆ GetNAttachedRouters()

template<typename T>
uint32_t ns3::GlobalRoutingLSA< T >::GetNAttachedRouters ( ) const

Return the number of attached routers listed in the NetworkLSA.

Returns
The number of attached routers.

Definition at line 404 of file global-router-interface.cc.

References m_attachedRouters, and NS_LOG_FUNCTION.

◆ GetNetworkLSANetworkMask()

template<typename T>
GlobalRoutingLSA< T >::IpMaskOrPrefix ns3::GlobalRoutingLSA< T >::GetNetworkLSANetworkMask ( ) const

For a Network LSA, get the Network Mask field that precedes the list of attached routers.

Returns
the NetworkLSANetworkMask

Definition at line 379 of file global-router-interface.cc.

References m_networkLSANetworkMask, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl< T >::SPFAddASExternal(), ns3::GlobalRouteManagerImpl< T >::SPFIntraAddTransit(), and ns3::GlobalRouteManagerImpl< T >::SPFNexthopCalculation().

Here is the caller graph for this function:

◆ GetNLinkRecords()

template<typename T>
uint32_t ns3::GlobalRoutingLSA< T >::GetNLinkRecords ( ) const

Return the number of Global Routing Link Records in the LSA.

Returns
The number of link records in the list.

Definition at line 290 of file global-router-interface.cc.

References m_linkRecords, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl< T >::CheckForStubNode(), ns3::GlobalRouteManagerLSDB< T >::GetLSAByLinkData(), ns3::GlobalRouteManagerImpl< T >::SPFIntraAddRouter(), and ns3::GlobalRouteManagerImpl< T >::SPFProcessStubs().

Here is the caller graph for this function:

◆ GetNode()

template<typename T>
Ptr< Node > ns3::GlobalRoutingLSA< T >::GetNode ( ) const

Get the Node pointer of the node that originated this LSA.

Returns
Node pointer

Definition at line 437 of file global-router-interface.cc.

References ns3::NodeList::GetNode(), m_node_id, and NS_LOG_FUNCTION.

Referenced by ns3::SPFVertex< T >::SPFVertex(), and ns3::GlobalRouteManagerImpl< T >::CheckForStubNode().

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

◆ GetStatus()

template<typename T>
GlobalRoutingLSA< T >::SPFStatus ns3::GlobalRoutingLSA< T >::GetStatus ( ) const

Get the SPF status of the advertisement.

See also
SPFStatus
Returns
The SPFStatus of the LSA.

Definition at line 387 of file global-router-interface.cc.

References m_status, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl< T >::SPFNext().

Here is the caller graph for this function:

◆ IsEmpty()

template<typename T>
bool ns3::GlobalRoutingLSA< T >::IsEmpty ( ) const

Check to see if the list of Global Routing Link Records present in the Global Routing Link State Advertisement is empty.

Returns
True if the list is empty, false otherwise.

Definition at line 315 of file global-router-interface.cc.

References m_linkRecords, and NS_LOG_FUNCTION.

Referenced by GlobalRoutingLSA(), and ns3::GlobalRouter< T >::GetLSA().

Here is the caller graph for this function:

◆ operator=()

template<typename T>
GlobalRoutingLSA< T > & ns3::GlobalRoutingLSA< T >::operator= ( const GlobalRoutingLSA< T > & lsa)

Assignment operator for a Global Routing Link State Advertisement.

Takes an existing Global Routing Link State Advertisement and overwrites it to make a semantically identical copy of a given prototype LSA.

If there are any Global Routing Link Records present in the existing LSA, they are freed before the assignment happens.

Parameters
lsaThe existing LSA to be used as the source.
Returns
Reference to the overwritten LSA.

Definition at line 216 of file global-router-interface.cc.

References GlobalRoutingLSA(), m_advertisingRtr, m_linkStateId, m_lsType, and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ Print()

template<typename T>
void ns3::GlobalRoutingLSA< T >::Print ( std::ostream & os) const

Print the contents of the Global Routing Link State Advertisement and any Global Routing Link Records present in the list.

Quite verbose.

Parameters
osthe output stream

Definition at line 453 of file global-router-interface.cc.

Referenced by ns3::GlobalRoutingLSA< ns3::Ipv4Manager >::SetAdvertisingRouter().

Here is the caller graph for this function:

◆ SetAdvertisingRouter()

template<typename T>
void ns3::GlobalRoutingLSA< T >::SetAdvertisingRouter ( IpAddress rtr)

Set the Advertising Router as defined by the OSPF spec.

We always set it to the router ID of the router making the advertisement.

Parameters
rtrID of the router making advertisement
See also
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

Definition at line 363 of file global-router-interface.cc.

References m_advertisingRtr, and NS_LOG_FUNCTION.

◆ SetLinkStateId()

template<typename T>
void ns3::GlobalRoutingLSA< T >::SetLinkStateId ( IpAddress addr)

Set the Link State ID is defined by the OSPF spec.

We always set it to the router ID of the router making the advertisement.

Parameters
addrIPv4 address which will act as ID
See also
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

Definition at line 347 of file global-router-interface.cc.

References m_linkStateId, and NS_LOG_FUNCTION.

◆ SetLSType()

template<typename T>
void ns3::GlobalRoutingLSA< T >::SetLSType ( GlobalRoutingLSA< T >::LSType typ)

Set the LS type field of the LSA.

Parameters
typthe LS Type.

Definition at line 331 of file global-router-interface.cc.

References m_lsType, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouter< T >::DiscoverLSAs().

Here is the caller graph for this function:

◆ SetNetworkLSANetworkMask()

template<typename T>
void ns3::GlobalRoutingLSA< T >::SetNetworkLSANetworkMask ( IpMaskOrPrefix mask)

For a Network LSA, set the Network Mask field that precedes the list of attached routers.

Parameters
maskthe Network Mask field.

Definition at line 371 of file global-router-interface.cc.

References m_networkLSANetworkMask, and NS_LOG_FUNCTION.

◆ SetNode()

template<typename T>
void ns3::GlobalRoutingLSA< T >::SetNode ( Ptr< Node > node)

Set the Node pointer of the node that originated this LSA.

Parameters
nodeNode pointer

Definition at line 445 of file global-router-interface.cc.

References m_node_id, and NS_LOG_FUNCTION.

◆ SetStatus()

template<typename T>
void ns3::GlobalRoutingLSA< T >::SetStatus ( GlobalRoutingLSA< T >::SPFStatus status)

Set the SPF status of the advertisement.

Parameters
statusSPF status to set
See also
SPFStatus

Definition at line 429 of file global-router-interface.cc.

References m_status, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerLSDB< T >::Initialize(), and ns3::GlobalRouteManagerImpl< T >::SPFNext().

Here is the caller graph for this function:

Member Data Documentation

◆ IsIpv4

template<typename T>
bool ns3::GlobalRoutingLSA< T >::IsIpv4 = std::is_same_v<Ipv4Manager, T>
staticconstexprprivate

Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.

Definition at line 341 of file global-router-interface.h.

◆ m_advertisingRtr

template<typename T>
IpAddress ns3::GlobalRoutingLSA< T >::m_advertisingRtr
private

The Advertising Router is defined by the OSPF spec.

We always set it to the router ID of the router making the advertisement.

See also
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

Definition at line 636 of file global-router-interface.h.

Referenced by GlobalRoutingLSA(), GetAdvertisingRouter(), operator=(), and SetAdvertisingRouter().

◆ m_attachedRouters

template<typename T>
ListOfAttachedRouters_t ns3::GlobalRoutingLSA< T >::m_attachedRouters
private

Each Network LSA contains a list of attached routers.

m_attachedRouters is an STL list container to hold the addresses that have been discovered and prepared for the advertisement.

See also
GlobalRouting::DiscoverLSAs ()

Definition at line 673 of file global-router-interface.h.

Referenced by AddAttachedRouter(), GetAttachedRouter(), and GetNAttachedRouters().

◆ m_linkRecords

template<typename T>
ListOfLinkRecords_t ns3::GlobalRoutingLSA< T >::m_linkRecords
private

Each Link State Advertisement contains a number of Link Records that describe the kinds of links that are attached to a given node.

We consider PointToPoint and StubNetwork links.

m_linkRecords is an STL list container to hold the Link Records that have been discovered and prepared for the advertisement.

See also
GlobalRouting::DiscoverLSAs ()

Definition at line 653 of file global-router-interface.h.

Referenced by AddLinkRecord(), ClearLinkRecords(), GetLinkRecord(), GetNLinkRecords(), and IsEmpty().

◆ m_linkStateId

template<typename T>
IpAddress ns3::GlobalRoutingLSA< T >::m_linkStateId
private

The Link State ID is defined by the OSPF spec.

We always set it to the router ID of the router making the advertisement.

See also
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

Definition at line 627 of file global-router-interface.h.

Referenced by GlobalRoutingLSA(), GlobalRoutingLSA(), GetLinkStateId(), operator=(), and SetLinkStateId().

◆ m_lsType

template<typename T>
LSType ns3::GlobalRoutingLSA< T >::m_lsType
private

The type of the LSA.

Each LSA type has a separate advertisement format.

Definition at line 619 of file global-router-interface.h.

Referenced by GlobalRoutingLSA(), GlobalRoutingLSA(), GetLSType(), operator=(), and SetLSType().

◆ m_networkLSANetworkMask

template<typename T>
IpMaskOrPrefix ns3::GlobalRoutingLSA< T >::m_networkLSANetworkMask
private

Each Network LSA contains the network mask of the attached network.

Definition at line 658 of file global-router-interface.h.

Referenced by GlobalRoutingLSA(), GetNetworkLSANetworkMask(), and SetNetworkLSANetworkMask().

◆ m_node_id

template<typename T>
uint32_t ns3::GlobalRoutingLSA< T >::m_node_id
private

node ID

Definition at line 682 of file global-router-interface.h.

Referenced by GlobalRoutingLSA(), GetNode(), and SetNode().

◆ m_status

template<typename T>
SPFStatus ns3::GlobalRoutingLSA< T >::m_status
private

This is a tristate flag used internally in the SPF computation to mark if an SPFVertex (a data structure representing a vertex in the SPF tree – a router) is new, is a candidate for a shortest path, or is in its proper position in the tree.

Definition at line 681 of file global-router-interface.h.

Referenced by GlobalRoutingLSA(), GetStatus(), and SetStatus().


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