mgmt: adapt to API changes in ndn-cxx ControlCommand and Dispatcher

Change-Id: I7515353444366d0a36fe962deeae70ef567334ac
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index b07d23d..55e57b4 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -213,7 +213,7 @@
   m_validators[module]; // declares module, so that privilege is recognized
 
   return [module, self = shared_from_this()] (const Name&, const Interest& interest,
-                                              const ndn::mgmt::ControlParameters*,
+                                              const ndn::mgmt::ControlParametersBase*,
                                               const ndn::mgmt::AcceptContinuation& accept,
                                               const ndn::mgmt::RejectContinuation& reject) {
     auto validator = self->m_validators.at(module);
diff --git a/daemon/mgmt/cs-manager.cpp b/daemon/mgmt/cs-manager.cpp
index e203b45..a807df8 100644
--- a/daemon/mgmt/cs-manager.cpp
+++ b/daemon/mgmt/cs-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -40,16 +40,16 @@
   , m_fwCounters(fwCounters)
 {
   registerCommandHandler<ndn::nfd::CsConfigCommand>("config",
-    [this] (auto&&, auto&&, auto&&, auto&&... args) { changeConfig(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&, auto&&... args) { changeConfig(std::forward<decltype(args)>(args)...); });
   registerCommandHandler<ndn::nfd::CsEraseCommand>("erase",
-    [this] (auto&&, auto&&, auto&&, auto&&... args) { erase(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&, auto&&... args) { erase(std::forward<decltype(args)>(args)...); });
   registerStatusDatasetHandler("info",
     [this] (auto&&, auto&&, auto&&... args) { serveInfo(std::forward<decltype(args)>(args)...); });
 }
 
 void
 CsManager::changeConfig(const ControlParameters& parameters,
-                        const ndn::mgmt::CommandContinuation& done)
+                        const CommandContinuation& done)
 {
   using ndn::nfd::CsFlagBit;
 
@@ -74,7 +74,7 @@
 
 void
 CsManager::erase(const ControlParameters& parameters,
-                 const ndn::mgmt::CommandContinuation& done)
+                 const CommandContinuation& done)
 {
   size_t count = parameters.hasCount() ?
                  parameters.getCount() :
diff --git a/daemon/mgmt/cs-manager.hpp b/daemon/mgmt/cs-manager.hpp
index 58fe362..2ab6ddb 100644
--- a/daemon/mgmt/cs-manager.hpp
+++ b/daemon/mgmt/cs-manager.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2023,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -47,19 +47,20 @@
             Dispatcher& dispatcher, CommandAuthenticator& authenticator);
 
 private:
-  /** \brief Process cs/config command.
+  /**
+   * \brief Process `cs/config` command.
    */
   void
-  changeConfig(const ControlParameters& parameters,
-               const ndn::mgmt::CommandContinuation& done);
+  changeConfig(const ControlParameters& parameters, const CommandContinuation& done);
 
-  /** \brief Process cs/erase command.
+  /**
+   * \brief Process `cs/erase` command.
    */
   void
-  erase(const ControlParameters& parameters,
-        const ndn::mgmt::CommandContinuation& done);
+  erase(const ControlParameters& parameters, const CommandContinuation& done);
 
-  /** \brief Serve CS information dataset.
+  /**
+   * \brief Serve CS information dataset.
    */
   void
   serveInfo(ndn::mgmt::StatusDatasetContext& context) const;
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 24bfd7f..e822f12 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -50,11 +50,11 @@
 {
   // register handlers for ControlCommand
   registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
-    [this] (auto&&, auto&&, auto&&, auto&&... args) { createFace(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&, auto&&... args) { createFace(std::forward<decltype(args)>(args)...); });
   registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
-    [this] (auto&&, auto&&, auto&&... args) { updateFace(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&... args) { updateFace(std::forward<decltype(args)>(args)...); });
   registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
-    [this] (auto&&, auto&&, auto&&, auto&&... args) { destroyFace(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&, auto&&... args) { destroyFace(std::forward<decltype(args)>(args)...); });
 
   // register handlers for StatusDataset
   registerStatusDatasetHandler("list",
@@ -77,7 +77,7 @@
 
 void
 FaceManager::createFace(const ControlParameters& parameters,
-                        const ndn::mgmt::CommandContinuation& done)
+                        const CommandContinuation& done)
 {
   FaceUri remoteUri;
   if (!remoteUri.parse(parameters.getUri())) {
@@ -203,7 +203,7 @@
 void
 FaceManager::afterCreateFaceSuccess(const shared_ptr<Face>& face,
                                     const ControlParameters& parameters,
-                                    const ndn::mgmt::CommandContinuation& done)
+                                    const CommandContinuation& done)
 {
   if (face->getId() != face::INVALID_FACEID) { // Face already exists
     NFD_LOG_TRACE("Attempted to create duplicate face of " << face->getId());
@@ -262,7 +262,7 @@
 void
 FaceManager::updateFace(const Interest& interest,
                         const ControlParameters& parameters,
-                        const ndn::mgmt::CommandContinuation& done)
+                        const CommandContinuation& done)
 {
   FaceId faceId = parameters.getFaceId();
   if (faceId == face::INVALID_FACEID) { // Self-update
@@ -336,7 +336,7 @@
 
 void
 FaceManager::destroyFace(const ControlParameters& parameters,
-                         const ndn::mgmt::CommandContinuation& done)
+                         const CommandContinuation& done)
 {
   Face* face = m_faceTable.get(parameters.getFaceId());
   if (face != nullptr) {
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index 8e72b9a..af946bc 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -47,22 +47,22 @@
 private: // ControlCommand
   void
   createFace(const ControlParameters& parameters,
-             const ndn::mgmt::CommandContinuation& done);
+             const CommandContinuation& done);
 
   void
   updateFace(const Interest& interest,
              const ControlParameters& parameters,
-             const ndn::mgmt::CommandContinuation& done);
+             const CommandContinuation& done);
 
   void
   destroyFace(const ControlParameters& parameters,
-              const ndn::mgmt::CommandContinuation& done);
+              const CommandContinuation& done);
 
 private: // helpers for ControlCommand
   void
   afterCreateFaceSuccess(const shared_ptr<Face>& face,
                          const ControlParameters& parameters,
-                         const ndn::mgmt::CommandContinuation& done);
+                         const CommandContinuation& done);
 
 private: // StatusDataset
   void
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 9bbd545..cdae3f6 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -45,16 +45,16 @@
   , m_faceTable(faceTable)
 {
   registerCommandHandler<ndn::nfd::FibAddNextHopCommand>("add-nexthop",
-    [this] (auto&&, auto&&, auto&&... args) { addNextHop(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&... args) { addNextHop(std::forward<decltype(args)>(args)...); });
   registerCommandHandler<ndn::nfd::FibRemoveNextHopCommand>("remove-nexthop",
-    [this] (auto&&, auto&&, auto&&... args) { removeNextHop(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&... args) { removeNextHop(std::forward<decltype(args)>(args)...); });
   registerStatusDatasetHandler("list",
     [this] (auto&&, auto&&, auto&&... args) { listEntries(std::forward<decltype(args)>(args)...); });
 }
 
 void
 FibManager::addNextHop(const Interest& interest, ControlParameters parameters,
-                       const ndn::mgmt::CommandContinuation& done)
+                       const CommandContinuation& done)
 {
   setFaceForSelfRegistration(interest, parameters);
   const Name& prefix = parameters.getName();
@@ -84,7 +84,7 @@
 
 void
 FibManager::removeNextHop(const Interest& interest, ControlParameters parameters,
-                          const ndn::mgmt::CommandContinuation& done)
+                          const CommandContinuation& done)
 {
   setFaceForSelfRegistration(interest, parameters);
   const Name& prefix = parameters.getName();
diff --git a/daemon/mgmt/fib-manager.hpp b/daemon/mgmt/fib-manager.hpp
index ba490bf..12a7b39 100644
--- a/daemon/mgmt/fib-manager.hpp
+++ b/daemon/mgmt/fib-manager.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2023,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -49,11 +49,11 @@
 private:
   void
   addNextHop(const Interest& interest, ControlParameters parameters,
-             const ndn::mgmt::CommandContinuation& done);
+             const CommandContinuation& done);
 
   void
   removeNextHop(const Interest& interest, ControlParameters parameters,
-                const ndn::mgmt::CommandContinuation& done);
+                const CommandContinuation& done);
 
   void
   listEntries(ndn::mgmt::StatusDatasetContext& context);
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index 979fc16..cbc363b 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2023,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -82,33 +82,4 @@
   return m_authenticator->makeAuthorization(m_module, verb);
 }
 
-bool
-ManagerBase::validateParameters(const ControlCommand& command,
-                                const ndn::mgmt::ControlParameters& parameters)
-{
-  BOOST_ASSERT(dynamic_cast<const ControlParameters*>(&parameters) != nullptr);
-
-  try {
-    command.validateRequest(static_cast<const ControlParameters&>(parameters));
-  }
-  catch (const ControlCommand::ArgumentError&) {
-    return false;
-  }
-  return true;
-}
-
-void
-ManagerBase::handleCommand(shared_ptr<ControlCommand> command,
-                           const ControlCommandHandler& handler,
-                           const Name& prefix, const Interest& interest,
-                           const ndn::mgmt::ControlParameters& params,
-                           const ndn::mgmt::CommandContinuation& done)
-{
-  BOOST_ASSERT(dynamic_cast<const ControlParameters*>(&params) != nullptr);
-
-  ControlParameters parameters = static_cast<const ControlParameters&>(params);
-  command->applyDefaultsToRequest(parameters);
-  handler(*command, prefix, interest, parameters, done);
-}
-
 } // namespace nfd
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index a664c9e..53a5fc6 100644
--- a/daemon/mgmt/manager-base.hpp
+++ b/daemon/mgmt/manager-base.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -38,7 +38,7 @@
 namespace nfd {
 
 using ndn::mgmt::Dispatcher;
-using ndn::nfd::ControlCommand;
+using ndn::mgmt::CommandContinuation;
 using ndn::nfd::ControlParameters;
 using ndn::nfd::ControlResponse;
 
@@ -76,16 +76,15 @@
   ~ManagerBase();
 
 NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
-  // difference from mgmt::ControlCommand: accepts nfd::ControlParameters
-  using ControlCommandHandler = std::function<void(const ControlCommand& command,
-                                                   const Name& prefix, const Interest& interest,
+  // difference from ndn::mgmt::ControlCommandHandler: accepts nfd::ControlParameters
+  using ControlCommandHandler = std::function<void(const Name& prefix, const Interest& interest,
                                                    const ControlParameters& parameters,
-                                                   const ndn::mgmt::CommandContinuation done)>;
+                                                   const CommandContinuation& done)>;
 
   template<typename Command>
   void
   registerCommandHandler(const std::string& verb,
-                         const ControlCommandHandler& handler);
+                         ControlCommandHandler handler);
 
   void
   registerStatusDatasetHandler(const std::string& verb,
@@ -112,33 +111,13 @@
   makeAuthorization(const std::string& verb);
 
   /**
-   * @brief Validates the @p parameters for a given @p command.
-   *
-   * @param parameters the original ControlParameters
-   * @return whether the original ControlParameters can be validated
-   */
-  [[nodiscard]] static bool
-  validateParameters(const ControlCommand& command,
-                     const ndn::mgmt::ControlParameters& parameters);
-
-  /**
-   * @brief Handles a control command.
-   */
-  static void
-  handleCommand(shared_ptr<ControlCommand> command,
-                const ControlCommandHandler& handler,
-                const Name& prefix, const Interest& interest,
-                const ndn::mgmt::ControlParameters& params,
-                const ndn::mgmt::CommandContinuation& done);
-
-  /**
    * @brief Generates the relative prefix for a handler by appending the verb name to the module name.
    *
    * @param verb the verb name
    * @return the generated relative prefix
    */
   PartialName
-  makeRelPrefix(const std::string& verb)
+  makeRelPrefix(const std::string& verb) const
   {
     return PartialName(m_module).append(verb);
   }
@@ -151,16 +130,30 @@
 
 template<typename Command>
 void
-ManagerBase::registerCommandHandler(const std::string& verb,
-                                    const ControlCommandHandler& handler)
+ManagerBase::registerCommandHandler(const std::string& verb, ControlCommandHandler handler)
 {
-  auto command = make_shared<Command>();
+  auto validate = [] (const ndn::mgmt::ControlParametersBase& params) {
+    BOOST_ASSERT(dynamic_cast<const ControlParameters*>(&params) != nullptr);
+    try {
+      Command::validateRequest(static_cast<const ControlParameters&>(params));
+      return true;
+    }
+    catch (const std::invalid_argument&) {
+      return false;
+    }
+  };
 
-  m_dispatcher.addControlCommand<ControlParameters>(
-    makeRelPrefix(verb),
-    makeAuthorization(verb),
-    [=] (const auto& params) { return validateParameters(*command, params); },
-    [=] (auto&&... args) { handleCommand(command, handler, std::forward<decltype(args)>(args)...); });
+  auto handle = [handler = std::move(handler)] (const Name& prefix, const Interest& interest,
+                                                const ndn::mgmt::ControlParametersBase& params,
+                                                const CommandContinuation& done) {
+    BOOST_ASSERT(dynamic_cast<const ControlParameters*>(&params) != nullptr);
+    ControlParameters parameters = static_cast<const ControlParameters&>(params);
+    Command::applyDefaultsToRequest(parameters);
+    handler(prefix, interest, parameters, done);
+  };
+
+  m_dispatcher.addControlCommand<ControlParameters>(makeRelPrefix(verb), makeAuthorization(verb),
+                                                    std::move(validate), std::move(handle));
 }
 
 } // namespace nfd
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index b3d515c..865b30f 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -62,9 +62,9 @@
   , m_isLocalhopEnabled(false)
 {
   registerCommandHandler<ndn::nfd::RibRegisterCommand>("register",
-    [this] (auto&&, auto&&, auto&&... args) { registerEntry(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&... args) { registerEntry(std::forward<decltype(args)>(args)...); });
   registerCommandHandler<ndn::nfd::RibUnregisterCommand>("unregister",
-    [this] (auto&&, auto&&, auto&&... args) { unregisterEntry(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&... args) { unregisterEntry(std::forward<decltype(args)>(args)...); });
   registerStatusDatasetHandler("list",
     [this] (auto&&, auto&&, auto&&... args) { listEntries(std::forward<decltype(args)>(args)...); });
 }
@@ -218,7 +218,7 @@
 
 void
 RibManager::registerEntry(const Interest& interest, ControlParameters parameters,
-                          const ndn::mgmt::CommandContinuation& done)
+                          const CommandContinuation& done)
 {
   if (parameters.getName().size() > Fib::getMaxDepth()) {
     done(ControlResponse(414, "Route prefix cannot exceed " + std::to_string(Fib::getMaxDepth()) +
@@ -248,7 +248,7 @@
 
 void
 RibManager::unregisterEntry(const Interest& interest, ControlParameters parameters,
-                            const ndn::mgmt::CommandContinuation& done)
+                            const CommandContinuation& done)
 {
   setFaceForSelfRegistration(interest, parameters);
 
@@ -304,7 +304,7 @@
 RibManager::makeAuthorization(const std::string&)
 {
   return [this] (const Name& prefix, const Interest& interest,
-                 const ndn::mgmt::ControlParameters* params,
+                 const ndn::mgmt::ControlParametersBase* params,
                  const ndn::mgmt::AcceptContinuation& accept,
                  const ndn::mgmt::RejectContinuation& reject) {
     BOOST_ASSERT(params != nullptr);
diff --git a/daemon/mgmt/rib-manager.hpp b/daemon/mgmt/rib-manager.hpp
index 114a7c4..a7edc22 100644
--- a/daemon/mgmt/rib-manager.hpp
+++ b/daemon/mgmt/rib-manager.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2024,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -197,19 +197,22 @@
   void
   registerTopPrefix(const Name& topPrefix);
 
-  /** \brief Serve rib/register command.
+  /**
+   * \brief Serve `rib/register` command.
    */
   void
   registerEntry(const Interest& interest, ControlParameters parameters,
-                const ndn::mgmt::CommandContinuation& done);
+                const CommandContinuation& done);
 
-  /** \brief Serve rib/unregister command.
+  /**
+   * \brief Serve `rib/unregister` command.
    */
   void
   unregisterEntry(const Interest& interest, ControlParameters parameters,
-                  const ndn::mgmt::CommandContinuation& done);
+                  const CommandContinuation& done);
 
-  /** \brief Serve rib/list dataset.
+  /**
+   * \brief Serve `rib/list` dataset.
    */
   void
   listEntries(ndn::mgmt::StatusDatasetContext& context);
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index af74ee1..e31ae76 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2023,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -43,16 +43,16 @@
   , m_table(strategyChoice)
 {
   registerCommandHandler<ndn::nfd::StrategyChoiceSetCommand>("set",
-    [this] (auto&&, auto&&, auto&&, auto&&... args) { setStrategy(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&, auto&&... args) { setStrategy(std::forward<decltype(args)>(args)...); });
   registerCommandHandler<ndn::nfd::StrategyChoiceUnsetCommand>("unset",
-    [this] (auto&&, auto&&, auto&&, auto&&... args) { unsetStrategy(std::forward<decltype(args)>(args)...); });
+    [this] (auto&&, auto&&, auto&&... args) { unsetStrategy(std::forward<decltype(args)>(args)...); });
   registerStatusDatasetHandler("list",
     [this] (auto&&, auto&&, auto&&... args) { listChoices(std::forward<decltype(args)>(args)...); });
 }
 
 void
 StrategyChoiceManager::setStrategy(ControlParameters parameters,
-                                   const ndn::mgmt::CommandContinuation& done)
+                                   const CommandContinuation& done)
 {
   const Name& prefix = parameters.getName();
   const Name& strategy = parameters.getStrategy();
@@ -72,7 +72,7 @@
 
 void
 StrategyChoiceManager::unsetStrategy(ControlParameters parameters,
-                                     const ndn::mgmt::CommandContinuation& done)
+                                     const CommandContinuation& done)
 {
   const Name& prefix = parameters.getName();
   // no need to test for ndn:/ , parameter validation takes care of that
diff --git a/daemon/mgmt/strategy-choice-manager.hpp b/daemon/mgmt/strategy-choice-manager.hpp
index 6c91af8..658e4c1 100644
--- a/daemon/mgmt/strategy-choice-manager.hpp
+++ b/daemon/mgmt/strategy-choice-manager.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  Regents of the University of California,
+ * Copyright (c) 2014-2025,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -46,12 +46,10 @@
 
 private:
   void
-  setStrategy(ControlParameters parameters,
-              const ndn::mgmt::CommandContinuation& done);
+  setStrategy(ControlParameters parameters, const CommandContinuation& done);
 
   void
-  unsetStrategy(ControlParameters parameters,
-                const ndn::mgmt::CommandContinuation& done);
+  unsetStrategy(ControlParameters parameters, const CommandContinuation& done);
 
   void
   listChoices(ndn::mgmt::StatusDatasetContext& context);