No longer set capture flag on advertised prefixes
Previously, all registered routes from NLSR would have
the capture flag set. This is desirable for some application
prefixes but does not necessarily make sense for advertised
prefixes as a whole.
Refs: #5360
Change-Id: If7e0f8e7d03aada18db9db4408f8d4167970e659
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 76affde..159d358 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -60,7 +60,7 @@
}
void
-Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, const NextHopsUriSortedSet& hopsToAdd)
+Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, const NextHopsUriSortedSet& hopsToAdd, uint64_t routeFlags)
{
const ndn::Name& name = entry.name;
@@ -77,13 +77,13 @@
registerPrefix(name, ndn::FaceUri(hop.getConnectingFaceUri()),
hop.getRouteCostAsAdjustedInteger(),
ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
- ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
+ routeFlags, 0);
}
}
}
void
-Fib::update(const ndn::Name& name, const NexthopList& allHops)
+Fib::update(const ndn::Name& name, const NexthopList& allHops, uint64_t routeFlags)
{
NLSR_LOG_DEBUG("Fib::update called");
@@ -107,7 +107,7 @@
FibEntry entry;
entry.name = name;
- addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
+ addNextHopsToFibEntryAndNfd(entry, hopsToAdd, routeFlags);
entryIt = m_table.try_emplace(name, std::move(entry)).first;
}
@@ -123,7 +123,7 @@
}
FibEntry& entry = entryIt->second;
- addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
+ addNextHopsToFibEntryAndNfd(entry, hopsToAdd, routeFlags);
std::set<NextHop, NextHopUriSortedComparator> hopsToRemove;
std::set_difference(entry.nexthopSet.begin(), entry.nexthopSet.end(),
@@ -149,7 +149,8 @@
if (entryIt != m_table.end() &&
!entryIt->second.refreshEventId &&
isNotNeighbor(entryIt->second.name)) {
- scheduleEntryRefresh(entryIt->second, [this] (FibEntry& entry) { scheduleLoop(entry); });
+ scheduleEntryRefresh(entryIt->second, routeFlags,
+ [this] (FibEntry& entry, uint64_t routeFlags) { scheduleLoop(entry, routeFlags); });
}
}
@@ -293,7 +294,7 @@
}
void
-Fib::scheduleEntryRefresh(FibEntry& entry, const AfterRefreshCallback& refreshCallback)
+Fib::scheduleEntryRefresh(FibEntry& entry, uint64_t routeFlags, const AfterRefreshCallback& refreshCallback)
{
NLSR_LOG_DEBUG("Scheduling refresh for " << entry.name <<
" Seq Num: " << entry.seqNo <<
@@ -301,23 +302,22 @@
entry.refreshEventId = m_scheduler.schedule(ndn::time::seconds(m_refreshTime),
std::bind(&Fib::refreshEntry, this,
- entry.name, refreshCallback));
+ entry.name, routeFlags, refreshCallback));
}
void
-Fib::scheduleLoop(FibEntry& entry)
+Fib::scheduleLoop(FibEntry& entry, uint64_t routeFlags)
{
- scheduleEntryRefresh(entry, std::bind(&Fib::scheduleLoop, this, _1));
+ scheduleEntryRefresh(entry, routeFlags, std::bind(&Fib::scheduleLoop, this, _1, _2));
}
void
-Fib::refreshEntry(const ndn::Name& name, AfterRefreshCallback refreshCb)
+Fib::refreshEntry(const ndn::Name& name, uint64_t routeFlags, AfterRefreshCallback refreshCb)
{
auto it = m_table.find(name);
if (it == m_table.end()) {
return;
}
-
FibEntry& entry = it->second;
NLSR_LOG_DEBUG("Refreshing " << entry.name << " Seq Num: " << entry.seqNo);
@@ -328,10 +328,10 @@
ndn::FaceUri(hop.getConnectingFaceUri()),
hop.getRouteCostAsAdjustedInteger(),
ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
- ndn::nfd::ROUTE_FLAG_CAPTURE, 0);
+ routeFlags, 0);
}
- refreshCb(entry);
+ refreshCb(entry, routeFlags);
}
void
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 7be0001..ade5779 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -41,7 +41,7 @@
NextHopsUriSortedSet nexthopSet;
};
-using AfterRefreshCallback = std::function<void(FibEntry&)>;
+using AfterRefreshCallback = std::function<void(FibEntry&, uint64_t)>;
class AdjacencyList;
class ConfParameter;
@@ -86,9 +86,10 @@
*
* \param name The name prefix that the next-hops apply to
* \param allHops A complete list of next-hops to associate with name.
+ * \param routeFlags Route inheritance flags
*/
void
- update(const ndn::Name& name, const NexthopList& allHops);
+ update(const ndn::Name& name, const NexthopList& allHops, uint64_t routeFlags);
void
setEntryRefreshTime(int32_t fert)
@@ -145,7 +146,7 @@
* \sa Fib::removeOldNextHopsFromFibEntryAndNfd
*/
void
- addNextHopsToFibEntryAndNfd(FibEntry& entry, const NextHopsUriSortedSet& hopsToAdd);
+ addNextHopsToFibEntryAndNfd(FibEntry& entry, const NextHopsUriSortedSet& hopsToAdd, uint64_t routeFlags);
unsigned int
getNumberOfFacesForName(const NexthopList& nextHopList);
@@ -194,18 +195,18 @@
* \sa Fib::scheduleLoop
*/
void
- scheduleEntryRefresh(FibEntry& entry, const AfterRefreshCallback& refreshCb);
+ scheduleEntryRefresh(FibEntry& entry, uint64_t routeFlags, const AfterRefreshCallback& refreshCb);
private:
/*! \brief Continue the entry refresh cycle.
*/
void
- scheduleLoop(FibEntry& entry);
+ scheduleLoop(FibEntry& entry, uint64_t routeFlags);
/*! \brief Refreshes an entry in NFD.
*/
void
- refreshEntry(const ndn::Name& name, AfterRefreshCallback refreshCb);
+ refreshEntry(const ndn::Name& name, uint64_t routeFlags, AfterRefreshCallback refreshCb);
public:
static inline const ndn::Name MULTICAST_STRATEGY{"/localhost/nfd/strategy/multicast"};
diff --git a/src/route/name-prefix-table-entry.hpp b/src/route/name-prefix-table-entry.hpp
index d808018..b19fe40 100644
--- a/src/route/name-prefix-table-entry.hpp
+++ b/src/route/name-prefix-table-entry.hpp
@@ -38,8 +38,9 @@
{
}
- NamePrefixTableEntry(const ndn::Name& namePrefix)
+ NamePrefixTableEntry(const ndn::Name& namePrefix, uint64_t routeFlags)
: m_namePrefix(namePrefix)
+ , m_flags(routeFlags)
, m_nexthopList()
{
}
@@ -87,6 +88,18 @@
return m_nexthopList;
}
+ void
+ setFlags(uint64_t flags)
+ {
+ m_flags = flags;
+ }
+
+ uint64_t
+ getFlags() const
+ {
+ return m_flags;
+ }
+
/*! \brief Collect all next-hops that are advertised by this entry's
* routing entries.
*/
@@ -114,6 +127,7 @@
private:
ndn::Name m_namePrefix;
+ uint64_t m_flags;
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
std::list<std::shared_ptr<RoutingTablePoolEntry>> m_rteList;
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index ea4fc16..ba521ba 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -78,7 +78,8 @@
for (const auto &prefix : nlsa->getNpl().getPrefixInfo()) {
if (prefix.getName() != m_ownRouterName) {
m_nexthopCost[DestNameKey(lsa->getOriginRouter(), prefix.getName())] = prefix.getCost();
- addEntry(prefix.getName(), lsa->getOriginRouter());
+ // Don't use capture flag on advertised prefixes...
+ addEntry(prefix.getName(), lsa->getOriginRouter(), ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
}
}
}
@@ -91,7 +92,8 @@
for (const auto &prefix : namesToAdd) {
if (prefix.getName() != m_ownRouterName) {
m_nexthopCost[DestNameKey(lsa->getOriginRouter(), prefix.getName())] = prefix.getCost();
- addEntry(prefix.getName(), lsa->getOriginRouter());
+ // Don't use capture flag on advertised prefixes...
+ addEntry(prefix.getName(), lsa->getOriginRouter(), ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
}
}
@@ -129,7 +131,7 @@
}
void
-NamePrefixTable::addEntry(const ndn::Name& name, const ndn::Name& destRouter)
+NamePrefixTable::addEntry(const ndn::Name& name, const ndn::Name& destRouter, uint64_t routeFlags)
{
// Check if the advertised name prefix is in the table already.
auto nameItr = std::find_if(m_table.begin(), m_table.end(),
@@ -169,7 +171,8 @@
if (nameItr == m_table.end()) {
NLSR_LOG_DEBUG("Adding origin: " << rtpePtr->getDestination()
<< " to a new name prefix: " << name);
- npte = std::make_shared<NamePrefixTableEntry>(name);
+
+ npte = std::make_shared<NamePrefixTableEntry>(name, ndn::nfd::ROUTE_FLAG_CHILD_INHERIT);
npte->addRoutingTableEntry(rtpePtr);
npte->generateNhlfromRteList();
m_table.push_back(npte);
@@ -177,7 +180,7 @@
// If this entry has next hops, we need to inform the FIB
if (npte->getNexthopList().size() > 0) {
NLSR_LOG_TRACE("Updating FIB with next hops for " << npte->getNamePrefix());
- m_fib.update(name, adjustNexthopCosts(npte->getNexthopList(), name, destRouter));
+ m_fib.update(name, adjustNexthopCosts(npte->getNexthopList(), name, destRouter), npte->getFlags());
}
// The routing table may recalculate and add a routing table entry
// with no next hops to replace an existing routing table entry. In
@@ -193,13 +196,16 @@
else {
npte = *nameItr;
NLSR_LOG_TRACE("Adding origin: " << rtpePtr->getDestination() <<
- " to existing prefix: " << **nameItr);
- (*nameItr)->addRoutingTableEntry(rtpePtr);
- (*nameItr)->generateNhlfromRteList();
-
- if ((*nameItr)->getNexthopList().size() > 0) {
- NLSR_LOG_TRACE("Updating FIB with next hops for " << (**nameItr));
- m_fib.update(name, adjustNexthopCosts((*nameItr)->getNexthopList(), name, destRouter));
+ " to existing prefix: " << *npte);
+ // We should not downgrade the capture flag to child-inherit unless there are no nexthops
+ if (npte->getFlags() != routeFlags && npte->getNexthopList().size() == 0) {
+ npte->setFlags(routeFlags);
+ }
+ npte->addRoutingTableEntry(rtpePtr);
+ npte->generateNhlfromRteList();
+ if (npte->getNexthopList().size() > 0) {
+ NLSR_LOG_TRACE("Updating FIB with next hops for " << *npte);
+ m_fib.update(name, adjustNexthopCosts(npte->getNexthopList(), name, destRouter), npte->getFlags());
}
else {
NLSR_LOG_TRACE(npte->getNamePrefix() << " has no next hops; removing from FIB");
@@ -233,12 +239,13 @@
auto nameItr = std::find_if(m_table.begin(), m_table.end(),
[&] (const auto& entry) { return entry->getNamePrefix() == name; });
if (nameItr != m_table.end()) {
+ std::shared_ptr<NamePrefixTableEntry> npte = *nameItr;
NLSR_LOG_TRACE("Removing origin: " << rtpePtr->getDestination()
<< " from prefix: " << **nameItr);
// Rather than iterating through the whole list periodically, just
// delete them here if they have no references.
- if ((*nameItr)->removeRoutingTableEntry(rtpePtr) == 0) {
+ if (npte->removeRoutingTableEntry(rtpePtr) == 0) {
deleteRtpeFromPool(rtpePtr);
}
@@ -257,17 +264,17 @@
// Prefix Table. Once a new Name LSA advertises this prefix, a
// new entry for the prefix will be created.
//
- if ((*nameItr)->getRteListSize() == 0) {
- NLSR_LOG_TRACE(**nameItr << " has no routing table entries;"
+ if (npte->getRteListSize() == 0) {
+ NLSR_LOG_TRACE(*npte << " has no routing table entries;"
<< " removing from table and FIB");
m_table.erase(nameItr);
m_fib.remove(name);
}
else {
- NLSR_LOG_TRACE(**nameItr << " has other routing table entries;"
+ NLSR_LOG_TRACE(*npte << " has other routing table entries;"
<< " updating FIB with next hops");
(*nameItr)->generateNhlfromRteList();
- m_fib.update(name, adjustNexthopCosts((*nameItr)->getNexthopList(), name, destRouter));
+ m_fib.update(name, adjustNexthopCosts(npte->getNexthopList(), name, destRouter), npte->getFlags());
}
}
else {
@@ -295,7 +302,7 @@
poolEntry->setNexthopList(sourceEntry->getNexthopList());
for (const auto& nameEntry : poolEntry->namePrefixTableEntries) {
auto nameEntryFullPtr = nameEntry.second.lock();
- addEntry(nameEntryFullPtr->getNamePrefix(), poolEntry->getDestination());
+ addEntry(nameEntryFullPtr->getNamePrefix(), poolEntry->getDestination(), nameEntryFullPtr->getFlags());
}
}
else if (sourceEntry == entries.end()) {
@@ -303,7 +310,7 @@
poolEntry->getNexthopList().clear();
for (const auto& nameEntry : poolEntry->namePrefixTableEntries) {
auto nameEntryFullPtr = nameEntry.second.lock();
- addEntry(nameEntryFullPtr->getNamePrefix(), poolEntry->getDestination());
+ addEntry(nameEntryFullPtr->getNamePrefix(), poolEntry->getDestination(), nameEntryFullPtr->getFlags());
}
}
else {
diff --git a/src/route/name-prefix-table.hpp b/src/route/name-prefix-table.hpp
index 8fca574..c39b5f4 100644
--- a/src/route/name-prefix-table.hpp
+++ b/src/route/name-prefix-table.hpp
@@ -66,6 +66,7 @@
/*! \brief Adds a destination to the specified name prefix.
\param name The name prefix
\param destRouter The destination router prefix
+ \param routeFlags Route inheritance flags from NFD
This method adds a router to a name prefix table entry. If the
name prefix table entry does not exist, it is created. The method
@@ -77,7 +78,7 @@
notified of the change to the NPT entry, too.
*/
void
- addEntry(const ndn::Name& name, const ndn::Name& destRouter);
+ addEntry(const ndn::Name& name, const ndn::Name& destRouter, uint64_t routeFlags = ndn::nfd::ROUTE_FLAG_CAPTURE);
/*! \brief Removes a destination from a name prefix table entry.
\param name The name prefix
diff --git a/tests/route/test-fib.cpp b/tests/route/test-fib.cpp
index d9b4354..7232742 100644
--- a/tests/route/test-fib.cpp
+++ b/tests/route/test-fib.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2024, The University of Memphis,
+ * Copyright (c) 2014-2025, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
@@ -103,7 +103,7 @@
hops.addNextHop(hop1);
hops.addNextHop(hop2);
- fib.update("/ndn/name", hops);
+ fib.update("/ndn/name", hops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
// Should register faces 1 and 2 for /ndn/name
@@ -136,13 +136,13 @@
oldHops.addNextHop(hop1);
oldHops.addNextHop(hop2);
- fib.update("/ndn/name", oldHops);
+ fib.update("/ndn/name", oldHops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
BOOST_REQUIRE_EQUAL(interests.size(), 2);
interests.clear();
- fib.update("/ndn/name", oldHops);
+ fib.update("/ndn/name", oldHops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
// Should register face 1 and 2 for /ndn/name
@@ -175,7 +175,7 @@
oldHops.addNextHop(hop1);
oldHops.addNextHop(hop2);
- fib.update("/ndn/name", oldHops);
+ fib.update("/ndn/name", oldHops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
BOOST_REQUIRE_EQUAL(interests.size(), 2);
@@ -183,7 +183,7 @@
NexthopList empty;
- fib.update("/ndn/name", empty);
+ fib.update("/ndn/name", empty, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
// Should unregister faces 1 and 2 for /ndn/name
@@ -218,7 +218,7 @@
hops.addNextHop(hop2);
hops.addNextHop(hop3);
- fib.update("/ndn/name", hops);
+ fib.update("/ndn/name", hops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
// Should only register faces 1 and 2 for /ndn/name
@@ -251,7 +251,7 @@
hops.addNextHop(hop1);
hops.addNextHop(hop2);
- fib.update("/ndn/name", hops);
+ fib.update("/ndn/name", hops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
// FIB
@@ -264,7 +264,7 @@
NextHop hop3(router3FaceUri, 5);
hops.addNextHop(hop3);
- fib.update("/ndn/name", hops);
+ fib.update("/ndn/name", hops, ndn::nfd::ROUTE_FLAG_CAPTURE);
face.processEvents(ndn::time::milliseconds(-1));
// To maintain a max 2 face requirement, face 3 should be registered and face 2 should be
@@ -309,7 +309,8 @@
int origSeqNo = fe.seqNo;
fib.m_table.emplace(name1, std::move(fe));
- fib.scheduleEntryRefresh(fe, [&] (auto& entry) { BOOST_CHECK_EQUAL(origSeqNo + 1, entry.seqNo); });
+ fib.scheduleEntryRefresh(fe, true,
+ [&] (auto& entry, bool captureFlag) { BOOST_CHECK_EQUAL(origSeqNo + 1, entry.seqNo); });
this->advanceClocks(ndn::time::milliseconds(10), 1);
// avoid "test case [...] did not check any assertions" message from Boost.Test
@@ -325,7 +326,7 @@
hops.addNextHop(hop1);
// Simulate update for this neighbor from name prefix table
- fib.update(router1Name, hops);
+ fib.update(router1Name, hops, ndn::nfd::ROUTE_FLAG_CAPTURE);
this->advanceClocks(ndn::time::seconds(1));
// Should not send the register interest
@@ -355,21 +356,21 @@
nhl1.addNextHop(NextHop(ndn::FaceUri("udp4://10.0.0.13:6363"), 28));
nhl1.addNextHop(NextHop(ndn::FaceUri("udp4://10.0.0.9:6363"), 38));
nhl1.addNextHop(NextHop(ndn::FaceUri("udp4://10.0.0.26:6363"), 44));
- fib.update("/test", nhl1);
+ fib.update("/test", nhl1, ndn::nfd::ROUTE_FLAG_CAPTURE);
// Memphis advertises /test
NexthopList nhl2;
nhl2.addNextHop(NextHop(ndn::FaceUri("udp4://10.0.0.9:6363"), 21));
nhl2.addNextHop(NextHop(ndn::FaceUri("udp4://10.0.0.13:6363"), 26));
nhl2.addNextHop(NextHop(ndn::FaceUri("udp4://10.0.0.26:6363"), 42));
- fib.update("/test", nhl2);
+ fib.update("/test", nhl2, ndn::nfd::ROUTE_FLAG_CAPTURE);
advanceClocks(10_ms);
face.sentInterests.clear();
// Memphis withdraws /test
// NamePrefixTable calls this saying we need to install the Wu routes
// instead of the existing Memphis' cheaper routes
- fib.update("/test", nhl1);
+ fib.update("/test", nhl1, ndn::nfd::ROUTE_FLAG_CAPTURE);
advanceClocks(10_ms);
int numRegister = 0;
diff --git a/tests/route/test-name-prefix-table-entry.cpp b/tests/route/test-name-prefix-table-entry.cpp
index 69f3579..3ce2751 100644
--- a/tests/route/test-name-prefix-table-entry.cpp
+++ b/tests/route/test-name-prefix-table-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2024, The University of Memphis,
+ * Copyright (c) 2014-2025, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
@@ -30,14 +30,14 @@
BOOST_AUTO_TEST_CASE(NpteConstructorAndNamePrefix)
{
- NamePrefixTableEntry npte1("/ndn/memphis.edu/cs");
+ NamePrefixTableEntry npte1("/ndn/memphis.edu/cs", ndn::nfd::ROUTE_FLAG_CAPTURE);
BOOST_CHECK_EQUAL(npte1.getNamePrefix(), "/ndn/memphis.edu/cs");
}
BOOST_AUTO_TEST_CASE(AddRoutingTableEntry)
{
- NamePrefixTableEntry npte1("/ndn/memphis/rtr1");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr1", ndn::nfd::ROUTE_FLAG_CAPTURE);
RoutingTablePoolEntry rtpe1("/ndn/memphis/rtr2", 0);
auto rtpePtr = std::make_shared<RoutingTablePoolEntry>(rtpe1);
@@ -51,7 +51,7 @@
BOOST_AUTO_TEST_CASE(RemoveRoutingTableEntry)
{
- NamePrefixTableEntry npte1("/ndn/memphis/rtr1");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr1", ndn::nfd::ROUTE_FLAG_CAPTURE);
RoutingTablePoolEntry rtpe1("/ndn/memphis/rtr2", 0);
auto rtpePtr = std::make_shared<RoutingTablePoolEntry>(rtpe1);
@@ -70,15 +70,15 @@
BOOST_AUTO_TEST_CASE(EqualsOperatorTwoObj)
{
- NamePrefixTableEntry npte1("/ndn/memphis/rtr1");
- NamePrefixTableEntry npte2("/ndn/memphis/rtr1");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr1", ndn::nfd::ROUTE_FLAG_CAPTURE);
+ NamePrefixTableEntry npte2("/ndn/memphis/rtr1", ndn::nfd::ROUTE_FLAG_CAPTURE);
BOOST_CHECK_EQUAL(npte1, npte2);
}
BOOST_AUTO_TEST_CASE(EqualsOperatorOneObjOneName)
{
- NamePrefixTableEntry npte1("/ndn/memphis/rtr1");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr1", ndn::nfd::ROUTE_FLAG_CAPTURE);
BOOST_CHECK_EQUAL(npte1, "/ndn/memphis/rtr1");
}
diff --git a/tests/route/test-name-prefix-table.cpp b/tests/route/test-name-prefix-table.cpp
index 5d10dd8..95bc97c 100644
--- a/tests/route/test-name-prefix-table.cpp
+++ b/tests/route/test-name-prefix-table.cpp
@@ -149,7 +149,7 @@
{
RoutingTablePoolEntry rtpe1("/ndn/memphis/rtr1", 0);
std::shared_ptr<RoutingTablePoolEntry> rtpePtr = npt.addRtpeToPool(rtpe1);
- NamePrefixTableEntry npte1("/ndn/memphis/rtr2");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr2", ndn::nfd::ROUTE_FLAG_CAPTURE);
npt.addEntry("/ndn/memphis/rtr2", "/ndn/memphis/rtr1");
@@ -168,7 +168,7 @@
{
RoutingTablePoolEntry rtpe1("/ndn/memphis/rtr1", 0);
- NamePrefixTableEntry npte1("/ndn/memphis/rtr2");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr2", ndn::nfd::ROUTE_FLAG_CAPTURE);
npt.m_table.push_back(std::make_shared<NamePrefixTableEntry>(npte1));
npt.addEntry("/ndn/memphis/rtr2", "/ndn/memphis/rtr1");
@@ -190,7 +190,7 @@
BOOST_FIXTURE_TEST_CASE(AddNptEntryPtrToRoutingEntry, NamePrefixTableFixture)
{
- NamePrefixTableEntry npte1("/ndn/memphis/rtr2");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr2", ndn::nfd::ROUTE_FLAG_CAPTURE);
npt.m_table.push_back(std::make_shared<NamePrefixTableEntry>(npte1));
npt.addEntry("/ndn/memphis/rtr2", "/ndn/memphis/rtr1");
@@ -215,8 +215,8 @@
BOOST_FIXTURE_TEST_CASE(RemoveNptEntryPtrFromRoutingEntry, NamePrefixTableFixture)
{
- NamePrefixTableEntry npte1("/ndn/memphis/rtr1");
- NamePrefixTableEntry npte2("/ndn/memphis/rtr2");
+ NamePrefixTableEntry npte1("/ndn/memphis/rtr1", ndn::nfd::ROUTE_FLAG_CAPTURE);
+ NamePrefixTableEntry npte2("/ndn/memphis/rtr2", ndn::nfd::ROUTE_FLAG_CAPTURE);
RoutingTableEntry rte1("/ndn/memphis/destination1");
npt.m_table.push_back(std::make_shared<NamePrefixTableEntry>(npte1));
npt.m_table.push_back(std::make_shared<NamePrefixTableEntry>(npte2));
@@ -254,7 +254,7 @@
NextHop hop1{ndn::FaceUri("upd4://10.0.0.1"), 0};
NextHop hop2{ndn::FaceUri("upd4://10.0.0.2"), 1};
NextHop hop3{ndn::FaceUri("upd4://10.0.0.3"), 2};
- const NamePrefixTableEntry entry1{"/ndn/router1"};
+ const NamePrefixTableEntry entry1{"/ndn/router1", true};
npt.addEntry(entry1.getNamePrefix(), destination);
rt.addNextHop(destination, hop1);