src: Setting neighbour router's FIB entry expiration to milliseconds::max()
Refs: #1786
Change-Id: I6d51338f9ceb358bb67cdb38feb148780f2f1577
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 2f7914a..3cf0b3c 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -82,7 +82,8 @@
// add entry to NDN-FIB
if (isPrefixUpdatable(it->getName())) {
registerPrefix(it->getName(), nhit->getConnectingFaceUri(),
- std::ceil(nhit->getRouteCost()), (m_refreshTime + GRACE_PERIOD));
+ std::ceil(nhit->getRouteCost()),
+ ndn::time::seconds(m_refreshTime + GRACE_PERIOD));
}
}
// increase sequence number and schedule refresh again
@@ -137,7 +138,8 @@
//Add entry to NDN-FIB
if (isPrefixUpdatable(name)) {
registerPrefix(name, nhit->getConnectingFaceUri(),
- std::ceil(nhit->getRouteCost()), (m_refreshTime + GRACE_PERIOD));
+ std::ceil(nhit->getRouteCost()),
+ ndn::time::seconds(m_refreshTime + GRACE_PERIOD));
}
}
newEntry.getNexthopList().sort();
@@ -160,7 +162,8 @@
// Add first Entry to NDN-FIB
if (isPrefixUpdatable(name)) {
registerPrefix(name, nhit->getConnectingFaceUri(),
- std::ceil(nhit->getRouteCost()), (m_refreshTime + GRACE_PERIOD));
+ std::ceil(nhit->getRouteCost()),
+ ndn::time::seconds(m_refreshTime + GRACE_PERIOD));
}
removeHop(it->getNexthopList(), nhit->getConnectingFaceUri(), name);
it->getNexthopList().reset();
@@ -172,7 +175,8 @@
//Add Entry to NDN_FIB
if (isPrefixUpdatable(name)) {
registerPrefix(name, nhit->getConnectingFaceUri(),
- std::ceil(nhit->getRouteCost()), (m_refreshTime + GRACE_PERIOD));
+ std::ceil(nhit->getRouteCost()),
+ ndn::time::seconds(m_refreshTime + GRACE_PERIOD));
}
}
}
@@ -288,7 +292,7 @@
void
Fib::registerPrefix(const ndn::Name& namePrefix, const std::string& faceUri,
- uint64_t faceCost, uint64_t timeout)
+ uint64_t faceCost, const ndn::time::milliseconds& timeout)
{
createFace(faceUri,
ndn::bind(&Fib::registerPrefixInNfd, this,_1, namePrefix, faceCost, timeout),
@@ -298,7 +302,8 @@
void
Fib::registerPrefix(const ndn::Name& namePrefix,
const std::string& faceUri,
- uint64_t faceCost, uint64_t timeout,
+ uint64_t faceCost,
+ const ndn::time::milliseconds& timeout,
const CommandSucceedCallback& onSuccess,
const CommandFailCallback& onFailure)
@@ -311,14 +316,15 @@
void
Fib::registerPrefixInNfd(const ndn::nfd::ControlParameters& faceCreateResult,
- const ndn::Name& namePrefix, uint64_t faceCost, uint64_t timeout)
+ const ndn::Name& namePrefix, uint64_t faceCost,
+ const ndn::time::milliseconds& timeout)
{
ndn::nfd::ControlParameters controlParameters;
controlParameters
.setName(namePrefix)
.setFaceId(faceCreateResult.getFaceId())
.setCost(faceCost)
- .setExpirationPeriod(ndn::time::milliseconds(timeout * 1000))
+ .setExpirationPeriod(timeout)
.setOrigin(128);
m_controller.start<ndn::nfd::RibRegisterCommand>(controlParameters,
ndn::bind(&Fib::onRegistration, this, _1,
@@ -330,7 +336,8 @@
void
Fib::registerPrefixInNfd(const ndn::nfd::ControlParameters& faceCreateResult,
- const ndn::Name& namePrefix, uint64_t faceCost, uint64_t timeout,
+ const ndn::Name& namePrefix, uint64_t faceCost,
+ const ndn::time::milliseconds& timeout,
const CommandSucceedCallback& onSuccess,
const CommandFailCallback& onFailure)
{
@@ -339,7 +346,7 @@
.setName(namePrefix)
.setFaceId(faceCreateResult.getFaceId())
.setCost(faceCost)
- .setExpirationPeriod(ndn::time::milliseconds(timeout * 1000))
+ .setExpirationPeriod(timeout)
.setOrigin(128);
m_controller.start<ndn::nfd::RibRegisterCommand>(controlParameters,
onSuccess,