face: Implementation of encode/decode of LocalControlHeader

LocalControlHeader can only be used on faces that are derived from
LocalFace.  UnixStreamFace is directly inherited from LocalFace,
TCP face has two specializations: generic TcpFace (strictly not local),
and LocalTcpFace.

refs #1213

Change-Id: I8a158c3bc4bb929eedd15757cfddecc0d1049f9f
diff --git a/daemon/mgmt/local-control-header-manager.cpp b/daemon/mgmt/local-control-header-manager.cpp
index 6a0f056..5717f54 100644
--- a/daemon/mgmt/local-control-header-manager.cpp
+++ b/daemon/mgmt/local-control-header-manager.cpp
@@ -5,6 +5,7 @@
  */
 
 #include "local-control-header-manager.hpp"
+#include "face/local-face.hpp"
 
 namespace nfd {
 
@@ -58,7 +59,15 @@
       return;
     }
 
-  shared_ptr<Face> face = m_getFace(request.getIncomingFaceId());
+  shared_ptr<LocalFace> face =
+    dynamic_pointer_cast<LocalFace>(m_getFace(request.getIncomingFaceId()));
+
+  if (!static_cast<bool>(face))
+    {
+      NFD_LOG_INFO("command result: request to enable control header on non-local face");
+      sendResponse(command, 400, "Command not supported on the requested face");
+      return;
+    }
 
   const Name::Component& module = command.get(COMMAND_PREFIX.size());
   const Name::Component& verb = command.get(COMMAND_PREFIX.size() + 1);