src: configuration file parsing
used boost::property_tree::info_parser for parsing nlsr's configuration file and
changed configuration command style to info command style. Removed tokenizer from
nlsr
Refs: #1542
Change-Id: If017ddd7eef5caa59b33940bfc27a71aa4de266b
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 5468b40..12536f1 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -9,13 +9,13 @@
static bool
nexthopCompare(NextHop& nh1, NextHop& nh2)
{
- return nh1.getConnectingFace() == nh2.getConnectingFace();
+ return nh1.getConnectingFaceUri() == nh2.getConnectingFaceUri();
}
static bool
nexthopRemoveCompare(NextHop& nh1, NextHop& nh2)
{
- return (nh1.getConnectingFace() == nh2.getConnectingFace() &&
+ return (nh1.getConnectingFaceUri() == nh2.getConnectingFaceUri() &&
nh1.getRouteCost() == nh2.getRouteCost()) ;
}
@@ -38,13 +38,11 @@
{
std::list<NextHop>::iterator it = std::find_if(m_nexthopList.begin(),
m_nexthopList.end(),
- bind(&nexthopCompare, _1, nh));
- if (it == m_nexthopList.end())
- {
+ ndn::bind(&nexthopCompare, _1, nh));
+ if (it == m_nexthopList.end()) {
m_nexthopList.push_back(nh);
}
- if ((*it).getRouteCost() > nh.getRouteCost())
- {
+ if ((*it).getRouteCost() > nh.getRouteCost()) {
(*it).setRouteCost(nh.getRouteCost());
}
}
@@ -59,9 +57,8 @@
{
std::list<NextHop>::iterator it = std::find_if(m_nexthopList.begin(),
m_nexthopList.end(),
- bind(&nexthopRemoveCompare, _1, nh));
- if (it != m_nexthopList.end())
- {
+ ndn::bind(&nexthopRemoveCompare, _1, nh));
+ if (it != m_nexthopList.end()) {
m_nexthopList.erase(it);
}
}
@@ -78,8 +75,7 @@
std::list<NextHop> nexthopList = nhl.getNextHops();
int i = 1;
for (std::list<NextHop>::iterator it = nexthopList.begin();
- it != nexthopList.end() ; it++, i++)
- {
+ it != nexthopList.end() ; it++, i++) {
os << "Nexthop " << i << ": " << (*it) << endl;
}
return os;