pit: add EndpointId field in in-record and out-record
refs: #4842
Change-Id: Id4bca4ad9c2d7c8a2fd975c0b052fb9271b6e47d
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index 13560a9..b07211b 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -176,7 +176,7 @@
return;
}
- auto inRecord = pitEntry->getInRecord(*inFace);
+ auto inRecord = pitEntry->getInRecord(*inFace, 0);
BOOST_ASSERT(inRecord != pitEntry->in_end());
// in-record is erased only if Interest is satisfied, and RTO timer should have been cancelled
// note: if this strategy is extended to send Nacks, that would also erase in-record,
@@ -225,7 +225,7 @@
return;
}
- auto outRecord = pitEntry->getOutRecord(inFace);
+ auto outRecord = pitEntry->getOutRecord(inFace, 0);
if (outRecord == pitEntry->out_end()) { // no out-record
NFD_LOG_DEBUG(pitEntry->getInterest() << " dataFrom " << inFace.getId() <<
" no-out-record");
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index 6302020..17771e0 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -114,7 +114,7 @@
FaceInfo::recordRtt(const shared_ptr<pit::Entry>& pitEntry, const Face& inFace)
{
// Calculate RTT
- pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(inFace);
+ pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(inFace, 0);
if (outRecord == pitEntry->out_end()) { // no out-record
NFD_LOG_TRACE(pitEntry->getInterest() << " dataFrom inFace=" << inFace.getId() << " no-out-record");
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index 03f27dc..7a1f063 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -88,7 +88,7 @@
if (wantUnused) {
// nexthop must not have unexpired out-record
- auto outRecord = pitEntry->getOutRecord(outFace);
+ auto outRecord = pitEntry->getOutRecord(outFace, 0);
if (outRecord != pitEntry->out_end() && outRecord->getExpiry() > now) {
return false;
}
@@ -112,7 +112,7 @@
if (!isNextHopEligible(inFace, interest, *it, pitEntry))
continue;
- auto outRecord = pitEntry->getOutRecord(it->getFace());
+ auto outRecord = pitEntry->getOutRecord(it->getFace(), 0);
BOOST_ASSERT(outRecord != pitEntry->out_end());
if (outRecord->getLastRenewed() < earliestRenewed) {
found = it;
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index b53b82d..f4e5ac9 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -176,7 +176,7 @@
++m_counters.nCsMisses;
// insert in-record
- pitEntry->insertOrUpdateInRecord(const_cast<Face&>(inFace), interest);
+ pitEntry->insertOrUpdateInRecord(const_cast<Face&>(inFace), 0, interest);
// set PIT expiry timer to the time that the last PIT in-record expires
auto lastExpiring = std::max_element(pitEntry->in_begin(), pitEntry->in_end(), &compare_InRecord_expiry);
@@ -230,7 +230,7 @@
" interest=" << pitEntry->getName());
// insert out-record
- pitEntry->insertOrUpdateOutRecord(outFace, interest);
+ pitEntry->insertOrUpdateOutRecord(outFace, 0, interest);
// send Interest
outFace.sendInterest(interest);
@@ -309,7 +309,7 @@
this->insertDeadNonceList(*pitEntry, &inFace);
// delete PIT entry's out-record
- pitEntry->deleteOutRecord(inFace);
+ pitEntry->deleteOutRecord(inFace, 0);
}
// when more than one PIT entry is matched, trigger strategy: before satisfy Interest,
// and send Data to all matched out faces
@@ -343,7 +343,7 @@
// clear PIT entry's in and out records
pitEntry->clearInRecords();
- pitEntry->deleteOutRecord(inFace);
+ pitEntry->deleteOutRecord(inFace, 0);
}
// foreach pending downstream
@@ -425,7 +425,7 @@
}
// has out-record?
- pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(inFace);
+ pit::OutRecordCollection::iterator outRecord = pitEntry->getOutRecord(inFace, 0);
// if no out-record found, drop
if (outRecord == pitEntry->out_end()) {
NFD_LOG_DEBUG("onIncomingNack face=" << inFace.getId() <<
@@ -472,7 +472,7 @@
}
// has in-record?
- pit::InRecordCollection::iterator inRecord = pitEntry->getInRecord(outFace);
+ pit::InRecordCollection::iterator inRecord = pitEntry->getInRecord(outFace, 0);
// if no in-record found, drop
if (inRecord == pitEntry->in_end()) {
@@ -499,7 +499,7 @@
nackPkt.setHeader(nack);
// erase in-record
- pitEntry->deleteInRecord(outFace);
+ pitEntry->deleteInRecord(outFace, 0);
// send Nack on face
const_cast<Face&>(outFace).sendNack(nackPkt);
@@ -548,7 +548,7 @@
}
else {
// insert outgoing Nonce of a specific face
- auto outRecord = pitEntry.getOutRecord(*upstream);
+ auto outRecord = pitEntry.getOutRecord(*upstream, 0);
if (outRecord != pitEntry.getOutRecords().end()) {
m_deadNonceList.add(pitEntry.getName(), outRecord->getLastNonce());
}
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index 71fa7c1..7732e09 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -95,7 +95,7 @@
<< " pitEntry-to=" << outFace.getId());
if (suppressResult == RetxSuppressionResult::FORWARD) {
- m_retxSuppression.incrementIntervalForOutRecord(*pitEntry->getOutRecord(outFace));
+ m_retxSuppression.incrementIntervalForOutRecord(*pitEntry->getOutRecord(outFace, 0));
}
++nEligibleNextHops;
}
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 9a16897..778ed2b 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -143,7 +143,7 @@
if (pitEntry == nullptr) {
return;
}
- auto inRecord = pitEntry->getInRecord(*inFace);
+ auto inRecord = pitEntry->getInRecord(*inFace, 0);
if (inRecord == pitEntry->in_end()) {
return;
}
diff --git a/daemon/fw/process-nack-traits.cpp b/daemon/fw/process-nack-traits.cpp
index 584bf70..4b2d091 100644
--- a/daemon/fw/process-nack-traits.cpp
+++ b/daemon/fw/process-nack-traits.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,
@@ -56,7 +56,7 @@
if (nOutRecordsNotNacked == 1) {
BOOST_ASSERT(lastFaceNotNacked != nullptr);
- pit::InRecordCollection::iterator inR = pitEntry->getInRecord(*lastFaceNotNacked);
+ pit::InRecordCollection::iterator inR = pitEntry->getInRecord(*lastFaceNotNacked, 0);
if (inR != pitEntry->in_end()) {
// one out-record not Nacked, which is also a downstream
NFD_LOG_DEBUG(nack.getInterest() << " nack-from=" << inFace.getId() <<
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index b110588..1275dd9 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.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,
@@ -95,7 +95,7 @@
RetxSuppressionExponential::decidePerUpstream(pit::Entry& pitEntry, Face& outFace)
{
// NEW if outRecord for the face does not exist
- auto outRecord = pitEntry.getOutRecord(outFace);
+ auto outRecord = pitEntry.getOutRecord(outFace, 0);
if (outRecord == pitEntry.out_end()) {
return RetxSuppressionResult::NEW;
}
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index 174dca4..42f0f22 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -73,7 +73,7 @@
const fib::NextHopList& nexthops = fibEntry.getNextHops();
bool isNonDiscovery = interest.getTag<lp::NonDiscoveryTag>() != nullptr;
- auto inRecordInfo = pitEntry->getInRecord(inFace)->insertStrategyInfo<InRecordInfo>().first;
+ auto inRecordInfo = pitEntry->getInRecord(inFace, 0)->insertStrategyInfo<InRecordInfo>().first;
if (isNonDiscovery) { // "non-discovery" Interest
inRecordInfo->isNonDiscoveryInterest = true;
if (nexthops.empty()) { // return NACK if no matching FIB entry exists
@@ -103,7 +103,7 @@
SelfLearningStrategy::afterReceiveData(const shared_ptr<pit::Entry>& pitEntry,
const Face& inFace, const Data& data)
{
- OutRecordInfo* outRecordInfo = pitEntry->getOutRecord(inFace)->getStrategyInfo<OutRecordInfo>();
+ OutRecordInfo* outRecordInfo = pitEntry->getOutRecord(inFace, 0)->getStrategyInfo<OutRecordInfo>();
if (outRecordInfo && outRecordInfo->isNonDiscoveryInterest) { // outgoing Interest was non-discovery
if (!needPrefixAnn(pitEntry)) { // no need to attach a PA (common cases)
sendDataToAll(pitEntry, inFace, data);
@@ -146,7 +146,7 @@
continue;
}
this->sendInterest(pitEntry, outFace, interest);
- pitEntry->getOutRecord(outFace)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = false;
+ pitEntry->getOutRecord(outFace, 0)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = false;
NFD_LOG_DEBUG("send discovery Interest=" << interest << " from="
<< inFace.getId() << " to=" << outFace.getId());
}
@@ -164,7 +164,7 @@
continue;
}
this->sendInterest(pitEntry, outFace, interest);
- pitEntry->getOutRecord(outFace)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = true;
+ pitEntry->getOutRecord(outFace, 0)->insertStrategyInfo<OutRecordInfo>().first->isNonDiscoveryInterest = true;
NFD_LOG_DEBUG("send non-discovery Interest=" << interest << " from="
<< inFace.getId() << " to=" << outFace.getId());
}
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 3f364ea..378e554 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -199,7 +199,7 @@
// delete the PIT entry's in-record based on outFace,
// since Data is sent to outFace from which the Interest was received
- pitEntry->deleteInRecord(outFace);
+ pitEntry->deleteInRecord(outFace, 0);
m_forwarder.onOutgoingData(data, *const_pointer_cast<Face>(outFace.shared_from_this()));
}
diff --git a/daemon/table/cleanup.cpp b/daemon/table/cleanup.cpp
index 5a45bf7..d45b363 100644
--- a/daemon/table/cleanup.cpp
+++ b/daemon/table/cleanup.cpp
@@ -40,7 +40,7 @@
}
for (const auto& pitEntry : nte.getPitEntries()) {
- pit.deleteInOutRecords(pitEntry.get(), face);
+ pit.deleteInOutRecordsByFace(pitEntry.get(), face);
}
if (!nte.hasTableEntries()) {
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index ee4b726..2edbc9f 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.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,
@@ -50,21 +50,25 @@
}
InRecordCollection::iterator
-Entry::getInRecord(const Face& face)
+Entry::getInRecord(const Face& face, uint64_t endpointId)
{
return std::find_if(m_inRecords.begin(), m_inRecords.end(),
- [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
+ [&face, endpointId] (const InRecord& inRecord) {
+ return &inRecord.getFace() == &face && inRecord.getEndpointId() == endpointId;
+ });
}
InRecordCollection::iterator
-Entry::insertOrUpdateInRecord(Face& face, const Interest& interest)
+Entry::insertOrUpdateInRecord(Face& face, uint64_t endpointId, const Interest& interest)
{
BOOST_ASSERT(this->canMatch(interest));
auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
- [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
+ [&face, endpointId] (const InRecord& inRecord) {
+ return &inRecord.getFace() == &face && inRecord.getEndpointId() == endpointId;
+ });
if (it == m_inRecords.end()) {
- m_inRecords.emplace_front(face);
+ m_inRecords.emplace_front(face, endpointId);
it = m_inRecords.begin();
}
@@ -73,10 +77,12 @@
}
void
-Entry::deleteInRecord(const Face& face)
+Entry::deleteInRecord(const Face& face, uint64_t endpointId)
{
auto it = std::find_if(m_inRecords.begin(), m_inRecords.end(),
- [&face] (const InRecord& inRecord) { return &inRecord.getFace() == &face; });
+ [&face, endpointId] (const InRecord& inRecord) {
+ return &inRecord.getFace() == &face && inRecord.getEndpointId() == endpointId;
+ });
if (it != m_inRecords.end()) {
m_inRecords.erase(it);
}
@@ -89,21 +95,25 @@
}
OutRecordCollection::iterator
-Entry::getOutRecord(const Face& face)
+Entry::getOutRecord(const Face& face, uint64_t endpointId)
{
return std::find_if(m_outRecords.begin(), m_outRecords.end(),
- [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
+ [&face, endpointId] (const OutRecord& outRecord) {
+ return &outRecord.getFace() == &face && outRecord.getEndpointId() == endpointId;
+ });
}
OutRecordCollection::iterator
-Entry::insertOrUpdateOutRecord(Face& face, const Interest& interest)
+Entry::insertOrUpdateOutRecord(Face& face, uint64_t endpointId, const Interest& interest)
{
BOOST_ASSERT(this->canMatch(interest));
auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
- [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
+ [&face, endpointId] (const OutRecord& outRecord) {
+ return &outRecord.getFace() == &face && outRecord.getEndpointId() == endpointId;
+ });
if (it == m_outRecords.end()) {
- m_outRecords.emplace_front(face);
+ m_outRecords.emplace_front(face, endpointId);
it = m_outRecords.begin();
}
@@ -112,14 +122,27 @@
}
void
-Entry::deleteOutRecord(const Face& face)
+Entry::deleteOutRecord(const Face& face, uint64_t endpointId)
{
auto it = std::find_if(m_outRecords.begin(), m_outRecords.end(),
- [&face] (const OutRecord& outRecord) { return &outRecord.getFace() == &face; });
+ [&face, endpointId] (const OutRecord& outRecord) {
+ return &outRecord.getFace() == &face && outRecord.getEndpointId() == endpointId;
+ });
if (it != m_outRecords.end()) {
m_outRecords.erase(it);
}
}
+void
+Entry::deleteInOutRecordsByFace(const Face& face)
+{
+ m_inRecords.remove_if([&face] (const InRecord& inRecord) {
+ return &inRecord.getFace() == &face;
+ });
+ m_outRecords.remove_if([&face] (const OutRecord& outRecord) {
+ return &outRecord.getFace() == &face;
+ });
+}
+
} // namespace pit
} // namespace nfd
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index 2e49824..b1dc9ee 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -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,
@@ -132,22 +132,22 @@
return m_inRecords.end();
}
- /** \brief get the in-record for \p face
+ /** \brief get the in-record for \p face and \p endpointId
* \return an iterator to the in-record, or .in_end() if it does not exist
*/
InRecordCollection::iterator
- getInRecord(const Face& face);
+ getInRecord(const Face& face, uint64_t endpointId);
/** \brief insert or update an in-record
* \return an iterator to the new or updated in-record
*/
InRecordCollection::iterator
- insertOrUpdateInRecord(Face& face, const Interest& interest);
+ insertOrUpdateInRecord(Face& face, uint64_t endpointId, const Interest& interest);
- /** \brief delete the in-record for \p face if it exists
+ /** \brief delete the in-record for \p face and \p endpointId if it exists
*/
void
- deleteInRecord(const Face& face);
+ deleteInRecord(const Face& face, uint64_t endpointId);
/** \brief delete all in-records
*/
@@ -199,22 +199,28 @@
return m_outRecords.end();
}
- /** \brief get the out-record for \p face
+ /** \brief get the out-record for \p face and \p endpointId
* \return an iterator to the out-record, or .out_end() if it does not exist
*/
OutRecordCollection::iterator
- getOutRecord(const Face& face);
+ getOutRecord(const Face& face, uint64_t endpointId);
/** \brief insert or update an out-record
* \return an iterator to the new or updated out-record
*/
OutRecordCollection::iterator
- insertOrUpdateOutRecord(Face& face, const Interest& interest);
+ insertOrUpdateOutRecord(Face& face, uint64_t endpointId, const Interest& interest);
- /** \brief delete the out-record for \p face if it exists
+ /** \brief delete the out-record for \p face and \p endpointId if it exists
*/
void
- deleteOutRecord(const Face& face);
+ deleteOutRecord(const Face& face, uint64_t endpointId);
+
+public: // cleanup
+ /** \brief delete all in-records and out-records for \p face if it exists
+ */
+ void
+ deleteInOutRecordsByFace(const Face& face);
public:
/** \brief expiry timer
diff --git a/daemon/table/pit-face-record.cpp b/daemon/table/pit-face-record.cpp
index d594cb9..61fef7e 100644
--- a/daemon/table/pit-face-record.cpp
+++ b/daemon/table/pit-face-record.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,
@@ -28,8 +28,9 @@
namespace nfd {
namespace pit {
-FaceRecord::FaceRecord(Face& face)
+FaceRecord::FaceRecord(Face& face, uint64_t endpointId)
: m_face(face)
+ , m_endpointId(endpointId)
, m_lastNonce(0)
, m_lastRenewed(time::steady_clock::TimePoint::min())
, m_expiry(time::steady_clock::TimePoint::min())
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index 90c3cdb..3e3f020 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.hpp
@@ -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,
@@ -40,12 +40,14 @@
class FaceRecord : public StrategyInfoHost
{
public:
- explicit
- FaceRecord(Face& face);
+ FaceRecord(Face& face, uint64_t endpointId);
Face&
getFace() const;
+ uint64_t
+ getEndpointId() const;
+
uint32_t
getLastNonce() const;
@@ -65,6 +67,7 @@
private:
Face& m_face;
+ uint64_t m_endpointId;
uint32_t m_lastNonce;
time::steady_clock::TimePoint m_lastRenewed;
time::steady_clock::TimePoint m_expiry;
@@ -76,6 +79,12 @@
return m_face;
}
+inline uint64_t
+FaceRecord::getEndpointId() const
+{
+ return m_endpointId;
+}
+
inline uint32_t
FaceRecord::getLastNonce() const
{
diff --git a/daemon/table/pit-in-record.cpp b/daemon/table/pit-in-record.cpp
index 8167190..7bb10b9 100644
--- a/daemon/table/pit-in-record.cpp
+++ b/daemon/table/pit-in-record.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,
@@ -28,8 +28,8 @@
namespace nfd {
namespace pit {
-InRecord::InRecord(Face& face)
- : FaceRecord(face)
+InRecord::InRecord(Face& face, uint64_t endpointId)
+ : FaceRecord(face, endpointId)
{
}
diff --git a/daemon/table/pit-in-record.hpp b/daemon/table/pit-in-record.hpp
index 45167c3..d758097 100644
--- a/daemon/table/pit-in-record.hpp
+++ b/daemon/table/pit-in-record.hpp
@@ -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,
@@ -36,8 +36,7 @@
class InRecord : public FaceRecord
{
public:
- explicit
- InRecord(Face& face);
+ InRecord(Face& face, uint64_t endpointId);
void
update(const Interest& interest);
diff --git a/daemon/table/pit-out-record.cpp b/daemon/table/pit-out-record.cpp
index 8b4f609..75d7e7f 100644
--- a/daemon/table/pit-out-record.cpp
+++ b/daemon/table/pit-out-record.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,
@@ -28,8 +28,8 @@
namespace nfd {
namespace pit {
-OutRecord::OutRecord(Face& face)
- : FaceRecord(face)
+OutRecord::OutRecord(Face& face, uint64_t endpointId)
+ : FaceRecord(face, endpointId)
{
}
diff --git a/daemon/table/pit-out-record.hpp b/daemon/table/pit-out-record.hpp
index 4400fd4..c0537fd 100644
--- a/daemon/table/pit-out-record.hpp
+++ b/daemon/table/pit-out-record.hpp
@@ -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,
@@ -36,8 +36,7 @@
class OutRecord : public FaceRecord
{
public:
- explicit
- OutRecord(Face& face);
+ OutRecord(Face& face, uint64_t endpointId);
/** \return last NACK returned by \p getFace()
*
@@ -79,4 +78,4 @@
} // namespace pit
} // namespace nfd
-#endif // NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
+#endif // NFD_DAEMON_TABLE_PIT_OUT_RECORD_HPP
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index 7a708da..5e26fc0 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.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,
@@ -113,12 +113,11 @@
}
void
-Pit::deleteInOutRecords(Entry* entry, const Face& face)
+Pit::deleteInOutRecordsByFace(Entry* entry, const Face& face)
{
BOOST_ASSERT(entry != nullptr);
- entry->deleteInRecord(face);
- entry->deleteOutRecord(face);
+ entry->deleteInOutRecordsByFace(face);
/// \todo decide whether to delete PIT entry if there's no more in/out-record left
}
diff --git a/daemon/table/pit.hpp b/daemon/table/pit.hpp
index 6e8af8a..eb2438b 100644
--- a/daemon/table/pit.hpp
+++ b/daemon/table/pit.hpp
@@ -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,
@@ -93,10 +93,10 @@
this->erase(entry, true);
}
- /** \brief deletes in-record and out-record for face
+ /** \brief deletes all in-records and out-records for \p face
*/
void
- deleteInOutRecords(Entry* entry, const Face& face);
+ deleteInOutRecordsByFace(Entry* entry, const Face& face);
public: // enumeration
typedef Iterator const_iterator;
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");