mgmt: report face MTU in faces/list and faces/query datasets
This commit also contains an overall cleanup of FaceManager
and extends the FaceDataset test case.
Change-Id: I8c8290b0dc04b25582e66a5c6dad3cca4dd226eb
Refs: #4763, #3325
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index ee5115a..778e824 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -29,10 +29,6 @@
#include "nfd-manager-base.hpp"
#include "face/face-system.hpp"
-#include <ndn-cxx/mgmt/nfd/face-status.hpp>
-#include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
-#include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
-
namespace nfd {
/**
@@ -46,67 +42,35 @@
Dispatcher& dispatcher,
CommandAuthenticator& authenticator);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE: // ControlCommand
+private: // ControlCommand
void
- createFace(const Name& topPrefix, const Interest& interest,
+ createFace(const ControlParameters& parameters,
+ const ndn::mgmt::CommandContinuation& done);
+
+ void
+ updateFace(const Interest& interest,
const ControlParameters& parameters,
const ndn::mgmt::CommandContinuation& done);
void
- updateFace(const Name& topPrefix, const Interest& interest,
- const ControlParameters& parameters,
- const ndn::mgmt::CommandContinuation& done);
-
- void
- destroyFace(const Name& topPrefix, const Interest& interest,
- const ControlParameters& parameters,
+ destroyFace(const ControlParameters& parameters,
const ndn::mgmt::CommandContinuation& done);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE: // helpers for ControlCommand
+private: // helpers for ControlCommand
void
- afterCreateFaceSuccess(const ControlParameters& parameters,
- const shared_ptr<Face>& newFace,
+ afterCreateFaceSuccess(const shared_ptr<Face>& face,
+ const ControlParameters& parameters,
const ndn::mgmt::CommandContinuation& done);
+private: // StatusDataset
void
- afterCreateFaceFailure(uint32_t status,
- const std::string& reason,
- const ndn::mgmt::CommandContinuation& done);
-
- static void
- setLinkServiceOptions(Face& face, const ControlParameters& parameters);
-
- static ControlParameters
- collectFaceProperties(const Face& face, bool wantUris);
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE: // StatusDataset
- void
- listFaces(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context);
+ listFaces(ndn::mgmt::StatusDatasetContext& context);
void
- listChannels(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context);
+ listChannels(ndn::mgmt::StatusDatasetContext& context);
void
- queryFaces(const Name& topPrefix, const Interest& interest,
- ndn::mgmt::StatusDatasetContext& context);
-
-private: // helpers for StatusDataset handler
- static bool
- matchFilter(const ndn::nfd::FaceQueryFilter& filter, const Face& face);
-
- /** \brief get status of face, including properties and counters
- */
- static ndn::nfd::FaceStatus
- collectFaceStatus(const Face& face, const time::steady_clock::TimePoint& now);
-
- /** \brief copy face properties into traits
- * \tparam FaceTraits either FaceStatus or FaceEventNotification
- */
- template<typename FaceTraits>
- static void
- collectFaceProperties(const Face& face, FaceTraits& traits);
+ queryFaces(const Interest& interest, ndn::mgmt::StatusDatasetContext& context);
private: // NotificationStream
void