src: Replace Tokenizer with the methods of ndn::Name
Purpose of this commit is to replace Tokenizer in all
places except conf-file-processor.*pp with the methods
of ndn::Name. One static method in class NameHelper
is added. Tokenizer will be removed finally when
configuration file parsing commit is complete.
Refs: 1533
Change-Id: I14a67655eb963c5cc5b045c3c9f7d516e405ff19
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index bb7d3fa..7664b89 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -17,7 +17,6 @@
RoutingTable::calculate(Nlsr& pnlsr)
{
//debugging purpose
- std::cout << pnlsr.getConfParameter() << std::endl;
pnlsr.getNamePrefixTable().print();
pnlsr.getLsdb().printAdjLsdb();
pnlsr.getLsdb().printCorLsdb();
@@ -26,7 +25,8 @@
{
pnlsr.setIsRoutingTableCalculating(1); //setting routing table calculation
if (pnlsr.getLsdb().doesLsaExist(
- pnlsr.getConfParameter().getRouterPrefix() + "/" + "2", 2))
+ pnlsr.getConfParameter().getRouterPrefix().toUri() + "/" + "adjacency",
+ std::string("adjacency")))
{
if (pnlsr.getIsBuildAdjLsaSheduled() != 1)
{
@@ -50,7 +50,7 @@
calculateHypDryRoutingTable(pnlsr);
}
//need to update NPT here
- pnlsr.getNamePrefixTable().updateWithNewRoute(pnlsr);
+ pnlsr.getNamePrefixTable().updateWithNewRoute();
//debugging purpose
printRoutingTable();
pnlsr.getNamePrefixTable().print();
@@ -71,7 +71,7 @@
clearDryRoutingTable(); // for dry run options
// need to update NPT here
std::cout << "Calling Update NPT With new Route" << std::endl;
- pnlsr.getNamePrefixTable().updateWithNewRoute(pnlsr);
+ pnlsr.getNamePrefixTable().updateWithNewRoute();
//debugging purpose
printRoutingTable();
pnlsr.getNamePrefixTable().print();
@@ -131,14 +131,14 @@
}
static bool
-routingTableEntryCompare(RoutingTableEntry& rte, string& destRouter)
+routingTableEntryCompare(RoutingTableEntry& rte, ndn::Name& destRouter)
{
return rte.getDestination() == destRouter;
}
// function related to manipulation of routing table
void
-RoutingTable::addNextHop(string destRouter, NextHop& nh)
+RoutingTable::addNextHop(const ndn::Name& destRouter, NextHop& nh)
{
RoutingTableEntry* rteChk = findRoutingTableEntry(destRouter);
if (rteChk == 0)
@@ -154,7 +154,7 @@
}
RoutingTableEntry*
-RoutingTable::findRoutingTableEntry(const string destRouter)
+RoutingTable::findRoutingTableEntry(const ndn::Name& destRouter)
{
std::list<RoutingTableEntry>::iterator it = std::find_if(m_rTable.begin(),
m_rTable.end(),
@@ -180,7 +180,7 @@
//function related to manipulation of dry routing table
void
-RoutingTable::addNextHopToDryTable(string destRouter, NextHop& nh)
+RoutingTable::addNextHopToDryTable(const ndn::Name& destRouter, NextHop& nh)
{
std::list<RoutingTableEntry>::iterator it = std::find_if(m_dryTable.begin(),
m_dryTable.end(),