pit: add EndpointId field in in-record and out-record
refs: #4842
Change-Id: Id4bca4ad9c2d7c8a2fd975c0b052fb9271b6e47d
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index 8a188e6..1e482c5 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -97,15 +97,15 @@
auto face1 = make_shared<DummyFace>();
auto face2 = make_shared<DummyFace>();
- entry.insertOrUpdateInRecord(*face1, *interest);
+ entry.insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), false);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
- entry.insertOrUpdateInRecord(*face2, *interest);
+ entry.insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), true);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
- entry.insertOrUpdateOutRecord(*face1, *interest);
+ entry.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face1), false);
BOOST_CHECK_EQUAL(canForwardToLegacy(entry, *face2), true);
}
@@ -125,22 +125,22 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry0, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry1(*interest);
- entry1.insertOrUpdateInRecord(*face1, *interest);
+ entry1.insertOrUpdateInRecord(*face1, 0, *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, *interest);
+ entry2.insertOrUpdateOutRecord(*face1, 0, *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, *interest);
- entry3.insertOrUpdateOutRecord(*face1, *interest);
+ entry3.insertOrUpdateInRecord(*face1, 0, *interest);
+ entry3.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 25559, *face1),
DUPLICATE_NONCE_IN_SAME | DUPLICATE_NONCE_OUT_SAME);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 25559, *face2),
@@ -149,8 +149,8 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry3, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry4(*interest);
- entry4.insertOrUpdateInRecord(*face1, *interest);
- entry4.insertOrUpdateInRecord(*face2, *interest);
+ entry4.insertOrUpdateInRecord(*face1, 0, *interest);
+ entry4.insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 25559, *face1),
DUPLICATE_NONCE_IN_SAME | DUPLICATE_NONCE_IN_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 25559, *face2),
@@ -159,8 +159,8 @@
BOOST_CHECK_EQUAL(findDuplicateNonce(entry4, 19004, *face2), DUPLICATE_NONCE_NONE);
pit::Entry entry5(*interest);
- entry5.insertOrUpdateOutRecord(*face1, *interest);
- entry5.insertOrUpdateOutRecord(*face2, *interest);
+ entry5.insertOrUpdateOutRecord(*face1, 0, *interest);
+ entry5.insertOrUpdateOutRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry5, 25559, *face1),
DUPLICATE_NONCE_OUT_SAME | DUPLICATE_NONCE_OUT_OTHER);
BOOST_CHECK_EQUAL(findDuplicateNonce(entry5, 25559, *face2),
@@ -182,15 +182,15 @@
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-Data
- entry.insertOrUpdateOutRecord(*face1, *interest);
+ entry.insertOrUpdateOutRecord(*face1, 0, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
- entry.deleteOutRecord(*face1);
+ entry.deleteOutRecord(*face1, 0);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-Nack
- entry.insertOrUpdateOutRecord(*face2, *interest);
+ entry.insertOrUpdateOutRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
- pit::OutRecordCollection::iterator outR = entry.getOutRecord(*face2);
+ pit::OutRecordCollection::iterator outR = entry.getOutRecord(*face2, 0);
BOOST_REQUIRE(outR != entry.out_end());
lp::Nack nack = makeNack("ndn:/totzXG0d", 29321, lp::NackReason::DUPLICATE);
bool isNackAccepted = outR->setIncomingNack(nack); // Nack arrival
@@ -198,7 +198,7 @@
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
// Interest-timeout
- entry.insertOrUpdateOutRecord(*face3, *interest);
+ entry.insertOrUpdateOutRecord(*face3, 0, *interest);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), true);
this->advanceClocks(ndn::DEFAULT_INTEREST_LIFETIME, 2);
BOOST_CHECK_EQUAL(hasPendingOutRecords(entry), false);
@@ -214,12 +214,12 @@
time::steady_clock::TimePoint before = time::steady_clock::now();
- entry.insertOrUpdateOutRecord(*face1, *interest);
+ entry.insertOrUpdateOutRecord(*face1, 0, *interest);
this->advanceClocks(time::milliseconds(1000));
BOOST_CHECK_EQUAL(getLastOutgoing(entry), before);
- entry.insertOrUpdateOutRecord(*face2, *interest);
+ entry.insertOrUpdateOutRecord(*face2, 0, *interest);
BOOST_CHECK_EQUAL(getLastOutgoing(entry), time::steady_clock::now());
}
diff --git a/tests/daemon/fw/asf-measurements.t.cpp b/tests/daemon/fw/asf-measurements.t.cpp
index ffee3e6..cc4c9e4 100644
--- a/tests/daemon/fw/asf-measurements.t.cpp
+++ b/tests/daemon/fw/asf-measurements.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -100,7 +100,7 @@
shared_ptr<pit::Entry> pitEntry = make_shared<pit::Entry>(*interest);
std::shared_ptr<DummyFace> face = make_shared<DummyFace>();
- pitEntry->insertOrUpdateOutRecord(*face, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face, 0, *interest);
RttEstimator::Duration rtt(50);
this->advanceClocks(time::milliseconds(5), rtt);
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index 5759e68..7e3de91 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -273,7 +273,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));
+ pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(linkAB->getFace(nodeA), 0);
BOOST_CHECK(outRecord != pitEntry->out_end());
@@ -294,13 +294,13 @@
pitEntry = topo.getForwarder(nodeB).getPit().find(*interest);
// Get outRecord associated with face towards D.
- outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
+ outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB), 0);
BOOST_CHECK(outRecord != pitEntry->out_end());
// RTT between B and D
this->advanceClocks(time::milliseconds(5), time::milliseconds(160));
- outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB));
+ outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB), 0);
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 c0d9ba8..933a431 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -90,7 +90,7 @@
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
strategy.afterReceiveInterest(*face1, *interest, pitEntry);
BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
BOOST_CHECK_EQUAL(strategy.sendInterestHistory.back().outFaceId, face2->getId());
@@ -102,7 +102,7 @@
time::steady_clock::TimePoint timeSentLast = time::steady_clock::now();
std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
periodicalRetxFrom4 = [&] {
- pitEntry->insertOrUpdateInRecord(*face4, *interest);
+ pitEntry->insertOrUpdateInRecord(*face4, 0, *interest);
strategy.afterReceiveInterest(*face4, *interest, pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
@@ -134,7 +134,7 @@
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 2);
- pitEntry->insertOrUpdateInRecord(*face5, *interest);
+ pitEntry->insertOrUpdateInRecord(*face5, 0, *interest);
strategy.afterReceiveInterest(*face5, *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 85e77d0..b61c927 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -137,13 +137,13 @@
auto interestA1 = makeInterest("/A");
interestA1->setNonce(8378);
shared_ptr<pit::Entry> pitA = pit.insert(*interestA1).first;
- pitA->insertOrUpdateInRecord(*face1, *interestA1);
+ pitA->insertOrUpdateInRecord(*face1, 0, *interestA1);
auto interestA2 = makeInterest("/A");
interestA2->setNonce(1698);
forwarder.onOutgoingInterest(pitA, *face2, *interestA2);
- pit::OutRecordCollection::iterator outA2 = pitA->getOutRecord(*face2);
+ pit::OutRecordCollection::iterator outA2 = pitA->getOutRecord(*face2, 0);
BOOST_REQUIRE(outA2 != pitA->out_end());
BOOST_CHECK_EQUAL(outA2->getLastNonce(), 1698);
@@ -315,15 +315,15 @@
Pit& pit = forwarder.getPit();
shared_ptr<Interest> interest0 = makeInterest("ndn:/");
shared_ptr<pit::Entry> pit0 = pit.insert(*interest0).first;
- pit0->insertOrUpdateInRecord(*face1, *interest0);
+ pit0->insertOrUpdateInRecord(*face1, 0, *interest0);
shared_ptr<Interest> interestA = makeInterest("ndn:/A");
shared_ptr<pit::Entry> pitA = pit.insert(*interestA).first;
- pitA->insertOrUpdateInRecord(*face1, *interestA);
- pitA->insertOrUpdateInRecord(*face2, *interestA);
+ pitA->insertOrUpdateInRecord(*face1, 0, *interestA);
+ pitA->insertOrUpdateInRecord(*face2, 0, *interestA);
shared_ptr<Interest> interestC = makeInterest("ndn:/A/B/C");
shared_ptr<pit::Entry> pitC = pit.insert(*interestC).first;
- pitC->insertOrUpdateInRecord(*face3, *interestC);
- pitC->insertOrUpdateInRecord(*face4, *interestC);
+ pitC->insertOrUpdateInRecord(*face3, 0, *interestC);
+ pitC->insertOrUpdateInRecord(*face4, 0, *interestC);
shared_ptr<Data> dataD = makeData("ndn:/A/B/C/D");
forwarder.onIncomingData(*face3, *dataD);
@@ -356,10 +356,10 @@
// dispatch to the correct strategy
shared_ptr<Interest> interest1 = makeInterest("/A/AYJqayrzF", 562);
shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
- pit1->insertOrUpdateOutRecord(*face1, *interest1);
+ pit1->insertOrUpdateOutRecord(*face1, 0, *interest1);
shared_ptr<Interest> interest2 = makeInterest("/B/EVyP73ru", 221);
shared_ptr<pit::Entry> pit2 = pit.insert(*interest2).first;
- pit2->insertOrUpdateOutRecord(*face1, *interest2);
+ pit2->insertOrUpdateOutRecord(*face1, 0, *interest2);
lp::Nack nack1 = makeNack("/A/AYJqayrzF", 562, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
@@ -376,7 +376,7 @@
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 1);
// record Nack on PIT out-record
- pit::OutRecordCollection::iterator outRecord1 = pit1->getOutRecord(*face1);
+ pit::OutRecordCollection::iterator outRecord1 = pit1->getOutRecord(*face1, 0);
BOOST_REQUIRE(outRecord1 != pit1->out_end());
BOOST_REQUIRE(outRecord1->getIncomingNack() != nullptr);
BOOST_CHECK_EQUAL(outRecord1->getIncomingNack()->getReason(), lp::NackReason::CONGESTION);
@@ -392,7 +392,7 @@
// drop if no out-record
shared_ptr<Interest> interest4 = makeInterest("/Etab4KpY", 157);
shared_ptr<pit::Entry> pit4 = pit.insert(*interest4).first;
- pit4->insertOrUpdateOutRecord(*face1, *interest4);
+ pit4->insertOrUpdateOutRecord(*face1, 0, *interest4);
lp::Nack nack4a = makeNack("/Etab4KpY", 157, lp::NackReason::CONGESTION);
strategyA.afterReceiveNack_count = 0;
@@ -410,7 +410,7 @@
BOOST_CHECK_EQUAL(strategyB.afterReceiveNack_count, 0);
// drop if inFace is multi-access
- pit4->insertOrUpdateOutRecord(*face3, *interest4);
+ pit4->insertOrUpdateOutRecord(*face3, 0, *interest4);
strategyA.afterReceiveNack_count = 0;
strategyB.afterReceiveNack_count = 0;
forwarder.onIncomingNack(*face3, nack4a);
@@ -439,7 +439,7 @@
// don't send Nack if there's no in-record
shared_ptr<Interest> interest1 = makeInterest("/fM5IVEtC", 719);
shared_ptr<pit::Entry> pit1 = pit.insert(*interest1).first;
- pit1->insertOrUpdateInRecord(*face1, *interest1);
+ pit1->insertOrUpdateInRecord(*face1, 0, *interest1);
face2->sentNacks.clear();
forwarder.onOutgoingNack(pit1, *face2, nackHeader);
@@ -448,9 +448,9 @@
// send Nack with correct Nonce
shared_ptr<Interest> interest2a = makeInterest("/Vi8tRm9MG3", 152);
shared_ptr<pit::Entry> pit2 = pit.insert(*interest2a).first;
- pit2->insertOrUpdateInRecord(*face1, *interest2a);
+ pit2->insertOrUpdateInRecord(*face1, 0, *interest2a);
shared_ptr<Interest> interest2b = makeInterest("/Vi8tRm9MG3", 808);
- pit2->insertOrUpdateInRecord(*face2, *interest2b);
+ pit2->insertOrUpdateInRecord(*face2, 0, *interest2b);
face1->sentNacks.clear();
forwarder.onOutgoingNack(pit2, *face1, nackHeader);
@@ -459,7 +459,7 @@
BOOST_CHECK_EQUAL(face1->sentNacks.back().getInterest().getNonce(), 152);
// erase in-record
- pit::InRecordCollection::iterator inRecord2a = pit2->getInRecord(*face1);
+ pit::InRecordCollection::iterator inRecord2a = pit2->getInRecord(*face1, 0);
BOOST_CHECK(inRecord2a == pit2->in_end());
// send Nack with correct Nonce
@@ -470,12 +470,12 @@
BOOST_CHECK_EQUAL(face2->sentNacks.back().getInterest().getNonce(), 808);
// erase in-record
- pit::InRecordCollection::iterator inRecord2b = pit2->getInRecord(*face1);
+ pit::InRecordCollection::iterator inRecord2b = pit2->getInRecord(*face1, 0);
BOOST_CHECK(inRecord2b == pit2->in_end());
// don't send Nack to multi-access face
shared_ptr<Interest> interest2c = makeInterest("/Vi8tRm9MG3", 228);
- pit2->insertOrUpdateInRecord(*face3, *interest2c);
+ pit2->insertOrUpdateInRecord(*face3, 0, *interest2c);
face3->sentNacks.clear();
forwarder.onOutgoingNack(pit1, *face3, nackHeader);
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index 04de9b2..09eeac7 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -76,7 +76,7 @@
shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*face3, *interest);
+ pitEntry->insertOrUpdateInRecord(*face3, 0, *interest);
strategy.afterReceiveInterest(*face3, *interest, pitEntry);
BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
@@ -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(*face3, *interest);
+ pitEntry->insertOrUpdateInRecord(*face3, 0, *interest);
strategy.afterReceiveInterest(*face3, *interest, pitEntry);
size_t nSent = strategy.sendInterestHistory.size();
@@ -128,7 +128,7 @@
shared_ptr<Interest> interest = makeInterest("ndn:/H0D6i5fc");
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
strategy.afterReceiveInterest(*face1, *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 38a2401..fed914c 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -74,7 +74,7 @@
interest1.setInterestLifetime(time::milliseconds(8000));
shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face3, interest1);
+ pitEntry1->insertOrUpdateInRecord(*face3, 0, interest1);
strategy.afterReceiveInterest(*face3, interest1, pitEntry1);
// forwards to face1 because routing says it's best
@@ -99,7 +99,7 @@
interest2.setInterestLifetime(time::milliseconds(8000));
shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
- pitEntry2->insertOrUpdateInRecord(*face3, interest2);
+ pitEntry2->insertOrUpdateInRecord(*face3, 0, interest2);
strategy.afterReceiveInterest(*face3, interest2, pitEntry2);
// forwards to face2 because it responds previously
@@ -131,7 +131,7 @@
interest1->setInterestLifetime(time::milliseconds(8000));
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face3, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
strategy.afterReceiveInterest(*face3, *interest1, pitEntry1);
this->advanceClocks(time::milliseconds(1));
@@ -149,7 +149,7 @@
interest2->setInterestLifetime(time::milliseconds(8000));
shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
- pitEntry2->insertOrUpdateInRecord(*face3, *interest2);
+ pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
strategy.afterReceiveInterest(*face3, *interest2, pitEntry2);
// FIB entry is changed before doPropagate executes
@@ -183,7 +183,7 @@
interest1->setInterestLifetime(time::milliseconds(2000));
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face3, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
strategy.afterReceiveInterest(*face3, *interest1, pitEntry1);
limitedIo.run(2 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
@@ -205,7 +205,7 @@
interest2->setInterestLifetime(time::milliseconds(2000));
shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
- pitEntry2->insertOrUpdateInRecord(*face3, *interest2);
+ pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
strategy.afterReceiveInterest(*face3, *interest2, pitEntry2);
limitedIo.run(3 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
@@ -237,7 +237,7 @@
interest1->setInterestLifetime(time::milliseconds(2000));
shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
- pitEntry1->insertOrUpdateInRecord(*face1, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
strategy.afterReceiveInterest(*face1, *interest1, pitEntry1);
limitedIo.run(1 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
@@ -248,12 +248,12 @@
shared_ptr<Data> data1 = makeData("ndn:/M4mBXCsd");
data1->setFreshnessPeriod(time::milliseconds(5));
strategy.beforeSatisfyInterest(pitEntry1, *face2, *data1);
- pitEntry1->deleteOutRecord(*face2);
+ pitEntry1->deleteOutRecord(*face2, 0);
pitEntry1->clearInRecords();
this->advanceClocks(time::milliseconds(10));
// similar Interest: strategy should still forward it
- pitEntry1->insertOrUpdateInRecord(*face1, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
strategy.afterReceiveInterest(*face1, *interest1, pitEntry1);
limitedIo.run(2 - strategy.sendInterestHistory.size(),
time::milliseconds(2000), time::milliseconds(10));
@@ -281,7 +281,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, *interest1);
+ pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
strategy.afterReceiveInterest(*face1, *interest1, pitEntry1);
diff --git a/tests/daemon/fw/pit-expiry.t.cpp b/tests/daemon/fw/pit-expiry.t.cpp
index 07c79c9..b8c0418 100644
--- a/tests/daemon/fw/pit-expiry.t.cpp
+++ b/tests/daemon/fw/pit-expiry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -227,8 +227,8 @@
face1->receiveInterest(*interest);
auto entry = pit.find(*interest);
- entry->insertOrUpdateOutRecord(*face2, *interest);
- entry->insertOrUpdateOutRecord(*face3, *interest);
+ entry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ entry->insertOrUpdateOutRecord(*face3, 0, *interest);
this->advanceClocks(10_ms);
face2->receiveNack(nack);
@@ -394,8 +394,8 @@
face1->receiveInterest(*interest);
auto entry = pit.find(*interest);
- entry->insertOrUpdateOutRecord(*face2, *interest);
- entry->insertOrUpdateOutRecord(*face3, *interest);
+ entry->insertOrUpdateOutRecord(*face2, 0, *interest);
+ entry->insertOrUpdateOutRecord(*face3, 0, *interest);
//pitEntry is not erased after receiving the first Nack
this->advanceClocks(10_ms);
diff --git a/tests/daemon/fw/retx-suppression.t.cpp b/tests/daemon/fw/retx-suppression.t.cpp
index dce6da9..c96ac67 100644
--- a/tests/daemon/fw/retx-suppression.t.cpp
+++ b/tests/daemon/fw/retx-suppression.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -60,31 +60,31 @@
time::duration_cast<time::nanoseconds>(MIN_RETX_INTERVAL * 0.1);
// @ time 0
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::NEW);
- pitEntry->insertOrUpdateOutRecord(*face3, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face3, 0, *interest);
this->advanceClocks(RETRANSMISSION_10P, 5); // @ time 0.5 interval
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
- pitEntry->insertOrUpdateInRecord(*face2, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
this->advanceClocks(RETRANSMISSION_10P, 6); // @ time 1.1 interval
- pitEntry->insertOrUpdateInRecord(*face2, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, 0, *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, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
// retransmission suppress shall still give clearance for forwarding
- pitEntry->insertOrUpdateOutRecord(*face3, *interest); // and strategy forwards
+ pitEntry->insertOrUpdateOutRecord(*face3, 0, *interest); // and strategy forwards
this->advanceClocks(RETRANSMISSION_10P, 2); // @ time 1.4 interval
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
- pitEntry->insertOrUpdateInRecord(*face2, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
}
@@ -103,13 +103,13 @@
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
// @ 0ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::NEW);
- pitEntry->insertOrUpdateOutRecord(*face2, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
// suppression interval is 10ms, until 10ms
this->advanceClocks(time::milliseconds(5)); // @ 5ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 10ms, until 10ms
@@ -117,42 +117,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, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
- pitEntry->insertOrUpdateOutRecord(*face2, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
// suppression interval is 30ms, until 41ms
this->advanceClocks(time::milliseconds(25)); // @ 36ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 30ms, until 41ms
this->advanceClocks(time::milliseconds(6)); // @ 42ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *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(time::milliseconds(58)); // @ 100ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 90ms, until 101ms
this->advanceClocks(time::milliseconds(3)); // @ 103ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
- pitEntry->insertOrUpdateOutRecord(*face2, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
// suppression interval is 100ms, until 203ms
this->advanceClocks(time::milliseconds(99)); // @ 202ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
// suppression interval is 100ms, until 203ms
this->advanceClocks(time::milliseconds(2)); // @ 204ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
- pitEntry->insertOrUpdateOutRecord(*face2, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
// suppression interval is 100ms, until 304ms
}
@@ -171,28 +171,28 @@
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
// @ 0ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::NEW);
// Simluate forwarding an interest to face2
- pitEntry->insertOrUpdateOutRecord(*face2, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
this->advanceClocks(time::milliseconds(5)); // @ 5ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::SUPPRESS);
// Return NEW since no outRecord for face1
- pitEntry->insertOrUpdateInRecord(*face2, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face1) == RetxSuppressionResult::NEW);
this->advanceClocks(time::milliseconds(6)); // @ 11ms
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::FORWARD);
// Assume interest is sent and increment interval
- rs.incrementIntervalForOutRecord(*pitEntry->getOutRecord(*face2));
+ rs.incrementIntervalForOutRecord(*pitEntry->getOutRecord(*face2, 0));
- pitEntry->insertOrUpdateInRecord(*face2, *interest);
+ pitEntry->insertOrUpdateInRecord(*face2, 0, *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 aea8d88..ed2e9e1 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -103,12 +103,12 @@
shared_ptr<Interest> interest1 = makeInterest("/McQYjMbm", 992);
shared_ptr<Interest> interest2 = makeInterest("/McQYjMbm", 114);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
- pitEntry->insertOrUpdateInRecord(*this->face2, *interest2);
- pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face2, 0, *interest2);
+ pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
lp::Nack nack3 = makeNack("/McQYjMbm", 992, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
+ pitEntry->getOutRecord(*this->face3, 0)->setIncomingNack(nack3);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(*this->face3, nack3, pitEntry); },
@@ -137,18 +137,18 @@
shared_ptr<Interest> interest1 = makeInterest("/aS9FAyUV19", 286);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
- pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
- pitEntry->insertOrUpdateOutRecord(*this->face4, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*this->face4, 0, *interest1);
lp::Nack nack3 = makeNack("/aS9FAyUV19", 286, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face3)->setIncomingNack(nack3);
+ pitEntry->getOutRecord(*this->face3, 0)->setIncomingNack(nack3);
this->strategy.afterReceiveNack(*this->face3, nack3, pitEntry);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0); // don't send Nack until all upstreams have Nacked
lp::Nack nack4 = makeNack("/aS9FAyUV19", 286, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
+ pitEntry->getOutRecord(*this->face4, 0)->setIncomingNack(nack4);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(*this->face4, nack4, pitEntry); },
this->limitedIo));
@@ -171,18 +171,18 @@
shared_ptr<Interest> interest1 = makeInterest("/sIYw0TXWDj", 115);
interest1->setInterestLifetime(time::milliseconds(400));
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, *interest1);
- pitEntry->insertOrUpdateOutRecord(*this->face3, *interest1);
+ pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
this->advanceClocks(time::milliseconds(300));
shared_ptr<Interest> interest2 = makeInterest("/sIYw0TXWDj", 223);
- pitEntry->insertOrUpdateInRecord(*this->face1, *interest2);
- pitEntry->insertOrUpdateOutRecord(*this->face4, *interest2);
+ pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest2);
+ pitEntry->insertOrUpdateOutRecord(*this->face4, 0, *interest2);
this->advanceClocks(time::milliseconds(200)); // face3 has timed out
lp::Nack nack4 = makeNack("/sIYw0TXWDj", 223, lp::NackReason::CONGESTION);
- pitEntry->getOutRecord(*this->face4)->setIncomingNack(nack4);
+ pitEntry->getOutRecord(*this->face4, 0)->setIncomingNack(nack4);
this->strategy.afterReceiveNack(*this->face4, nack4, pitEntry);
BOOST_CHECK_EQUAL(this->strategy.sendNackHistory.size(), 0);
@@ -323,18 +323,18 @@
shared_ptr<Interest> interest1 = makeInterest("/F6sEwB24I", 282);
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest1).first;
- pitEntry->insertOrUpdateInRecord(*face1, *interest1);
- pitEntry->insertOrUpdateOutRecord(*face3, *interest1);
- pitEntry->insertOrUpdateOutRecord(*face4, *interest1);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*face3, 0, *interest1);
+ pitEntry->insertOrUpdateOutRecord(*face4, 0, *interest1);
lp::Nack nack3 = makeNack(*interest1, Combination::getX());
- pitEntry->getOutRecord(*face3)->setIncomingNack(nack3);
+ pitEntry->getOutRecord(*face3, 0)->setIncomingNack(nack3);
strategy.afterReceiveNack(*face3, nack3, pitEntry);
BOOST_CHECK_EQUAL(strategy.sendNackHistory.size(), 0);
lp::Nack nack4 = makeNack(*interest1, Combination::getY());
- pitEntry->getOutRecord(*face4)->setIncomingNack(nack4);
+ pitEntry->getOutRecord(*face4, 0)->setIncomingNack(nack4);
strategy.afterReceiveNack(*face4, 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 8183caf..4719c5e 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -161,7 +161,7 @@
shared_ptr<Interest> interest = makeInterest(scenario.getInterestName());
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*this->face1, *interest, pitEntry); },
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index bd59838..029ab0e 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -122,7 +122,7 @@
shared_ptr<Interest> interest = makeInterest("/localhost/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*this->localFace3, *interest, pitEntry); },
@@ -141,7 +141,7 @@
shared_ptr<Interest> interest = makeInterest("/localhost/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*this->localFace3, *interest, pitEntry); },
@@ -164,7 +164,7 @@
shared_ptr<Interest> interest = makeInterest("/localhost/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*this->localFace3, *interest, pitEntry); },
@@ -184,7 +184,7 @@
shared_ptr<Interest> interest = makeInterest("/localhop/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, 0, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*this->nonLocalFace1, *interest, pitEntry); },
@@ -207,7 +207,7 @@
shared_ptr<Interest> interest = makeInterest("/localhop/A/1");
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, 0, *interest);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveInterest(*this->nonLocalFace1, *interest, pitEntry); },
@@ -228,9 +228,9 @@
shared_ptr<Interest> interest = makeInterest("/localhost/A/1", 1460);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->localFace3, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->localFace3, 0, *interest);
lp::Nack nack = makeNack("/localhost/A/1", 1460, lp::NackReason::NO_ROUTE);
- pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
+ pitEntry->insertOrUpdateOutRecord(*this->localFace4, 0, *interest)->setIncomingNack(nack);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(*this->localFace4, nack, pitEntry); },
@@ -253,9 +253,9 @@
shared_ptr<Interest> interest = makeInterest("/localhop/A/1", 1377);
shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest).first;
- pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, *interest);
+ pitEntry->insertOrUpdateInRecord(*this->nonLocalFace1, 0, *interest);
lp::Nack nack = makeNack("/localhop/A/1", 1377, lp::NackReason::NO_ROUTE);
- pitEntry->insertOrUpdateOutRecord(*this->localFace4, *interest)->setIncomingNack(nack);
+ pitEntry->insertOrUpdateOutRecord(*this->localFace4, 0, *interest)->setIncomingNack(nack);
BOOST_REQUIRE(this->strategy.waitForAction(
[&] { this->strategy.afterReceiveNack(*this->localFace4, nack, pitEntry); },
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index 0d76d76..c842327 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -110,7 +110,7 @@
const Interest& interest) override
{
sendInterestHistory.push_back({pitEntry->getInterest(), outFace.getId(), interest});
- pitEntry->insertOrUpdateOutRecord(outFace, interest);
+ pitEntry->insertOrUpdateOutRecord(outFace, 0, interest);
afterAction();
}
@@ -126,7 +126,7 @@
const lp::NackHeader& header) override
{
sendNackHistory.push_back({pitEntry->getInterest(), outFace.getId(), header});
- pitEntry->deleteInRecord(outFace);
+ pitEntry->deleteInRecord(outFace, 0);
afterAction();
}
diff --git a/tests/daemon/table/cleanup.t.cpp b/tests/daemon/table/cleanup.t.cpp
index 3365a50..c6bd772 100644
--- a/tests/daemon/table/cleanup.t.cpp
+++ b/tests/daemon/table/cleanup.t.cpp
@@ -55,10 +55,10 @@
shared_ptr<Interest> interest = makeInterest(name);
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
if ((i & 0x01) != 0) {
- pitEntry->insertOrUpdateInRecord(*face1, *interest);
+ pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
}
if ((i & 0x02) != 0) {
- pitEntry->insertOrUpdateOutRecord(*face1, *interest);
+ pitEntry->insertOrUpdateOutRecord(*face1, 0, *interest);
}
}
BOOST_CHECK_EQUAL(fib.size(), 300);
@@ -144,22 +144,22 @@
shared_ptr<Interest> interestA = makeInterest("/A");
shared_ptr<pit::Entry> entryA = pit.insert(*interestA).first;
- entryA->insertOrUpdateInRecord(*face1, *interestA);
- entryA->insertOrUpdateInRecord(*face2, *interestA);
- entryA->insertOrUpdateOutRecord(*face1, *interestA);
- entryA->insertOrUpdateOutRecord(*face2, *interestA);
+ entryA->insertOrUpdateInRecord(*face1, 0, *interestA);
+ entryA->insertOrUpdateInRecord(*face2, 0, *interestA);
+ entryA->insertOrUpdateOutRecord(*face1, 0, *interestA);
+ entryA->insertOrUpdateOutRecord(*face2, 0, *interestA);
// {'/A':[1,2]}
shared_ptr<Interest> interestB = makeInterest("/B");
shared_ptr<pit::Entry> entryB = pit.insert(*interestB).first;
- entryB->insertOrUpdateInRecord(*face1, *interestB);
- entryB->insertOrUpdateOutRecord(*face1, *interestB);
+ entryB->insertOrUpdateInRecord(*face1, 0, *interestB);
+ entryB->insertOrUpdateOutRecord(*face1, 0, *interestB);
// {'/A':[1,2], '/B':[1]}
shared_ptr<Interest> interestC = makeInterest("/C");
shared_ptr<pit::Entry> entryC = pit.insert(*interestC).first;
- entryC->insertOrUpdateInRecord(*face2, *interestC);
- entryC->insertOrUpdateOutRecord(*face2, *interestC);
+ entryC->insertOrUpdateInRecord(*face2, 0, *interestC);
+ entryC->insertOrUpdateOutRecord(*face2, 0, *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 effb624..d4234ad 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -94,7 +94,7 @@
// insert in-record
time::steady_clock::TimePoint before1 = time::steady_clock::now();
- InRecordCollection::iterator in1 = entry.insertOrUpdateInRecord(*face1, *interest1);
+ InRecordCollection::iterator in1 = entry.insertOrUpdateInRecord(*face1, 0, *interest1);
time::steady_clock::TimePoint after1 = time::steady_clock::now();
const InRecordCollection& inRecords2 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords2.size(), 1);
@@ -106,11 +106,11 @@
BOOST_CHECK_LE(in1->getExpiry() - in1->getLastRenewed()
- interest1->getInterestLifetime(),
(after1 - before1));
- BOOST_CHECK(in1 == entry.getInRecord(*face1));
+ BOOST_CHECK(in1 == entry.getInRecord(*face1, 0));
// insert out-record
time::steady_clock::TimePoint before2 = time::steady_clock::now();
- OutRecordCollection::iterator out1 = entry.insertOrUpdateOutRecord(*face1, *interest1);
+ OutRecordCollection::iterator out1 = entry.insertOrUpdateOutRecord(*face1, 0, *interest1);
time::steady_clock::TimePoint after2 = time::steady_clock::now();
const OutRecordCollection& outRecords2 = entry.getOutRecords();
BOOST_CHECK_EQUAL(outRecords2.size(), 1);
@@ -122,11 +122,11 @@
BOOST_CHECK_LE(out1->getExpiry() - out1->getLastRenewed()
- interest1->getInterestLifetime(),
(after2 - before2));
- BOOST_CHECK(out1 == entry.getOutRecord(*face1));
+ BOOST_CHECK(out1 == entry.getOutRecord(*face1, 0));
// update in-record
time::steady_clock::TimePoint before3 = time::steady_clock::now();
- InRecordCollection::iterator in2 = entry.insertOrUpdateInRecord(*face1, *interest2);
+ InRecordCollection::iterator in2 = entry.insertOrUpdateInRecord(*face1, 0, *interest2);
time::steady_clock::TimePoint after3 = time::steady_clock::now();
const InRecordCollection& inRecords3 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords3.size(), 1);
@@ -138,13 +138,13 @@
(after3 - before3));
// insert another in-record
- InRecordCollection::iterator in3 = entry.insertOrUpdateInRecord(*face2, *interest3);
+ InRecordCollection::iterator in3 = entry.insertOrUpdateInRecord(*face2, 0, *interest3);
const InRecordCollection& inRecords4 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords4.size(), 2);
BOOST_CHECK_EQUAL(&in3->getFace(), face2.get());
// get in-record
- InRecordCollection::iterator in4 = entry.getInRecord(*face1);
+ InRecordCollection::iterator in4 = entry.getInRecord(*face1, 0);
BOOST_REQUIRE(in4 != entry.in_end());
BOOST_CHECK_EQUAL(&in4->getFace(), face1.get());
@@ -152,26 +152,26 @@
entry.clearInRecords();
const InRecordCollection& inRecords5 = entry.getInRecords();
BOOST_CHECK_EQUAL(inRecords5.size(), 0);
- BOOST_CHECK(entry.getInRecord(*face1) == entry.in_end());
+ BOOST_CHECK(entry.getInRecord(*face1, 0) == entry.in_end());
// insert another out-record
OutRecordCollection::iterator out2 =
- entry.insertOrUpdateOutRecord(*face2, *interest4);
+ entry.insertOrUpdateOutRecord(*face2, 0, *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);
+ OutRecordCollection::iterator out3 = entry.getOutRecord(*face1, 0);
BOOST_REQUIRE(out3 != entry.out_end());
BOOST_CHECK_EQUAL(&out3->getFace(), face1.get());
// delete out-record
- entry.deleteOutRecord(*face2);
+ entry.deleteOutRecord(*face2, 0);
const OutRecordCollection& outRecords4 = entry.getOutRecords();
BOOST_REQUIRE_EQUAL(outRecords4.size(), 1);
BOOST_CHECK_EQUAL(&outRecords4.begin()->getFace(), face1.get());
- BOOST_CHECK(entry.getOutRecord(*face2) == entry.out_end());
+ BOOST_CHECK(entry.getOutRecord(*face2, 0) == entry.out_end());
}
BOOST_AUTO_TEST_CASE(Lifetime)
@@ -181,17 +181,17 @@
shared_ptr<Face> face = make_shared<DummyFace>();
Entry entry(*interest);
- InRecordCollection::iterator inIt = entry.insertOrUpdateInRecord(*face, *interest);
+ InRecordCollection::iterator inIt = entry.insertOrUpdateInRecord(*face, 0, *interest);
BOOST_CHECK_GT(inIt->getExpiry(), time::steady_clock::now());
- OutRecordCollection::iterator outIt = entry.insertOrUpdateOutRecord(*face, *interest);
+ OutRecordCollection::iterator outIt = entry.insertOrUpdateOutRecord(*face, 0, *interest);
BOOST_CHECK_GT(outIt->getExpiry(), time::steady_clock::now());
}
BOOST_AUTO_TEST_CASE(OutRecordNack)
{
shared_ptr<Face> face1 = make_shared<DummyFace>();
- OutRecord outR(*face1);
+ OutRecord outR(*face1, 0);
BOOST_CHECK(outR.getIncomingNack() == nullptr);
shared_ptr<Interest> interest1 = makeInterest("ndn:/uWiapGjYL");