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

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

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

Public Member Functions

 GlobalRouteManagerLSDB ()
 Construct an empty Global Router Manager Link State Database. More...
 
 ~GlobalRouteManagerLSDB ()
 Destroy an empty Global Router Manager Link State Database. More...
 
GlobalRoutingLSAGetExtLSA (uint32_t index) const
 
GlobalRoutingLSAGetLSA (Ipv4Address addr) const
 Look up the Link State Advertisement associated with the given link state ID (address). More...
 
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. More...
 
uint32_t GetNumExtLSAs () const
 
void Initialize ()
 Set all LSA flags to an initialized state, for SPF computation. More...
 
void Insert (Ipv4Address addr, GlobalRoutingLSA *lsa)
 Insert an IP address / Link State Advertisement pair into the Link State Database. More...
 

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.

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 416 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION.

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 424 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Member Function Documentation

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 485 of file global-route-manager-impl.cc.

References NS_LOG_FUNCTION.

Referenced by GlobalRouteManagerImplTestCase::DoRun().

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 503 of file global-route-manager-impl.cc.

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

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 445 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, NS_LOG_FUNCTION, and ns3::GlobalRoutingLSA::SetStatus().

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 457 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA::GetLSType(), and NS_LOG_FUNCTION.

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


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