Revert "pit: add EndpointId field in in-record and out-record"
This reverts commit d3ae85dbad518da84d0ef5ba61b81108e40f84f3.
refs: #4973
Change-Id: I0aedfca8ae75137c8c9073a51642bfacf9d8f212
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index 3ec11da..903a4aa 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -98,15 +98,15 @@
auto face1 = make_shared<DummyFace>();
auto face2 = make_shared<DummyFace>();
- entry.insertOrUpdateInRecord(*face1, 0, *interest);
+ entry.insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), false);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
- entry.insertOrUpdateInRecord(*face2, 0, *interest);
+ entry.insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), true);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
- entry.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry.insertOrUpdateOutRecord(*face1, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), false);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
}
@@ -126,22 +126,22 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry0, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry1(*interest);
- entry1.insertOrUpdateInRecord(*face1, 0, *interest);
+ entry1.insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 25559, *face1), DUPLICATE_NONCE_IN_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 25559, *face2), DUPLICATE_NONCE_IN_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 19004, *face1), DUPLICATE_NONCE_NONE);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry1, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry2(*interest);
- entry2.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry2.insertOrUpdateOutRecord(*face1, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 25559, *face1), DUPLICATE_NONCE_OUT_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 25559, *face2), DUPLICATE_NONCE_OUT_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 19004, *face1), DUPLICATE_NONCE_NONE);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry2, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry3(*interest);
- entry3.insertOrUpdateInRecord(*face1, 0, *interest);
- entry3.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry3.insertOrUpdateInRecord(*face1, *interest);
+ entry3.insertOrUpdateOutRecord(*face1, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 25559, *face1),
DUPLICATE_NONCE_IN_SAME | DUPLICATE_NONCE_OUT_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 25559, *face2),
@@ -150,8 +150,8 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry4(*interest);
- entry4.insertOrUpdateInRecord(*face1, 0, *interest);
- entry4.insertOrUpdateInRecord(*face2, 0, *interest);
+ entry4.insertOrUpdateInRecord(*face1, *interest);
+ entry4.insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 25559, *face1),
DUPLICATE_NONCE_IN_SAME | DUPLICATE_NONCE_IN_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 25559, *face2),
@@ -160,8 +160,8 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry5(*interest);
- entry5.insertOrUpdateOutRecord(*face1, 0, *interest);
- entry5.insertOrUpdateOutRecord(*face2, 0, *interest);
+ entry5.insertOrUpdateOutRecord(*face1, *interest);
+ entry5.insertOrUpdateOutRecord(*face2, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry5, 25559, *face1),
DUPLICATE_NONCE_OUT_SAME | DUPLICATE_NONCE_OUT_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry5, 25559, *face2),
@@ -181,15 +181,15 @@
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-Data
- entry.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry.insertOrUpdateOutRecord(*face1, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
- entry.deleteOutRecord(*face1, 0);
+ entry.deleteOutRecord(*face1);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-Nack
- entry.insertOrUpdateOutRecord(*face2, 0, *interest);
+ entry.insertOrUpdateOutRecord(*face2, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
- pit::OutRecordCollection::iterator outR = entry.getOutRecord(*face2, 0);
+ pit::OutRecordCollection::iterator outR = entry.getOutRecord(*face2);
BOOST_REQUIRE(outR != entry.out_end());
lp::Nack nack = makeNack(*interest, lp::NackReason::DUPLICATE);
bool isNackAccepted = outR->setIncomingNack(nack); // Nack arrival
@@ -197,7 +197,7 @@
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-timeout
- entry.insertOrUpdateOutRecord(*face3, 0, *interest);
+ entry.insertOrUpdateOutRecord(*face3, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
this->advanceClocks(ndn::DEFAULT_INTEREST_LIFETIME, 2);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
@@ -213,12 +213,12 @@
time::steady_clock::TimePoint before = time::steady_clock::now();
- entry.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry.insertOrUpdateOutRecord(*face1, *interest);
this->advanceClocks(1_s);
BOOST_CHECK_EQUAL(getLastOutgoing(entry), before);
- entry.insertOrUpdateOutRecord(*face2, 0, *interest);
+ entry.insertOrUpdateOutRecord(*face2, *interest);
BOOST_CHECK_EQUAL(getLastOutgoing(entry), time::steady_clock::now());
}
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index 33eace4..77cb4b6 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -286,7 +286,7 @@
consumer->getClientFace().expressInterest(*interest, nullptr, nullptr, nullptr);
this->advanceClocks(time::milliseconds(100));
- pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkBC->getFace(nodeB), 0);
+ pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkBC->getFace(nodeB));
BOOST_CHECK(outRecord != pitEntry->out_end());
this->advanceClocks(time::milliseconds(100));
@@ -362,7 +362,7 @@
// Get pitEntry of node A
shared_ptr<pit::Entry> pitEntry = topo.getForwarder(nodeA).getPit().find(*interest);
//get outRecord associated with face towards B
- pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkAB->getFace(nodeA), 0);
+ pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkAB->getFace(nodeA));
BOOST_CHECK(outRecord != pitEntry->out_end());
@@ -383,13 +383,13 @@
pitEntry = topo.getForwarder(nodeB).getPit().find(*interest);
// Get outRecord associated with face towards D.
- outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB), 0);
+ outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
BOOST_CHECK(outRecord != pitEntry->out_end());
// RTT between B and D
this->advanceClocks(5_ms, 160_ms);
- outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB), 0);
+ outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nInData, i);
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 9614a26..3ab261e 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, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.back().outFaceId, face2->getId());
@@ -101,7 +101,7 @@
time::steady_clock::TimePoint timeSentLast = time::steady_clock::now();
std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
periodicalRetxFrom4 = [&] {
- pitEntry->insertOrUpdateInRecord(*face4, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face4, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face4, 0), *interest, pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
@@ -133,7 +133,7 @@
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 2);
- pitEntry->insertOrUpdateInRecord(*face5, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face5, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face5, 0), *interest, pitEntry);
}
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 3);
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 9f7d1ce..c2e646e 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -133,12 +133,12 @@
Pit& pit = forwarder.getPit();
auto interestA1 = makeInterest("/A", false, nullopt, 8378);
shared_ptr<pit::Entry> pitA = pit.insert(*interestA1).first;
- pitA->insertOrUpdateInRecord(*face1, 0, *interestA1);
+ pitA->insertOrUpdateInRecord(*face1, *interestA1);
auto interestA2 = makeInterest("/A", false, nullopt, 1698);
forwarder.onOutgoingInterest(pitA, FaceEndpoint(*face2, 0), *interestA2);
- pit::OutRecordCollection::iterator outA2 = pitA->getOutRecord(*face2, 0);
+ pit::OutRecordCollection::iterator outA2 = pitA->getOutRecord(*face2);
BOOST_REQUIRE(outA2 != pitA->out_end());
BOOST_CHECK_EQUAL(outA2->getLastNonce(), 1698);
@@ -305,15 +305,15 @@
Pit& pit = forwarder.getPit();
auto interestD = makeInterest("/A/B/C/D");
shared_ptr<pit::Entry> pitD = pit.insert(*interestD).first;
- pitD->insertOrUpdateInRecord(*face1, 0, *interestD);
+ pitD->insertOrUpdateInRecord(*face1, *interestD);
auto interestA = makeInterest("/A", true);
shared_ptr<pit::Entry> pitA = pit.insert(*interestA).first;
- pitA->insertOrUpdateInRecord(*face2, 0, *interestA);
- pitA->insertOrUpdateInRecord(*face3, 0, *interestA);
+ pitA->insertOrUpdateInRecord(*face2, *interestA);
+ pitA->insertOrUpdateInRecord(*face3, *interestA);
auto interestC = makeInterest("/A/B/C", true);
shared_ptr<pit::Entry> pitC = pit.insert(*interestC).first;
- pitC->insertOrUpdateInRecord(*face3, 0, *interestC);
- pitC->insertOrUpdateInRecord(*face4, 0, *interestC);
+ pitC->insertOrUpdateInRecord(*face3, *interestC);
+ pitC->insertOrUpdateInRecord(*face4, *interestC);
auto dataD = makeData("/A/B/C/D");
forwarder.onIncomingData(FaceEndpoint(*face3, 0), *dataD);
@@ -346,10 +346,10 @@
// dispatch to the correct strategy
auto interest1 = makeInterest("/A/AYJqayrzF", false, nullopt, 562);
shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
- pit1->insertOrUpdateOutRecord(*face1, 0, *interest1);
+ pit1->insertOrUpdateOutRecord(*face1, *interest1);
auto interest2 = makeInterest("/B/EVyP73ru", false, nullopt, 221);
shared_ptr<pit::Entry> pit2 = pit.insert(*interest2).first;
- pit2->insertOrUpdateOutRecord(*face1, 0, *interest2);
+ pit2->insertOrUpdateOutRecord(*face1, *interest2);
lp::Nack nack1 = makeNack(*interest1, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
@@ -366,7 +366,7 @@
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 1);
// record Nack on PIT out-record
- pit::OutRecordCollection::iterator outRecord1 = pit1->getOutRecord(*face1, 0);
+ pit::OutRecordCollection::iterator outRecord1 = pit1->getOutRecord(*face1);
BOOST_REQUIRE(outRecord1 != pit1->out_end());
BOOST_REQUIRE(outRecord1->getIncomingNack() != nullptr);
BOOST_CHECK_EQUAL(outRecord1->getIncomingNack()->getReason(), lp::NackReason::CONGESTION);
@@ -382,7 +382,7 @@
// drop if no out-record
auto interest4 = makeInterest("/Etab4KpY", false, nullopt, 157);
shared_ptr<pit::Entry> pit4 = pit.insert(*interest4).first;
- pit4->insertOrUpdateOutRecord(*face1, 0, *interest4);
+ pit4->insertOrUpdateOutRecord(*face1, *interest4);
lp::Nack nack4a = makeNack(*interest4, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
@@ -400,7 +400,7 @@
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
// drop if inFace is multi-access
- pit4->insertOrUpdateOutRecord(*face3, 0, *interest4);
+ pit4->insertOrUpdateOutRecord(*face3, *interest4);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
forwarder.onIncomingNack(FaceEndpoint(*face3, 0), nack4a);
@@ -429,7 +429,7 @@
// don't send Nack if there's no in-record
auto interest1 = makeInterest("/fM5IVEtC", false, nullopt, 719);
shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
- pit1->insertOrUpdateInRecord(*face1, 0, *interest1);
+ pit1->insertOrUpdateInRecord(*face1, *interest1);
face2->sentNacks.clear();
forwarder.onOutgoingNack(pit1, FaceEndpoint(*face2, 0), nackHeader);
@@ -438,9 +438,9 @@
// send Nack with correct Nonce
auto interest2a = makeInterest("/Vi8tRm9MG3", false, nullopt, 152);
shared_ptr<pit::Entry> pit2 = pit.insert(*interest2a).first;
- pit2->insertOrUpdateInRecord(*face1, 0, *interest2a);
+ pit2->insertOrUpdateInRecord(*face1, *interest2a);
auto interest2b = makeInterest("/Vi8tRm9MG3", false, nullopt, 808);
- pit2->insertOrUpdateInRecord(*face2, 0, *interest2b);
+ pit2->insertOrUpdateInRecord(*face2, *interest2b);
face1->sentNacks.clear();
forwarder.onOutgoingNack(pit2, FaceEndpoint(*face1, 0), nackHeader);
@@ -449,7 +449,7 @@
BOOST_CHECK_EQUAL(face1->sentNacks.back().getInterest().getNonce(), 152);
// erase in-record
- pit::InRecordCollection::iterator inRecord2a = pit2->getInRecord(*face1, 0);
+ pit::InRecordCollection::iterator inRecord2a = pit2->getInRecord(*face1);
BOOST_CHECK(inRecord2a == pit2->in_end());
// send Nack with correct Nonce
@@ -460,12 +460,12 @@
BOOST_CHECK_EQUAL(face2->sentNacks.back().getInterest().getNonce(), 808);
// erase in-record
- pit::InRecordCollection::iterator inRecord2b = pit2->getInRecord(*face1, 0);
+ pit::InRecordCollection::iterator inRecord2b = pit2->getInRecord(*face1);
BOOST_CHECK(inRecord2b == pit2->in_end());
// don't send Nack to multi-access face
auto interest2c = makeInterest("/Vi8tRm9MG3", false, nullopt, 228);
- pit2->insertOrUpdateInRecord(*face3, 0, *interest2c);
+ pit2->insertOrUpdateInRecord(*face3, *interest2c);
face3->sentNacks.clear();
forwarder.onOutgoingNack(pit1, FaceEndpoint(*face3, 0), nackHeader);
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index b162926..7db3abd 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -75,7 +75,7 @@
shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*face3, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face3, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
@@ -100,7 +100,7 @@
time::steady_clock::TimePoint timeSentLast = time::steady_clock::now();
std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
periodicalRetxFrom4 = [&] {
- pitEntry->insertOrUpdateInRecord(*face3, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face3, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
@@ -127,7 +127,7 @@
shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 1);
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index b2f919a..7b03f4f 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -70,7 +70,7 @@
interest1.setInterestLifetime(8_s);
shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face3, 0, interest1);
+ pitEntry1->insertOrUpdateInRecord(*face3, interest1);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), interest1, pitEntry1);
// forwards to face1 because routing says it's best
@@ -95,7 +95,7 @@
interest2.setInterestLifetime(8_s);
shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
- pitEntry2->insertOrUpdateInRecord(*face3, 0, interest2);
+ pitEntry2->insertOrUpdateInRecord(*face3, interest2);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), interest2, pitEntry2);
// forwards to face2 because it responds previously
@@ -127,7 +127,7 @@
interest1->setInterestLifetime(8_s);
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face3, *interest1);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
this->advanceClocks(1_ms);
@@ -145,7 +145,7 @@
interest2->setInterestLifetime(8_s);
shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
- pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
+ pitEntry2->insertOrUpdateInRecord(*face3, *interest2);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest2, pitEntry2);
// FIB entry is changed before doPropagate executes
@@ -179,7 +179,7 @@
interest1->setInterestLifetime(2_s);
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face3, *interest1);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
limitedIo.run(2 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
@@ -200,7 +200,7 @@
interest2->setInterestLifetime(2_s);
shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
- pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
+ pitEntry2->insertOrUpdateInRecord(*face3, *interest2);
strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest2, pitEntry2);
limitedIo.run(3 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
@@ -231,7 +231,7 @@
interest1->setInterestLifetime(2_s);
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face1, *interest1);
strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
limitedIo.run(1 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
@@ -241,12 +241,12 @@
shared_ptr<Data> data1 = makeData("ndn:/M4mBXCsd");
data1->setFreshnessPeriod(5_ms);
strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
- pitEntry1->deleteOutRecord(*face2, 0);
+ pitEntry1->deleteOutRecord(*face2);
pitEntry1->clearInRecords();
this->advanceClocks(10_ms);
// similar Interest: strategy should still forward it
- pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face1, *interest1);
strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
limitedIo.run(2 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
@@ -273,7 +273,7 @@
// Interest comes from face1, which is sole downstream
shared_ptr<Interest> interest1 = makeInterest("ndn:/tFy5HzUzD4");
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face1, *interest1);
strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index bd705c7..d69448c 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -226,8 +226,8 @@
face1->receiveInterest(*interest, 0);
auto entry = pit.find(*interest);
- entry->insertOrUpdateOutRecord(*face2, 0, *interest);
- entry->insertOrUpdateOutRecord(*face3, 0, *interest);
+ entry->insertOrUpdateOutRecord(*face2, *interest);
+ entry->insertOrUpdateOutRecord(*face3, *interest);
this->advanceClocks(10_ms);
face2->receiveNack(nack, 0);
@@ -388,8 +388,8 @@
face1->receiveInterest(*interest, 0);
auto entry = pit.find(*interest);
- entry->insertOrUpdateOutRecord(*face2, 0, *interest);
- entry->insertOrUpdateOutRecord(*face3, 0, *interest);
+ entry->insertOrUpdateOutRecord(*face2, *interest);
+ entry->insertOrUpdateOutRecord(*face3, *interest);
//pitEntry is not erased after receiving the first Nack
this->advanceClocks(10_ms);
diff --git a/tests/daemon/fw/random-strategy.t.cpp b/tests/daemon/fw/random-strategy.t.cpp
index de62113..84347f5 100644
--- a/tests/daemon/fw/random-strategy.t.cpp
+++ b/tests/daemon/fw/random-strategy.t.cpp
@@ -83,7 +83,7 @@
shared_ptr<Interest> interest = makeInterest("ndn:/BzgFBchqA" + std::to_string(i));
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
}
diff --git a/tests/daemon/fw/retx-suppression.t.cpp b/tests/daemon/fw/retx-suppression.t.cpp
index de4c206..07831ae 100644
--- a/tests/daemon/fw/retx-suppression.t.cpp
+++ b/tests/daemon/fw/retx-suppression.t.cpp
@@ -61,31 +61,31 @@
time::duration_cast<time::nanoseconds>(MIN_RETX_INTERVAL * 0.1);
// @ time 0
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::NEW);
- pitEntry->insertOrUpdateOutRecord(*face3, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face3, *interest);
this->advanceClocks(RETRANSMISSION_10P, 5); // @ time 0.5 interval
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
- pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
this->advanceClocks(RETRANSMISSION_10P, 6); // @ time 1.1 interval
- pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
// but strategy decides not to forward
this->advanceClocks(RETRANSMISSION_10P, 1); // @ time 1.2 interval
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
// retransmission suppress shall still give clearance for forwarding
- pitEntry->insertOrUpdateOutRecord(*face3, 0, *interest); // and strategy forwards
+ pitEntry->insertOrUpdateOutRecord(*face3, *interest); // and strategy forwards
this->advanceClocks(RETRANSMISSION_10P, 2); // @ time 1.4 interval
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
- pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
}
@@ -104,13 +104,13 @@
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
// @ 0ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::NEW);
- pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, *interest);
// suppression interval is 10ms, until 10ms
this->advanceClocks(5_ms); // @ 5ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 10ms, until 10ms
@@ -118,42 +118,42 @@
// note: what happens at *exactly* 10ms does not matter so it's untested,
// because in reality network timing won't be exact:
// incoming Interest is processed either before or after 10ms point
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
- pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, *interest);
// suppression interval is 30ms, until 41ms
this->advanceClocks(25_ms); // @ 36ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 30ms, until 41ms
this->advanceClocks(6_ms); // @ 42ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
// strategy decides not to forward, but suppression interval is increased nevertheless
// suppression interval is 90ms, until 101ms
this->advanceClocks(58_ms); // @ 100ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 90ms, until 101ms
this->advanceClocks(3_ms); // @ 103ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
- pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, *interest);
// suppression interval is 100ms, until 203ms
this->advanceClocks(99_ms); // @ 202ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 100ms, until 203ms
this->advanceClocks(2_ms); // @ 204ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
- pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, *interest);
// suppression interval is 100ms, until 304ms
}
@@ -172,28 +172,28 @@
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
// @ 0ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::NEW);
// Simluate forwarding an interest to face2
- pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, *interest);
this->advanceClocks(5_ms); // @ 5ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::SUPPRESS);
// Return NEW since no outRecord for face1
- pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face1) == RetxSuppressionResult::NEW);
this->advanceClocks(6_ms); // @ 11ms
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::FORWARD);
// Assume interest is sent and increment interval
- rs.incrementIntervalForOutRecord(*pitEntry->getOutRecord(*face2, 0));
+ rs.incrementIntervalForOutRecord(*pitEntry->getOutRecord(*face2));
- pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::SUPPRESS);
}
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index ee0d15d..bfddf0c 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -102,12 +102,12 @@
auto interest1 = makeInterest("/McQYjMbm", false, nullopt, 992);
auto interest2 = makeInterest("/McQYjMbm", false, nullopt, 114);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
- pitEntry->insertOrUpdateInRecord(*this->face2, 0, *interest2);
- pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face2, *interest2);
+ pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
lp::Nack nack3 = makeNack(*interest1, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face3, 0)->setIncomingNack(nack3);
+ pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
auto f = [&] {
this->strategy.afterReceiveNack(FaceEndpoint(*this->face3, 0), nack3, pitEntry);
@@ -140,18 +140,18 @@
auto interest1 = makeInterest("/aS9FAyUV19", 286);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
- pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
- pitEntry->insertOrUpdateOutRecord(*this->face4, 0, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*this->face4, *interest1);
lp::Nack nack3 = makeNack(*interest1, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face3, 0)->setIncomingNack(nack3);
+ pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
this->strategy.afterReceiveNack(FaceEndpoint(*this->face3, 0), nack3, pitEntry);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0); // don't send Nack until all upstreams have Nacked
lp::Nack nack4 = makeNack(*interest1, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face4, 0)->setIncomingNack(nack4);
+ pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
auto f = [&] {
this->strategy.afterReceiveNack(FaceEndpoint(*this->face4, 0), nack4, pitEntry);
@@ -176,18 +176,18 @@
auto interest1 = makeInterest("/sIYw0TXWDj", false, 400_ms, 115);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
- pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
this->advanceClocks(300_ms);
auto interest2 = makeInterest("/sIYw0TXWDj", false, nullopt, 223);
- pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest2);
- pitEntry->insertOrUpdateOutRecord(*this->face4, 0, *interest2);
+ pitEntry->insertOrUpdateInRecord(*this->face1, *interest2);
+ pitEntry->insertOrUpdateOutRecord(*this->face4, *interest2);
this->advanceClocks(200_ms); // face3 has timed out
lp::Nack nack4 = makeNack(*interest2, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face4, 0)->setIncomingNack(nack4);
+ pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
this->strategy.afterReceiveNack(FaceEndpoint(*this->face4, 0), nack4, pitEntry);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0);
@@ -328,18 +328,18 @@
auto interest1 = makeInterest("/F6sEwB24I", false, nullopt, 282);
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest1);
- pitEntry->insertOrUpdateOutRecord(*face3, 0, *interest1);
- pitEntry->insertOrUpdateOutRecord(*face4, 0, *interest1);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*face3, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*face4, *interest1);
lp::Nack nack3 = makeNack(*interest1, Combination::getX());
- pitEntry->getOutRecord(*face3, 0)->setIncomingNack(nack3);
+ pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
strategy.afterReceiveNack(FaceEndpoint(*face3, 0), nack3, pitEntry);
BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0);
lp::Nack nack4 = makeNack(*interest1, Combination::getY());
- pitEntry->getOutRecord(*face4, 0)->setIncomingNack(nack4);
+ pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
strategy.afterReceiveNack(FaceEndpoint(*face4, 0), nack4, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendNackHistory.size(), 1);
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index 4cc687d..4ebd5cf 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -166,7 +166,7 @@
auto interest = makeInterest(scenario.getInterestName());
auto pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->face1, *interest);
auto f = [&] {
this->strategy.afterReceiveInterest(FaceEndpoint(*this->face1, 0), *interest, pitEntry);
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 50f3fde..643e0ee 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -122,7 +122,7 @@
auto interest = makeInterest("/localhost/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->localFace3, 0), *interest, pitEntry); },
@@ -141,7 +141,7 @@
auto interest = makeInterest("/localhost/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->localFace3, 0), *interest, pitEntry); },
@@ -164,7 +164,7 @@
auto interest = makeInterest("/localhost/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->localFace3, 0), *interest, pitEntry); },
@@ -184,7 +184,7 @@
auto interest = makeInterest("/localhop/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->nonLocalFace1, 0), *interest, pitEntry); },
@@ -207,7 +207,7 @@
auto interest = makeInterest("/localhop/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(FaceEndpoint(*this->nonLocalFace1, 0), *interest, pitEntry); },
@@ -228,9 +228,9 @@
auto interest = makeInterest("/localhost/A/1", false, nullopt, 1460);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
lp::Nack nack = makeNack(*interest, lp::NackReason::NO_ROUTE);
- pitEntry->insertOrUpdateOutRecord(*this->localFace4, 0, *interest)->setIncomingNack(nack);
+ pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(FaceEndpoint(*this->localFace4, 0), nack, pitEntry); },
@@ -253,9 +253,9 @@
auto interest = makeInterest("/localhop/A/1", 1377);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
lp::Nack nack = makeNack(*interest, lp::NackReason::NO_ROUTE);
- pitEntry->insertOrUpdateOutRecord(*this->localFace4, 0, *interest)->setIncomingNack(nack);
+ pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(FaceEndpoint(*this->localFace4, 0), nack, pitEntry); },
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index 3ddf8f6..519e8db 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -112,7 +112,7 @@
const Interest& interest) override
{
sendInterestHistory.push_back({pitEntry->getInterest(), egress.face.getId(), interest});
- pitEntry->insertOrUpdateOutRecord(egress.face, egress.endpoint, interest);
+ pitEntry->insertOrUpdateOutRecord(egress.face, interest);
afterAction();
}
@@ -128,7 +128,7 @@
const lp::NackHeader& header) override
{
sendNackHistory.push_back({pitEntry->getInterest(), egress.face.getId(), header});
- pitEntry->deleteInRecord(egress.face, egress.endpoint);
+ pitEntry->deleteInRecord(egress.face);
afterAction();
}
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
index d23bb9b..ae83f78 100644
--- a/tests/daemon/table/cleanup.t.cpp
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -54,10 +54,10 @@
shared_ptr<Interest> interest = makeInterest(name);
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
if ((i & 0x01) != 0) {
- pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, *interest);
}
if ((i & 0x02) != 0) {
- pitEntry->insertOrUpdateOutRecord(*face1, 0, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face1, *interest);
}
}
BOOST_CHECK_EQUAL(fib.size(), 300);
@@ -143,22 +143,22 @@
shared_ptr<Interest> interestA = makeInterest("/A");
shared_ptr<pit::Entry> entryA = pit.insert(*interestA).first;
- entryA->insertOrUpdateInRecord(*face1, 0, *interestA);
- entryA->insertOrUpdateInRecord(*face2, 0, *interestA);
- entryA->insertOrUpdateOutRecord(*face1, 0, *interestA);
- entryA->insertOrUpdateOutRecord(*face2, 0, *interestA);
+ entryA->insertOrUpdateInRecord(*face1, *interestA);
+ entryA->insertOrUpdateInRecord(*face2, *interestA);
+ entryA->insertOrUpdateOutRecord(*face1, *interestA);
+ entryA->insertOrUpdateOutRecord(*face2, *interestA);
// {'/A':[1,2]}
shared_ptr<Interest> interestB = makeInterest("/B");
shared_ptr<pit::Entry> entryB = pit.insert(*interestB).first;
- entryB->insertOrUpdateInRecord(*face1, 0, *interestB);
- entryB->insertOrUpdateOutRecord(*face1, 0, *interestB);
+ entryB->insertOrUpdateInRecord(*face1, *interestB);
+ entryB->insertOrUpdateOutRecord(*face1, *interestB);
// {'/A':[1,2], '/B':[1]}
shared_ptr<Interest> interestC = makeInterest("/C");
shared_ptr<pit::Entry> entryC = pit.insert(*interestC).first;
- entryC->insertOrUpdateInRecord(*face2, 0, *interestC);
- entryC->insertOrUpdateOutRecord(*face2, 0, *interestC);
+ entryC->insertOrUpdateInRecord(*face2, *interestC);
+ entryC->insertOrUpdateOutRecord(*face2, *interestC);
// {'/A':[1,2], '/B':[1], '/C':[2]}
BOOST_CHECK_EQUAL(pit.size(), 3);
diff --git a/tests/daemon/table/pit-entry.t.cpp b/tests/daemon/table/pit-entry.t.cpp
index 221753b..8bdb5fe 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -85,7 +85,7 @@
// insert in-record
auto before1 = time::steady_clock::now();
- InRecordCollection::iterator in1 = entry.insertOrUpdateInRecord(*face1, 0, *interest1);
+ InRecordCollection::iterator in1 = entry.insertOrUpdateInRecord(*face1, *interest1);
auto after1 = time::steady_clock::now();
const InRecordCollection& inRecords2 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords2.size(), 1);
@@ -96,11 +96,11 @@
BOOST_CHECK_LE(in1->getLastRenewed(), after1);
BOOST_CHECK_LE(in1->getExpiry() - in1->getLastRenewed() - interest1->getInterestLifetime(),
after1 - before1);
- BOOST_CHECK(in1 == entry.getInRecord(*face1, 0));
+ BOOST_CHECK(in1 == entry.getInRecord(*face1));
// insert out-record
auto before2 = time::steady_clock::now();
- OutRecordCollection::iterator out1 = entry.insertOrUpdateOutRecord(*face1, 0, *interest1);
+ OutRecordCollection::iterator out1 = entry.insertOrUpdateOutRecord(*face1, *interest1);
auto after2 = time::steady_clock::now();
const OutRecordCollection& outRecords2 = entry.getOutRecords();
BOOST_CHECK_EQUAL(outRecords2.size(), 1);
@@ -111,11 +111,11 @@
BOOST_CHECK_LE(out1->getLastRenewed(), after2);
BOOST_CHECK_LE(out1->getExpiry() - out1->getLastRenewed() - interest1->getInterestLifetime(),
after2 - before2);
- BOOST_CHECK(out1 == entry.getOutRecord(*face1, 0));
+ BOOST_CHECK(out1 == entry.getOutRecord(*face1));
// update in-record
auto before3 = time::steady_clock::now();
- InRecordCollection::iterator in2 = entry.insertOrUpdateInRecord(*face1, 0, *interest2);
+ InRecordCollection::iterator in2 = entry.insertOrUpdateInRecord(*face1, *interest2);
auto after3 = time::steady_clock::now();
const InRecordCollection& inRecords3 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords3.size(), 1);
@@ -125,60 +125,45 @@
BOOST_CHECK_LE(in2->getExpiry() - in2->getLastRenewed() - interest2->getInterestLifetime(),
after3 - before3);
- // insert another in-record (different face)
- InRecordCollection::iterator in3 = entry.insertOrUpdateInRecord(*face2, 0, *interest3);
+ // insert another in-record
+ InRecordCollection::iterator in3 = entry.insertOrUpdateInRecord(*face2, *interest3);
const InRecordCollection& inRecords4 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords4.size(), 2);
BOOST_CHECK_EQUAL(&in3->getFace(), face2.get());
- BOOST_CHECK_EQUAL(in3->getEndpointId(), 0);
-
- // insert another in-record (different endpoint)
- InRecordCollection::iterator in4 = entry.insertOrUpdateInRecord(*face1, 42, *interest4);
- const InRecordCollection& inRecords5 = entry.getInRecords();
- BOOST_CHECK_EQUAL(inRecords5.size(), 3);
- BOOST_CHECK_EQUAL(&in4->getFace(), face1.get());
- BOOST_CHECK_EQUAL(in4->getEndpointId(), 42);
// get in-record
- InRecordCollection::iterator in5 = entry.getInRecord(*face1, 0);
- BOOST_REQUIRE(in5 != entry.in_end());
- BOOST_CHECK_EQUAL(&in5->getFace(), face1.get());
- BOOST_CHECK_EQUAL(in5->getEndpointId(), 0);
- InRecordCollection::iterator in6 = entry.getInRecord(*face1, 42);
- BOOST_REQUIRE(in6 != entry.in_end());
- BOOST_CHECK_EQUAL(&in6->getFace(), face1.get());
- BOOST_CHECK_EQUAL(in6->getEndpointId(), 42);
- BOOST_CHECK(in5 != in6);
+ InRecordCollection::iterator in4 = entry.getInRecord(*face1);
+ BOOST_REQUIRE(in4 != entry.in_end());
+ BOOST_CHECK_EQUAL(&in4->getFace(), face1.get());
// delete in-record
- entry.deleteInRecord(*face1, 0);
- BOOST_CHECK_EQUAL(entry.getInRecords().size(), 2);
- BOOST_CHECK(entry.getInRecord(*face1, 0) == entry.in_end());
- BOOST_CHECK(entry.getInRecord(*face1, 42) != entry.in_end());
+ entry.deleteInRecord(*face1);
+ BOOST_CHECK_EQUAL(entry.getInRecords().size(), 1);
+ BOOST_CHECK(entry.getInRecord(*face1) == entry.in_end());
// clear in-records
entry.clearInRecords();
BOOST_CHECK_EQUAL(entry.getInRecords().size(), 0);
- BOOST_CHECK(entry.getInRecord(*face1, 0) == entry.in_end());
- BOOST_CHECK(entry.getInRecord(*face1, 42) == entry.in_end());
+ BOOST_CHECK(entry.getInRecord(*face1) == entry.in_end());
+ BOOST_CHECK(entry.getInRecord(*face2) == entry.in_end());
// insert another out-record
- OutRecordCollection::iterator out2 = entry.insertOrUpdateOutRecord(*face2, 0, *interest4);
+ OutRecordCollection::iterator out2 = entry.insertOrUpdateOutRecord(*face2, *interest4);
const OutRecordCollection& outRecords3 = entry.getOutRecords();
BOOST_CHECK_EQUAL(outRecords3.size(), 2);
BOOST_CHECK_EQUAL(&out2->getFace(), face2.get());
// get out-record
- OutRecordCollection::iterator out3 = entry.getOutRecord(*face1, 0);
+ OutRecordCollection::iterator out3 = entry.getOutRecord(*face1);
BOOST_REQUIRE(out3 != entry.out_end());
BOOST_CHECK_EQUAL(&out3->getFace(), face1.get());
// delete out-record
- entry.deleteOutRecord(*face2, 0);
+ entry.deleteOutRecord(*face2);
const OutRecordCollection& outRecords4 = entry.getOutRecords();
BOOST_REQUIRE_EQUAL(outRecords4.size(), 1);
BOOST_CHECK_EQUAL(&outRecords4.begin()->getFace(), face1.get());
- BOOST_CHECK(entry.getOutRecord(*face2, 0) == entry.out_end());
+ BOOST_CHECK(entry.getOutRecord(*face2) == entry.out_end());
}
BOOST_AUTO_TEST_CASE(Lifetime)
@@ -187,17 +172,17 @@
auto face = make_shared<DummyFace>();
Entry entry(*interest);
- auto inIt = entry.insertOrUpdateInRecord(*face, 0, *interest);
+ auto inIt = entry.insertOrUpdateInRecord(*face, *interest);
BOOST_CHECK_GT(inIt->getExpiry(), time::steady_clock::now());
- auto outIt = entry.insertOrUpdateOutRecord(*face, 0, *interest);
+ auto outIt = entry.insertOrUpdateOutRecord(*face, *interest);
BOOST_CHECK_GT(outIt->getExpiry(), time::steady_clock::now());
}
BOOST_AUTO_TEST_CASE(OutRecordNack)
{
auto face1 = make_shared<DummyFace>();
- OutRecord outR(*face1, 0);
+ OutRecord outR(*face1);
BOOST_CHECK(outR.getIncomingNack() == nullptr);
auto interest1 = makeInterest("/uWiapGjYL");