LSA refreshing/Expiration, Fib Refreshing Added
diff --git a/nlsr_rt.cpp b/nlsr_rt.cpp
index ae7fc88..efa423a 100644
--- a/nlsr_rt.cpp
+++ b/nlsr_rt.cpp
@@ -81,9 +81,7 @@
}
else
{
- pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
- ndn::bind(&RoutingTable::calculate,this,boost::ref(pnlsr)));
- pnlsr.setIsRouteCalculationScheduled(1);
+ scheduleRoutingTableCalculation(pnlsr);
}
}
@@ -121,6 +119,17 @@
hrtc.calculatePath(vMap,boost::ref(*this),pnlsr);
}
+void
+RoutingTable::scheduleRoutingTableCalculation(nlsr& pnlsr)
+{
+ if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
+ {
+ pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
+ ndn::bind(&RoutingTable::calculate,this,boost::ref(pnlsr)));
+ pnlsr.setIsRouteCalculationScheduled(1);
+ }
+}
+
static bool
routingTableEntryCompare(RoutingTableEntry& rte, string& destRouter){
return rte.getDestination()==destRouter;