|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void Push(SPFVertex *vNew)
Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme.
uint32_t AddLinkRecord(GlobalRoutingLinkRecord *lr)
Add a given Global Routing Link Record to the LSA.
A Candidate Queue used in routing calculations.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void DoRun(void)
Implementation to actually run this TestCase.
GlobalRouteManagerImplTestSuite()
a Link State Advertisement (LSA) for a router, used in global routing.
void SetLinkStateId(Ipv4Address addr)
Set the Link State ID is defined by the OSPF spec.
void DebugUseLsdb(GlobalRouteManagerLSDB *lsdb)
Debugging routine; allow client code to supply a pre-built LSDB.
The Link State DataBase (LSDB) of the Global Route Manager.
void SetDistanceFromRoot(uint32_t distance)
Set the distance from the root vertex to "this" SPFVertex object.
GlobalRouteManagerImplTestCase()
void DebugSPFCalculate(Ipv4Address root)
Debugging routine; call the core SPF from the unit tests.
Global Route Manager Test.
SPFVertex * Pop(void)
Pop the Shortest Path First Vertex pointer at the top of the queue.
void SetLSType(LSType typ)
Set the LS type field of the LSA.
GlobalRoutingLSA * GetLSA(Ipv4Address addr) const
Look up the Link State Advertisement associated with the given link state ID (address).
A global router implementation.
Global Route Manager TestSuite.
A single link record for a link state advertisement.
static GlobalRouteManagerImplTestSuite g_globalRoutingManagerImplTestSuite
Static variable for test initialization.
Ipv4Address GetLinkStateId(void) const
Get the Link State ID as defined by the OSPF spec.
Vertex used in shortest path first (SPF) computations.
void SetAdvertisingRouter(Ipv4Address rtr)
Set the Advertising Router as defined by the OSPF spec.
void Insert(Ipv4Address addr, GlobalRoutingLSA *lsa)
Insert an IP address / Link State Advertisement pair into the Link State Database.