pit: add EndpointId field in in-record and out-record
refs: #4842
Change-Id: Id4bca4ad9c2d7c8a2fd975c0b052fb9271b6e47d
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");