26 #include "ns3/global-route-manager-impl.h" 27 #include "ns3/candidate-queue.h" 28 #include "ns3/simulator.h" 49 virtual void DoRun (
void);
53 :
TestCase (
"GlobalRouteManagerImplTestCase")
61 for (
int i = 0; i < 100; ++i)
68 for (
int i = 0; i < 100; ++i)
92 GlobalRoutingLinkRecord::PointToPoint,
98 GlobalRoutingLinkRecord::StubNetwork,
104 lsa0->
SetLSType (GlobalRoutingLSA::RouterLSA);
112 GlobalRoutingLinkRecord::PointToPoint,
118 GlobalRoutingLinkRecord::StubNetwork,
124 lsa1->
SetLSType (GlobalRoutingLSA::RouterLSA);
132 GlobalRoutingLinkRecord::PointToPoint,
138 GlobalRoutingLinkRecord::StubNetwork,
144 GlobalRoutingLinkRecord::PointToPoint,
150 GlobalRoutingLinkRecord::StubNetwork,
156 GlobalRoutingLinkRecord::PointToPoint,
162 GlobalRoutingLinkRecord::StubNetwork,
168 lsa2->
SetLSType (GlobalRoutingLSA::RouterLSA);
180 GlobalRoutingLinkRecord::PointToPoint,
186 GlobalRoutingLinkRecord::StubNetwork,
192 lsa3->
SetLSType (GlobalRoutingLSA::RouterLSA);
217 Simulator::Destroy ();
243 :
TestSuite (
"global-route-manager-impl", UNIT)
GlobalRoutingLSA * GetLSA(Ipv4Address addr) const
Look up the Link State Advertisement associated with the given link state ID (address).
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.
void SetDistanceFromRoot(uint32_t distance)
Set the distance from the root vertex to "this" SPFVertex object.
A global router implementation.
Global Route Manager TestSuite.
A single link record for a link state advertisement.
A Candidate Queue used in routing calculations.
a Link State Advertisement (LSA) for a router, used in global routing.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
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.
void Insert(Ipv4Address addr, GlobalRoutingLSA *lsa)
Insert an IP address / Link State Advertisement pair into the Link State Database.
Global Route Manager Test.
virtual void DoRun(void)
Implementation to actually run this TestCase.
GlobalRouteManagerImplTestCase()
static GlobalRouteManagerImplTestSuite g_globalRoutingManagerImplTestSuite
Static variable for test initialization.
The Link State DataBase (LSDB) of the Global Route Manager.
Ipv4Address GetLinkStateId(void) const
Get the Link State ID as defined by the OSPF spec.
void SetLinkStateId(Ipv4Address addr)
Set the Link State ID is defined by the OSPF spec.