fw: Nack in pipelines and best-route strategy
* in PIT out-record, add last incoming Nack field
* create incoming Nack pipeline
* create outgoing Nack pipeline
* modify Interest loop pipeline to send Nack upon duplicate Nonce
* in strategy API, add after receive Nack trigger and send Nack action
* in best-route strategy, send Nack-NoRoute before rejecting pending Interest
* in best-route strategy, process incoming Nack
Other changes include:
* Pit::find
* StrategyTester saved arguments structs
* TopologyTester transmit at Transport level
refs #3156
Change-Id: I7868561c0838231083d471261200aeb280cc6e9d
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index c21ccdf..959593f 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -62,7 +62,7 @@
}
std::pair<shared_ptr<pit::Entry>, bool>
-Pit::insert(const Interest& interest)
+Pit::findOrInsert(const Interest& interest, bool allowInsert)
{
// first lookup() the Interest Name in the NameTree, which will creates all
// the intermedia nodes, starting from the shortest prefix.
@@ -78,13 +78,17 @@
entry->getInterest().getSelectors() == interest.getSelectors();
});
if (it != pitEntries.end()) {
- return { *it, false };
+ return {*it, false};
+ }
+
+ if (!allowInsert) {
+ return {nullptr, true};
}
shared_ptr<pit::Entry> entry = make_shared<pit::Entry>(interest);
nameTreeEntry->insertPitEntry(entry);
m_nItems++;
- return { entry, true };
+ return {entry, true};
}
pit::DataMatchResult