26 #include "ns3/global-route-manager-impl.h"
27 #include "ns3/candidate-queue.h"
28 #include "ns3/simulator.h"
37 virtual void DoRun (
void);
41 :
TestCase (
"GlobalRouteManagerImplTestCase")
49 for (
int i = 0; i < 100; ++i)
56 for (
int i = 0; i < 100; ++i)
80 GlobalRoutingLinkRecord::PointToPoint,
86 GlobalRoutingLinkRecord::StubNetwork,
92 lsa0->
SetLSType (GlobalRoutingLSA::RouterLSA);
100 GlobalRoutingLinkRecord::PointToPoint,
106 GlobalRoutingLinkRecord::StubNetwork,
112 lsa1->
SetLSType (GlobalRoutingLSA::RouterLSA);
120 GlobalRoutingLinkRecord::PointToPoint,
126 GlobalRoutingLinkRecord::StubNetwork,
132 GlobalRoutingLinkRecord::PointToPoint,
138 GlobalRoutingLinkRecord::StubNetwork,
144 GlobalRoutingLinkRecord::PointToPoint,
150 GlobalRoutingLinkRecord::StubNetwork,
156 lsa2->
SetLSType (GlobalRoutingLSA::RouterLSA);
168 GlobalRoutingLinkRecord::PointToPoint,
174 GlobalRoutingLinkRecord::StubNetwork,
180 lsa3->
SetLSType (GlobalRoutingLSA::RouterLSA);
205 Simulator::Destroy ();
SPFVertex * Pop(void)
Pop the Shortest Path First Vertex pointer at the top of the queue.
GlobalRouteManagerImplTestSuite()
void SetAdvertisingRouter(Ipv4Address rtr)
Set the Advertising Router as defined by the OSPF spec.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
uint32_t AddLinkRecord(GlobalRoutingLinkRecord *lr)
Add a given Global Routing Link Record to the LSA.
Vertex used in shortest path first (SPF) computations.
This test suite implements a Unit Test.
void SetDistanceFromRoot(uint32_t distance)
Set the distance from the root vertex to "this" SPFVertex object.
A global router implementation.
A single link record for a link state advertisement.
GlobalRouteManagerImplTestSuite g_globalRoutingManagerImplTestSuite
A Candidate Queue used in routing calculations.
a Link State Advertisement (LSA) for a router, used in global routing.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
void DebugSPFCalculate(Ipv4Address root)
Debugging routine; call the core SPF from the unit tests.
void SetLSType(LSType typ)
Set the LS type field of the LSA.
void Push(SPFVertex *vNew)
Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void DebugUseLsdb(GlobalRouteManagerLSDB *)
Debugging routine; allow client code to supply a pre-built LSDB.
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.
virtual void DoRun(void)
Implementation to actually run this TestCase.
GlobalRouteManagerImplTestCase()
The Link State DataBase (LSDB) of the Global Route Manager.
void SetLinkStateId(Ipv4Address addr)
Set the Link State ID is defined by the OSPF spec.
Ipv4Address GetLinkStateId(void) const
Get the Link State ID as defined by the OSPF spec.