table+fw: move forwarding semantics out of PIT entry
refs #3546
Change-Id: I1e6f87fd81176c116b6d758156da1cf96ea03608
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index e8a0ade..ef792ae 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -24,6 +24,7 @@
*/
#include "forwarder.hpp"
+#include "pit-algorithm.hpp"
#include "core/logger.hpp"
#include "core/random.hpp"
#include "strategy.hpp"
@@ -129,8 +130,8 @@
shared_ptr<pit::Entry> pitEntry = m_pit.insert(interest).first;
// detect duplicate Nonce in PIT entry
- bool hasDuplicateNonceInPit = pitEntry->findNonce(interest.getNonce(), inFace) !=
- pit::DUPLICATE_NONCE_NONE;
+ bool hasDuplicateNonceInPit = fw::findDuplicateNonce(*pitEntry, interest.getNonce(), inFace) !=
+ fw::DUPLICATE_NONCE_NONE;
if (hasDuplicateNonceInPit) {
// goto Interest loop pipeline
this->onInterestLoop(inFace, interest);
@@ -298,7 +299,7 @@
" interest=" << pitEntry->getName());
// scope control
- if (pitEntry->violatesScope(outFace)) {
+ if (fw::violatesScope(*pitEntry, outFace)) {
NFD_LOG_DEBUG("onOutgoingInterest face=" << outFace.getId() <<
" interest=" << pitEntry->getName() << " violates scope");
return;
@@ -329,7 +330,7 @@
void
Forwarder::onInterestReject(shared_ptr<pit::Entry> pitEntry)
{
- if (pitEntry->hasUnexpiredOutRecords()) {
+ if (fw::hasPendingOutRecords(*pitEntry)) {
NFD_LOG_ERROR("onInterestReject interest=" << pitEntry->getName() <<
" cannot reject forwarded Interest");
return;