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;
}
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 9b7c71a..ec37c57 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -212,6 +212,7 @@
left.getFaceScope() != right.getFaceScope() ||
left.getFacePersistency() != right.getFacePersistency() ||
left.getLinkType() != right.getLinkType() ||
+ left.getFlags() != right.getFlags() ||
left.getNInInterests() != right.getNInInterests() ||
left.getNInDatas() != right.getNInDatas() ||
left.getNOutInterests() != right.getNOutInterests() ||
@@ -227,6 +228,7 @@
<< status.getLocalUri() << ", "
<< status.getFacePersistency() << ", "
<< status.getLinkType() << ", "
+ << status.getFlags() << ", "
<< status.getNInInterests() << ", "
<< status.getNInDatas() << ", "
<< status.getNOutInterests() << ", "