mgmt: add Flags field to faces/list and faces/query in FaceManager

refs #3732

Change-Id: I6532962831efa780d1737412a8dfb2125f296f16
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 2dccbd1..5486a43 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -74,10 +74,10 @@
   Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport);
 
   LinkService*
-  getLinkService();
+  getLinkService() const;
 
   Transport*
-  getTransport();
+  getTransport() const;
 
 public: // upper interface connected to forwarding
   /** \brief sends Interest on Face
@@ -189,13 +189,13 @@
 };
 
 inline LinkService*
-Face::getLinkService()
+Face::getLinkService() const
 {
   return m_service.get();
 }
 
 inline Transport*
-Face::getTransport()
+Face::getTransport() const
 {
   return m_transport.get();
 }
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 9078bca..c03f9d8 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -493,6 +493,13 @@
         .setNInBytes(counters.nInBytes)
         .setNOutBytes(counters.nOutBytes);
 
+  // Set Flag bits
+  auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
+  if (linkService != nullptr) {
+    auto linkServiceOptions = linkService->getOptions();
+    status.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, linkServiceOptions.allowLocalFields);
+  }
+
   return status;
 }