A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::GlobalRouteManagerLSDB Class Reference

The Link State DataBase (LSDB) of the Global Route Manager. More...

#include <global-route-manager-impl.h>

+ Collaboration diagram for ns3::GlobalRouteManagerLSDB:

Public Member Functions

 GlobalRouteManagerLSDB ()
 Construct an empty Global Router Manager Link State Database.
 ~GlobalRouteManagerLSDB ()
 Destroy an empty Global Router Manager Link State Database.
GlobalRoutingLSAGetExtLSA (uint32_t index) const
GlobalRoutingLSAGetLSA (Ipv4Address addr) const
 Look up the Link State Advertisement associated with the given link state ID (address).
GlobalRoutingLSAGetLSAByLinkData (Ipv4Address addr) const
 Look up the Link State Advertisement associated with the given link state ID (address). This is a variation of the GetLSA call to allow the LSA to be found by matching addr with the LinkData field of the TransitNetwork link record.
uint32_t GetNumExtLSAs () const
void Initialize ()
 Set all LSA flags to an initialized state, for SPF computation.
void Insert (Ipv4Address addr, GlobalRoutingLSA *lsa)
 Insert an IP address / Link State Advertisement pair into the Link State Database.

Private Types

typedef std::map< Ipv4Address,
GlobalRoutingLSA * > 
LSDBMap_t
typedef std::pair< Ipv4Address,
GlobalRoutingLSA * > 
LSDBPair_t

Private Member Functions

 GlobalRouteManagerLSDB (GlobalRouteManagerLSDB &lsdb)
 GlobalRouteManagerLSDB copy construction is disallowed. There's no need for it and a compiler provided shallow copy would be wrong.
GlobalRouteManagerLSDBoperator= (GlobalRouteManagerLSDB &lsdb)
 The SPFVertex copy assignment operator is disallowed. There's no need for it and a compiler provided shallow copy would be wrong.

Private Attributes

LSDBMap_t m_database
std::vector< GlobalRoutingLSA * > m_extdatabase

Detailed Description

The Link State DataBase (LSDB) of the Global Route Manager.

Each node in the simulation participating in global routing has a GlobalRouter interface. The primary job of this interface is to export Global Router Link State Advertisements (LSAs). These advertisements in turn contain a number of Global Router Link Records that describe the point to point links from the underlying node to other nodes (that will also export their own LSAs.

This class implements a searchable database of LSAs gathered from every router in the simulation.

Definition at line 582 of file global-route-manager-impl.h.

Member Typedef Documentation

Constructor & Destructor Documentation

ns3::GlobalRouteManagerLSDB::GlobalRouteManagerLSDB ( )

Construct an empty Global Router Manager Link State Database.

The database map composing the Link State Database is initialized in this constructor.

Definition at line 413 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION_NOARGS.

ns3::GlobalRouteManagerLSDB::~GlobalRouteManagerLSDB ( )

Destroy an empty Global Router Manager Link State Database.

The database map is walked and all of the Link State Advertisements stored in the database are freed; then the database map itself is clear ()ed to release any remaining resources.

Definition at line 421 of file global-route-manager-impl.cc.

References m_database, m_extdatabase, NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.

ns3::GlobalRouteManagerLSDB::GlobalRouteManagerLSDB ( GlobalRouteManagerLSDB lsdb)
private

GlobalRouteManagerLSDB copy construction is disallowed. There's no need for it and a compiler provided shallow copy would be wrong.

Member Function Documentation

GlobalRoutingLSA * ns3::GlobalRouteManagerLSDB::GetExtLSA ( uint32_t  index) const

Definition at line 468 of file global-route-manager-impl.cc.

References m_extdatabase.

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

+ Here is the caller graph for this function:

GlobalRoutingLSA * ns3::GlobalRouteManagerLSDB::GetLSA ( Ipv4Address  addr) const

Look up the Link State Advertisement associated with the given link state ID (address).

The database map is searched for the given IPV4 address and corresponding GlobalRoutingLSA is returned.

See Also
GlobalRoutingLSA
Ipv4Address
Parameters
addrThe IP address associated with the LSA. Typically the Router ID.
Returns
A pointer to the Link State Advertisement for the router specified by the IP address addr.

Definition at line 480 of file global-route-manager-impl.cc.

References m_database, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::CheckForStubNode(), ns3::GlobalRouteManagerImplTestCase::DoRun(), ns3::GlobalRouteManagerImpl::SPFCalculate(), and ns3::GlobalRouteManagerImpl::SPFNext().

+ Here is the caller graph for this function:

GlobalRoutingLSA * ns3::GlobalRouteManagerLSDB::GetLSAByLinkData ( Ipv4Address  addr) const

Look up the Link State Advertisement associated with the given link state ID (address). This is a variation of the GetLSA call to allow the LSA to be found by matching addr with the LinkData field of the TransitNetwork link record.

See Also
GetLSA
Parameters
addrThe IP address associated with the LSA. Typically the Router
Returns
A pointer to the Link State Advertisement for the router specified by the IP address addr. ID.

Definition at line 498 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLinkRecord::GetLinkData(), ns3::GlobalRoutingLSA::GetLinkRecord(), ns3::GlobalRoutingLinkRecord::GetLinkType(), ns3::GlobalRoutingLSA::GetNLinkRecords(), m_database, NS_LOG_FUNCTION, and ns3::GlobalRoutingLinkRecord::TransitNetwork.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::GlobalRouteManagerLSDB::GetNumExtLSAs ( ) const

Definition at line 474 of file global-route-manager-impl.cc.

References m_extdatabase.

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

+ Here is the caller graph for this function:

void ns3::GlobalRouteManagerLSDB::Initialize ( void  )

Set all LSA flags to an initialized state, for SPF computation.

This function walks the database and resets the status flags of all of the contained Link State Advertisements to LSA_SPF_NOT_EXPLORED. This is done prior to each SPF calculation to reset the state of the SPFVertex structures that will reference the LSAs during the calculation.

See Also
GlobalRoutingLSA
SPFVertex

Definition at line 442 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, m_database, NS_LOG_FUNCTION_NOARGS, and ns3::GlobalRoutingLSA::SetStatus().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::GlobalRouteManagerLSDB::Insert ( Ipv4Address  addr,
GlobalRoutingLSA lsa 
)

Insert an IP address / Link State Advertisement pair into the Link State Database.

The IPV4 address and the GlobalRoutingLSA given as parameters are converted to an STL pair and are inserted into the database map.

See Also
GlobalRoutingLSA
Ipv4Address
Parameters
addrThe IP address associated with the LSA. Typically the Router ID.
lsaA pointer to the Link State Advertisement for the router.

Definition at line 454 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA::ASExternalLSAs, ns3::GlobalRoutingLSA::GetLSType(), m_database, m_extdatabase, and NS_LOG_FUNCTION.

Referenced by ns3::GlobalRouteManagerImpl::BuildGlobalRoutingDatabase(), and ns3::GlobalRouteManagerImplTestCase::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GlobalRouteManagerLSDB& ns3::GlobalRouteManagerLSDB::operator= ( GlobalRouteManagerLSDB lsdb)
private

The SPFVertex copy assignment operator is disallowed. There's no need for it and a compiler provided shallow copy would be wrong.

Member Data Documentation

LSDBMap_t ns3::GlobalRouteManagerLSDB::m_database
private
std::vector<GlobalRoutingLSA*> ns3::GlobalRouteManagerLSDB::m_extdatabase
private

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