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)
Global Route Manager Test.
GlobalRouteManagerImplTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
Global Route Manager TestSuite.
GlobalRouteManagerImplTestSuite()
A Candidate Queue used in routing calculations.
void Push(SPFVertex *vNew)
Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme.
SPFVertex * Pop(void)
Pop the Shortest Path First Vertex pointer at the top of the queue.
A global router implementation.
void DebugUseLsdb(GlobalRouteManagerLSDB *lsdb)
Debugging routine; allow client code to supply a pre-built LSDB.
void DebugSPFCalculate(Ipv4Address root)
Debugging routine; call the core SPF from the unit tests.
The Link State DataBase (LSDB) of the Global Route Manager.
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.
a Link State Advertisement (LSA) for a router, used in global routing.
uint32_t AddLinkRecord(GlobalRoutingLinkRecord *lr)
Add a given Global Routing Link Record to the LSA.
void SetLSType(LSType typ)
Set the LS type field of the LSA.
void SetAdvertisingRouter(Ipv4Address rtr)
Set the Advertising Router as defined by the OSPF spec.
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.
A single link record for a link state advertisement.
Vertex used in shortest path first (SPF) computations.
void SetDistanceFromRoot(uint32_t distance)
Set the distance from the root vertex to "this" SPFVertex object.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
static GlobalRouteManagerImplTestSuite g_globalRoutingManagerImplTestSuite
Static variable for test initialization.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.