fw: eliminate fibEntry in Strategy API
Strategy::lookupFib can be used to obtain FIB entry.
FIB lookup is skipped when strategy does not need it.
refs #3205
Change-Id: Icba67229cbc261d9def44ffa91461ea4b09982b2
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 00c059f..a3b2aba 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -89,7 +89,7 @@
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
pitEntry->insertOrUpdateInRecord(face1, *interest);
- strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
+ strategy.afterReceiveInterest(*face1, *interest, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.back().outFaceId, face2->getId());
@@ -101,7 +101,7 @@
function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
periodicalRetxFrom4 = [&] {
pitEntry->insertOrUpdateInRecord(face4, *interest);
- strategy.afterReceiveInterest(*face4, *interest, fibEntry, pitEntry);
+ strategy.afterReceiveInterest(*face4, *interest, pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
if (nSent > nSentLast) {
@@ -133,7 +133,7 @@
for (int i = 0; i < 3; ++i) {
this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 2);
pitEntry->insertOrUpdateInRecord(face5, *interest);
- strategy.afterReceiveInterest(*face5, *interest, fibEntry, pitEntry);
+ strategy.afterReceiveInterest(*face5, *interest, pitEntry);
}
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 3);
BOOST_CHECK_NE(strategy.sendInterestHistory[0].outFaceId, face1->getId());
@@ -209,7 +209,7 @@
shared_ptr<fib::Entry> fibEntry = scenario.makeFibEntry(this);
- strategy.afterReceiveInterest(*face1, *interest, fibEntry, pitEntry);
+ strategy.afterReceiveInterest(*face1, *interest, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.rejectPendingInterestHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory[0].pitEntry, pitEntry);
@@ -240,7 +240,7 @@
lp::Nack nack3 = makeNack("/McQYjMbm", 992, lp::NackReason::CONGESTION);
pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
- strategy.afterReceiveNack(*face3, nack3, fibEntry, pitEntry);
+ strategy.afterReceiveNack(*face3, nack3, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 2);
BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].pitEntry, pitEntry);
@@ -269,13 +269,13 @@
lp::Nack nack3 = makeNack("/aS9FAyUV19", 286, lp::NackReason::CONGESTION);
pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
- strategy.afterReceiveNack(*face3, nack3, fibEntry, pitEntry);
+ strategy.afterReceiveNack(*face3, nack3, pitEntry);
BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0); // don't send Nack until all upstreams have Nacked
lp::Nack nack4 = makeNack("/aS9FAyUV19", 286, lp::NackReason::CONGESTION);
pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
- strategy.afterReceiveNack(*face4, nack4, fibEntry, pitEntry);
+ strategy.afterReceiveNack(*face4, nack4, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].pitEntry, pitEntry);
@@ -305,7 +305,7 @@
lp::Nack nack4 = makeNack("/sIYw0TXWDj", 223, lp::NackReason::CONGESTION);
pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
- strategy.afterReceiveNack(*face4, nack4, fibEntry, pitEntry);
+ strategy.afterReceiveNack(*face4, nack4, pitEntry);
BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0);
}
@@ -442,13 +442,13 @@
lp::Nack nack3 = makeNack("/F6sEwB24I", 282, combination.getX());
pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
- strategy.afterReceiveNack(*face3, nack3, fibEntry, pitEntry);
+ strategy.afterReceiveNack(*face3, nack3, pitEntry);
BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0);
lp::Nack nack4 = makeNack("/F6sEwB24I", 282, combination.getY());
pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
- strategy.afterReceiveNack(*face4, nack4, fibEntry, pitEntry);
+ strategy.afterReceiveNack(*face4, nack4, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendNackHistory[0].pitEntry, pitEntry);