fw: add FaceEndpoint parameter in Forwarding and Strategy API
refs: #4849
Change-Id: Ibe22557488fa83a555fd13d6eb8e03f8d81d0b2b
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index fed914c..1b71aa2 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -75,7 +75,7 @@
shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
pitEntry1->insertOrUpdateInRecord(*face3, 0, interest1);
- strategy.afterReceiveInterest(*face3, interest1, pitEntry1);
+ strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), interest1, pitEntry1);
// forwards to face1 because routing says it's best
// (no io run here: afterReceiveInterest has already sent the Interest)
@@ -90,7 +90,7 @@
// face2 responds
shared_ptr<Data> data1p = makeData("ndn:/0Jm1ajrW/%00");
Data& data1 = *data1p;
- strategy.beforeSatisfyInterest(pitEntry1, *face2, data1);
+ strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), data1);
this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
// second Interest: strategy knows face2 is best
@@ -100,7 +100,7 @@
shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
pitEntry2->insertOrUpdateInRecord(*face3, 0, interest2);
- strategy.afterReceiveInterest(*face3, interest2, pitEntry2);
+ strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), interest2, pitEntry2);
// forwards to face2 because it responds previously
this->advanceClocks(time::milliseconds(1));
@@ -132,7 +132,7 @@
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
- strategy.afterReceiveInterest(*face3, *interest1, pitEntry1);
+ strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
this->advanceClocks(time::milliseconds(1));
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
@@ -140,7 +140,7 @@
// face1 responds
shared_ptr<Data> data1 = makeData("ndn:/nztwIvHX/%00");
- strategy.beforeSatisfyInterest(pitEntry1, *face1, *data1);
+ strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face1, 0), *data1);
this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
// second Interest: bestFace is face1, nUpstreams becomes 0,
@@ -150,7 +150,7 @@
shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
- strategy.afterReceiveInterest(*face3, *interest2, pitEntry2);
+ strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest2, pitEntry2);
// FIB entry is changed before doPropagate executes
fibEntry.addOrUpdateNextHop(*face2, 0, 20);
@@ -184,7 +184,7 @@
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
- strategy.afterReceiveInterest(*face3, *interest1, pitEntry1);
+ strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
limitedIo.run(2 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
@@ -193,11 +193,11 @@
// face1 responds
shared_ptr<Data> data1 = makeData("ndn:/seRMz5a6/%00");
- strategy.beforeSatisfyInterest(pitEntry1, *face1, *data1);
+ strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face1, 0), *data1);
pitEntry1->clearInRecords();
this->advanceClocks(time::milliseconds(10));
// face2 also responds
- strategy.beforeSatisfyInterest(pitEntry1, *face2, *data1);
+ strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
this->advanceClocks(time::milliseconds(10));
// second Interest: bestFace should be face 1
@@ -206,7 +206,7 @@
shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
- strategy.afterReceiveInterest(*face3, *interest2, pitEntry2);
+ strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest2, pitEntry2);
limitedIo.run(3 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
@@ -238,7 +238,7 @@
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
- strategy.afterReceiveInterest(*face1, *interest1, pitEntry1);
+ strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
limitedIo.run(1 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
@@ -247,14 +247,14 @@
// face2 responds
shared_ptr<Data> data1 = makeData("ndn:/M4mBXCsd");
data1->setFreshnessPeriod(time::milliseconds(5));
- strategy.beforeSatisfyInterest(pitEntry1, *face2, *data1);
+ strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
pitEntry1->deleteOutRecord(*face2, 0);
pitEntry1->clearInRecords();
this->advanceClocks(time::milliseconds(10));
// similar Interest: strategy should still forward it
pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
- strategy.afterReceiveInterest(*face1, *interest1, pitEntry1);
+ strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
limitedIo.run(2 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
@@ -283,7 +283,7 @@
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
- strategy.afterReceiveInterest(*face1, *interest1, pitEntry1);
+ strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
// Interest shall go to face2, not loop back to face1
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);