22 #ifndef GLOBAL_ROUTE_MANAGER_IMPL_H
23 #define GLOBAL_ROUTE_MANAGER_IMPL_H
30 #include "ns3/object.h"
32 #include "ns3/ipv4-address.h"
33 #include "global-router-interface.h"
37 const uint32_t SPF_INFINITY = 0xffffffff;
40 class Ipv4GlobalRouting;
301 typedef std::pair<Ipv4Address, int32_t> NodeExit_t;
535 void ClearVertexProcessed (
void);
541 uint32_t m_distanceFromRoot;
544 typedef std::list< NodeExit_t > ListOfNodeExit_t;
547 typedef std::list<SPFVertex*> ListOfSPFVertex_t;
548 ListOfSPFVertex_t m_parents;
549 ListOfSPFVertex_t m_children;
550 bool m_vertexProcessed;
566 friend std::ostream& operator<< (std::ostream& os,
const SPFVertex::ListOfSPFVertex_t& vs);
666 uint32_t GetNumExtLSAs ()
const;
670 typedef std::map<Ipv4Address, GlobalRoutingLSA*> LSDBMap_t;
671 typedef std::pair<Ipv4Address, GlobalRoutingLSA*> LSDBPair_t;
673 LSDBMap_t m_database;
674 std::vector<GlobalRoutingLSA*> m_extdatabase;
GlobalRoutingLSA * 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.
virtual void DeleteGlobalRoutes()
Delete all static routes on all nodes that have a GlobalRouterInterface.
void SetParent(SPFVertex *parent)
Set the pointer to the SPFVector that is the parent of "this" SPFVertex.
a class to represent an Ipv4 address mask
~SPFVertex()
Destroy an SPFVertex (Shortest Path First Vertex).
void InheritAllRootExitDirections(const SPFVertex *vertex)
Inherit all root exit directions from a given vertex to 'this' vertex.
void MergeParent(const SPFVertex *v)
Merge the Parent list from the v into this vertex.
Vertex used in shortest path first (SPF) computations. See RFC 2328, Section 16.
SPFVertex()
Construct an empty ("uninitialized") SPFVertex (Shortest Path First Vertex).
void SetDistanceFromRoot(uint32_t distance)
Set the distance from the root vertex to "this" SPFVertex object.
A global router implementation.
ListOfNodeExit_t m_ecmpRootExits
store the multiple root's exits for supporting ECMP
A single link record for a link state advertisement.
A Candidate Queue used in static routing.
a Link State Advertisement (LSA) for a router, used in global routing.
uint32_t GetNChildren(void) const
Get the number of children of "this" SPFVertex.
void Initialize()
Set all LSA flags to an initialized state, for SPF computation.
~GlobalRouteManagerLSDB()
Destroy an empty Global Router Manager Link State Database.
GlobalRouteManagerLSDB & operator=(GlobalRouteManagerLSDB &lsdb)
The SPFVertex copy assignment operator is disallowed. There's no need for it and a compiler provided ...
void DebugSPFCalculate(Ipv4Address root)
Debugging routine; call the core SPF from the unit tests.
uint32_t GetDistanceFromRoot(void) const
Get the distance from the root vertex to "this" SPFVertex object.
SPFVertex & operator=(SPFVertex &v)
The SPFVertex copy assignment operator is disallowed. There's no need for it and a compiler provided ...
virtual void InitializeRoutes()
Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
GlobalRoutingLSA * GetLSA(void) const
Get the Global Router Link State Advertisement returned by the Global Router represented by this SPFV...
void SetVertexType(VertexType type)
Set the Vertex Type field of a SPFVertex object.
void DebugUseLsdb(GlobalRouteManagerLSDB *)
Debugging routine; allow client code to supply a pre-built LSDB.
void SetLSA(GlobalRoutingLSA *lsa)
Set the Global Router Link State Advertisement returned by the Global Router represented by this SPFV...
void SetRootExitDirection(Ipv4Address nextHop, int32_t id=SPF_INFINITY)
Set the IP address and outgoing interface index that should be used to begin forwarding packets from ...
void SetVertexId(Ipv4Address id)
Set the Vertex ID field of a SPFVertex object.
GlobalRoutingLSA * GetLSA(Ipv4Address addr) const
Look up the Link State Advertisement associated with the given link state ID (address).
void Insert(Ipv4Address addr, GlobalRoutingLSA *lsa)
Insert an IP address / Link State Advertisement pair into the Link State Database.
void MergeRootExitDirections(const SPFVertex *vertex)
Merge into 'this' vertex the list of exit directions from another vertex.
uint32_t GetNRootExitDirections() const
Get the number of exit directions from root for reaching 'this' vertex.
Ipv4 addresses are stored in host order in this class.
SPFVertex * GetParent(uint32_t i=0) const
Get a pointer to the SPFVector that is the parent of "this" SPFVertex.
NodeExit_t GetRootExitDirection() const
Obtain a pair indicating the exit direction from the root.
VertexType GetVertexType(void) const
Get the Vertex Type field of a SPFVertex object.
The Link State DataBase (LSDB) of the Global Route Manager.
void SetVertexProcessed(bool value)
Set the value of the VertexProcessed flag.
VertexType
Enumeration of the possible types of SPFVertex objects.
virtual void BuildGlobalRoutingDatabase()
Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRo...
GlobalRouteManagerLSDB()
Construct an empty Global Router Manager Link State Database.
bool IsVertexProcessed(void) const
Check the value of the VertexProcessed flag.
Ipv4Address GetVertexId(void) const
Get the Vertex ID field of a SPFVertex object.
GlobalRouteManagerImpl & operator=(GlobalRouteManagerImpl &srmi)
Global Route Manager Implementation assignment operator is disallowed. There's no need for it and a c...
SPFVertex * GetChild(uint32_t n) const
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.
uint32_t AddChild(SPFVertex *child)
Get a borrowed SPFVertex pointer to the specified child of "this" SPFVertex.