A Discrete-Event Network Simulator Home Tutorials  ▼ Docs    ▼ Develop ▼ API
ns3::GlobalRoutingLSA Class Reference

#include "global-router-interface.h"

Collaboration diagram for ns3::GlobalRoutingLSA:

## 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 }

## Public Member Functions

GlobalRoutingLSA ()

GlobalRoutingLSA (GlobalRoutingLSA &lsa)

~GlobalRoutingLSA ()

Add an attached router to the list in the NetworkLSA. More...

Get the Advertising Router as defined by the OSPF spec. More...

Return an Ipv4Address corresponding to the specified attached router. More...

Return a pointer to the specified Global Routing Link Record. More...

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

LSType GetLSType (void) const
Return the LSType field of the LSA. More...

uint32_t GetNAttachedRouters (void) const
Return the number of attached routers listed in the NetworkLSA. More...

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

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

Ptr< NodeGetNode (void) const
Get the Node pointer of the node that originated this LSA. More...

SPFStatus GetStatus (void) const

bool IsEmpty (void) const

GlobalRoutingLSAoperator= (const GlobalRoutingLSA &lsa)

void Print (std::ostream &os) const

Set the Advertising Router as defined by the OSPF spec. More...

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

void SetLSType (LSType typ)
Set the LS type field of the LSA. More...

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

void SetNode (Ptr< Node > node)
Set the Node pointer of the node that originated this LSA. More...

void SetStatus (SPFStatus status)

## Private Types

A convenience typedef to avoid too much writers cramp. More...

A convenience typedef to avoid too much writers cramp. More...

## Private Attributes

The Advertising Router is defined by the OSPF spec. More...

ListOfAttachedRouters_t m_attachedRouters
Each Network LSA contains a list of attached routers. More...

The Link State ID is defined by the OSPF spec. More...

LSType m_lsType
The type of the LSA. More...

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

uint32_t m_node_id
node ID More...

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. More...

## Detailed Description

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 253 of file global-router-interface.h.

## Member Typedef Documentation

 private

A convenience typedef to avoid too much writers cramp.

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

 private

A convenience typedef to avoid too much writers cramp.

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

## Member Enumeration Documentation

corresponds to LS type field of RFC 2328 OSPF LSA header

Enumerator
Unknown

Uninitialized Type.

RouterLSA
NetworkLSA
SummaryLSA
SummaryLSA_ASBR
ASExternalLSAs

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

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 273 of file global-router-interface.h.

## Constructor & Destructor Documentation

 ns3::GlobalRoutingLSA::GlobalRoutingLSA ( )

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

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

References NS_LOG_FUNCTION.

On completion the list of Link State Records is empty.

Parameters

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

References NS_LOG_FUNCTION.

 ns3::GlobalRoutingLSA::GlobalRoutingLSA ( GlobalRoutingLSA & lsa )

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

Parameters
 lsa The existing LSA to be used as the source.

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

References CopyLinkRecords(), IsEmpty(), NS_ASSERT_MSG(), and NS_LOG_FUNCTION.

Here is the call graph for this function:

 ns3::GlobalRoutingLSA::~GlobalRoutingLSA ( )

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

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

Here is the call graph for this function:

## Member Function Documentation

Add an attached router to the list in the NetworkLSA.

Parameters
Returns
The number of addresses in the list.

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

References m_attachedRouters, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouter::BuildNetworkLSAs().

Here is the caller graph for this function:

Parameters
Returns
The number of link records in the list.

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

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

 void ns3::GlobalRoutingLSA::CopyLinkRecords ( const GlobalRoutingLSA & lsa )

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

Parameters
 lsa The LSA to copy the Link Records from.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

Get the Advertising Router as defined by the OSPF spec.

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

RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()
Returns

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

Here is the caller graph for this function:

 Ipv4Address ns3::GlobalRoutingLSA::GetAttachedRouter ( uint32_t n ) const

Return an Ipv4Address corresponding to the specified attached router.

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

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

References m_attachedRouters, NS_ASSERT_MSG(), and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFNext().

Here is the call graph for this function:

Here is the caller graph for this function:

