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/fw/best-route-strategy2.hpp b/daemon/fw/best-route-strategy2.hpp
index bf3eba2..8c19dc0 100644
--- a/daemon/fw/best-route-strategy2.hpp
+++ b/daemon/fw/best-route-strategy2.hpp
@@ -32,13 +32,22 @@
 namespace nfd {
 namespace fw {
 
-/** \brief Best Route strategy version 3
+/** \brief Best Route strategy version 4
  *
  *  This strategy forwards a new Interest to the lowest-cost nexthop (except downstream).
  *  After that, if consumer retransmits the Interest (and is not suppressed according to
  *  exponential backoff algorithm), the strategy forwards the Interest again to
  *  the lowest-cost nexthop (except downstream) that is not previously used.
- *  If all nexthops have been used, the strategy starts over.
+ *  If all nexthops have been used, the strategy starts over with the first nexthop.
+ *
+ *  This strategy returns Nack to all downstreams with reason NoRoute
+ *  if there is no usable nexthop, which may be caused by:
+ *  (a) the FIB entry contains no nexthop;
+ *  (b) the FIB nexthop happens to be the sole downstream;
+ *  (c) the FIB nexthops violate scope.
+ *
+ *  This strategy returns Nack to all downstreams if all upstreams have returned Nacks.
+ *  The reason of the sent Nack equals the least severe reason among received Nacks.
  */
 class BestRouteStrategy2 : public Strategy
 {
@@ -46,11 +55,15 @@
   BestRouteStrategy2(Forwarder& forwarder, const Name& name = STRATEGY_NAME);
 
   virtual void
-  afterReceiveInterest(const Face& inFace,
-                       const Interest& interest,
+  afterReceiveInterest(const Face& inFace, const Interest& interest,
                        shared_ptr<fib::Entry> fibEntry,
                        shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE;
 
+  virtual void
+  afterReceiveNack(const Face& inFace, const lp::Nack& nack,
+                   shared_ptr<fib::Entry> fibEntry,
+                   shared_ptr<pit::Entry> pitEntry) DECL_OVERRIDE;
+
 public:
   static const Name STRATEGY_NAME;