fw: UnsolicitedDataPolicy

The decision of whether to cache or drop an unsolicited Data is moved from
Data unsolicited pipeline to UnsolicitedDataPolicy.

refs #2181

Change-Id: Iba3e72c2214e0ac5f6f305c2c1c0ed182b008e85
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index 855c24e..00645ba 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -30,6 +30,7 @@
 #include "core/scheduler.hpp"
 #include "forwarder-counters.hpp"
 #include "face-table.hpp"
+#include "unsolicited-data-policy.hpp"
 #include "table/fib.hpp"
 #include "table/pit.hpp"
 #include "table/cs.hpp"
@@ -62,7 +63,7 @@
     return m_counters;
   }
 
-public: // faces
+public: // faces and policies
   FaceTable&
   getFaceTable()
   {
@@ -89,6 +90,19 @@
     m_faceTable.add(face);
   }
 
+  fw::UnsolicitedDataPolicy&
+  getUnsolicitedDataPolicy() const
+  {
+    return *m_unsolicitedDataPolicy;
+  }
+
+  void
+  setUnsolicitedDataPolicy(unique_ptr<fw::UnsolicitedDataPolicy> policy)
+  {
+    BOOST_ASSERT(policy != nullptr);
+    m_unsolicitedDataPolicy = std::move(policy);
+  }
+
 public: // forwarding entrypoints and tables
   /** \brief start incoming Interest processing
    *  \param face face on which Interest is received
@@ -273,8 +287,8 @@
   ForwarderCounters m_counters;
 
   FaceTable m_faceTable;
+  unique_ptr<fw::UnsolicitedDataPolicy> m_unsolicitedDataPolicy;
 
-  // tables
   NameTree           m_nameTree;
   Fib                m_fib;
   Pit                m_pit;