Return a pointer to the specified Global Routing Link Record.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()
Returns

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

Here is the caller graph for this function:

 GlobalRoutingLSA::LSType ns3::GlobalRoutingLSA::GetLSType ( void ) const

Return the LSType field of the LSA.

Returns
The LS Type.

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

References m_lsType, and NS_LOG_FUNCTION.

Here is the caller graph for this function:

 uint32_t ns3::GlobalRoutingLSA::GetNAttachedRouters ( void ) const

Return the number of attached routers listed in the NetworkLSA.

Returns
The number of attached routers.

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

References m_attachedRouters, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFNext().

Here is the caller graph for this function:

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

Returns

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

Here is the caller graph for this function:

 uint32_t ns3::GlobalRoutingLSA::GetNLinkRecords ( void ) const

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

Returns
The number of link records in the list.

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

Here is the caller graph for this function:

 Ptr< Node > ns3::GlobalRoutingLSA::GetNode ( void ) const

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

Returns
Node pointer

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

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

Referenced by ns3::GlobalRouteManagerImpl::CheckForStubNode().

Here is the call graph for this function:

Here is the caller graph for this function:

 GlobalRoutingLSA::SPFStatus ns3::GlobalRoutingLSA::GetStatus ( void ) const

SPFStatus
Returns
The SPFStatus of the LSA.

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

References m_status, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::SPFNext().

Here is the caller graph for this function:

 bool ns3::GlobalRoutingLSA::IsEmpty ( void ) const

Returns
True if the list is empty, false otherwise.

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

Referenced by ns3::GlobalRouter::BuildNetworkLSAs(), and GlobalRoutingLSA().

Here is the caller graph for this function:

 GlobalRoutingLSA & ns3::GlobalRoutingLSA::operator= ( const GlobalRoutingLSA & lsa )

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
 lsa The existing LSA to be used as the source.
Returns
Reference to the overwritten LSA.

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

Here is the call graph for this function:

 void ns3::GlobalRoutingLSA::Print ( std::ostream & os ) const

Quite verbose.

Parameters
 os the output stream

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

Referenced by ns3::operator<<().

Here is the call graph for this function:

Here is the caller graph for this function:

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
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

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

Here is the caller graph for this function:

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
RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

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

Here is the caller graph for this function:

 void ns3::GlobalRoutingLSA::SetLSType ( GlobalRoutingLSA::LSType typ )

Set the LS type field of the LSA.

Parameters
 typ the LS Type.

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

References m_lsType, and NS_LOG_FUNCTION.

Here is the caller graph for this function:

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

Parameters

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

Referenced by ns3::GlobalRouter::BuildNetworkLSAs(), and ns3::GlobalRouter::DiscoverLSAs().

Here is the caller graph for this function:

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

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

Parameters
 node Node pointer

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

References ns3::Node::GetId(), m_node_id, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouter::BuildNetworkLSAs(), and ns3::GlobalRouter::DiscoverLSAs().

Here is the call graph for this function:

Here is the caller graph for this function:

 void ns3::GlobalRoutingLSA::SetStatus ( GlobalRoutingLSA::SPFStatus status )

Parameters
 status SPF status to set
SPFStatus

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

References m_status, and NS_LOG_FUNCTION.

Here is the caller graph for this function:

## Member Data Documentation

private

The Advertising Router is defined by the OSPF spec.

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

RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

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

 ListOfAttachedRouters_t ns3::GlobalRoutingLSA::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.

GlobalRouting::DiscoverLSAs ()

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

private

We consider PointToPoint and StubNetwork links.

GlobalRouting::DiscoverLSAs ()

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

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.

RoutingEnvironment::AllocateRouterId ()
GlobalRouting::GetRouterId ()

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

 LSType ns3::GlobalRoutingLSA::m_lsType
private

The type of the LSA.

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

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

private

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

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

 uint32_t ns3::GlobalRoutingLSA::m_node_id
private

node ID

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

Referenced by GetNode(), operator=(), and SetNode().

 SPFStatus ns3::GlobalRoutingLSA::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 567 of file global-router-interface.h.

Referenced by GetStatus(), operator=(), and SetStatus().

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