management: Finalizing LocalControlHeader implementation

IncomingFaceId and NextHopFaceId are now fully supported for specifying
to be efficiently sent towards the forwarding daemon, and to be
automatically decoded from incoming packet from the forwarding daemon.

The current implementation limits exactly one LocalControlHeader for
Interest/Data packet instance. This is not exactly correct (especially
inside NFD), where the same Interest is expected to have multiple
LocalControlHeader (for each individual local face).  The following
commits will fix this problem.

Change-Id: Ia6b124ed12271136d071f4822f13634897ce3228
refs: #1170
diff --git a/src/data.hpp b/src/data.hpp
index 4c09811..508c332 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -15,6 +15,7 @@
 #include "signature.hpp"
 #include "meta-info.hpp"
 #include "key-locator.hpp"
+#include "management/nfd-local-control-header.hpp"
 
 namespace ndn {
   
@@ -35,6 +36,15 @@
    */
   inline
   Data(const Name& name);
+
+  /**
+   * @brief Create a new Data object from wire encoding
+   */
+  explicit
+  Data(const Block& wire)
+  {
+    wireDecode(wire);
+  }
   
   /**
    * @brief The destructor
@@ -61,6 +71,12 @@
   inline void 
   wireDecode(const Block &wire);
 
+  /**
+   * @brief Check if already has wire
+   */
+  inline bool
+  hasWire() const;
+  
   ////////////////////////////////////////////////////////////////////  
   
   inline const Name& 
@@ -161,6 +177,12 @@
   setSignatureValue(const Block &value);
 
   ///////////////////////////////////////////////////////////////
+
+  nfd::LocalControlHeader&
+  getLocalControlHeader();
+
+  const nfd::LocalControlHeader&
+  getLocalControlHeader() const;
   
   inline uint64_t
   getIncomingFaceId() const;
@@ -183,7 +205,8 @@
 
   mutable Block m_wire;
 
-  uint64_t m_incomingFaceId;
+  nfd::LocalControlHeader m_localControlHeader;
+  friend class nfd::LocalControlHeader;
 };
 
 inline
@@ -257,7 +280,7 @@
   EncodingEstimator estimator;
   size_t estimatedSize = wireEncode(estimator);
   
-  EncodingBuffer buffer(estimatedSize, 0);
+  EncodingBuffer buffer(estimatedSize + nfd::ESTIMATED_LOCAL_HEADER_RESERVE, 0);
   wireEncode(buffer);
 
   const_cast<Data*>(this)->wireDecode(buffer.block());
@@ -302,6 +325,12 @@
     m_signature.setValue(*val);
 }
 
+inline bool
+Data::hasWire() const
+{
+  return m_wire.hasWire();
+}
+
 inline const Name& 
 Data::getName() const
 {
@@ -426,16 +455,30 @@
   m_signature.setValue(value);
 }
 
+//
+
+inline nfd::LocalControlHeader&
+Data::getLocalControlHeader()
+{
+  return m_localControlHeader;
+}
+
+inline const nfd::LocalControlHeader&
+Data::getLocalControlHeader() const
+{
+  return m_localControlHeader;
+}
+
 inline uint64_t
 Data::getIncomingFaceId() const
 {
-  return m_incomingFaceId;
+  return getLocalControlHeader().getIncomingFaceId();
 }
 
 inline void
 Data::setIncomingFaceId(uint64_t incomingFaceId)
 {
-  m_incomingFaceId = incomingFaceId;
+  getLocalControlHeader().setIncomingFaceId(incomingFaceId);
 }
 
 inline void