tools: fix compilation with latest ndn-cxx
Change-Id: Ifded624f3256452be98f288f9193dd26e464cd36
diff --git a/tests/tools/nfdc/execute-command-fixture.hpp b/tests/tools/nfdc/execute-command-fixture.hpp
index 7d73355..6c41c03 100644
--- a/tests/tools/nfdc/execute-command-fixture.hpp
+++ b/tests/tools/nfdc/execute-command-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
registerCommands(parser);
auto [noun, verb, ca, exec] = parser.parse(args, ParseMode::ONE_SHOT);
- Controller controller(face, m_keyChain);
+ ndn::nfd::Controller controller(face, m_keyChain);
ExecuteContext ctx{noun, verb, ca, 0, out, err, face, m_keyChain, controller};
exec(ctx);
exitCode = ctx.exitCode;
diff --git a/tests/tools/nfdc/status-fixture.hpp b/tests/tools/nfdc/status-fixture.hpp
index c82e79b..87ddba8 100644
--- a/tests/tools/nfdc/status-fixture.hpp
+++ b/tests/tools/nfdc/status-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -107,7 +107,7 @@
protected:
ValidatorUniquePtr validator;
- Controller controller;
+ ndn::nfd::Controller controller;
M module;
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index fbff27a..04b9b86 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -60,15 +60,15 @@
void
setResult(uint32_t res, time::nanoseconds delay)
{
- BOOST_ASSERT(delay > time::nanoseconds::zero());
+ BOOST_ASSERT(delay > 0_ns);
m_res = res;
m_delay = delay;
}
void
- fetchStatus(Controller&,
+ fetchStatus(ndn::nfd::Controller&,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions&) final
{
++nFetchStatusCalls;
@@ -151,7 +151,7 @@
protected:
ndn::util::DummyClientFace face;
ValidatorNull validator;
- Controller controller;
+ ndn::nfd::Controller controller;
StatusReportTester report;
uint32_t res;
diff --git a/tools/nfdc/channel-module.cpp b/tools/nfdc/channel-module.cpp
index 3d36df2..eeaac74 100644
--- a/tools/nfdc/channel-module.cpp
+++ b/tools/nfdc/channel-module.cpp
@@ -31,9 +31,9 @@
namespace nfd::tools::nfdc {
void
-ChannelModule::fetchStatus(Controller& controller,
+ChannelModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::ChannelDataset>(
diff --git a/tools/nfdc/channel-module.hpp b/tools/nfdc/channel-module.hpp
index 2be055c..e91a26b 100644
--- a/tools/nfdc/channel-module.hpp
+++ b/tools/nfdc/channel-module.hpp
@@ -34,16 +34,17 @@
using ndn::nfd::ChannelStatus;
-/** \brief Provides access to NFD channel dataset.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
+/**
+ * \brief Provides access to NFD channel dataset.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Channel-Dataset
*/
class ChannelModule : public Module, boost::noncopyable
{
public:
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void
diff --git a/tools/nfdc/cs-module.cpp b/tools/nfdc/cs-module.cpp
index 341034b..1fde355 100644
--- a/tools/nfdc/cs-module.cpp
+++ b/tools/nfdc/cs-module.cpp
@@ -130,9 +130,9 @@
}
void
-CsModule::fetchStatus(Controller& controller,
+CsModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::CsInfoDataset>(
diff --git a/tools/nfdc/cs-module.hpp b/tools/nfdc/cs-module.hpp
index 5bfec40..3874cd1 100644
--- a/tools/nfdc/cs-module.hpp
+++ b/tools/nfdc/cs-module.hpp
@@ -35,8 +35,9 @@
using ndn::nfd::CsInfo;
-/** \brief Provides access to NFD CS management.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt
+/**
+ * \brief Provides access to NFD CS management.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/CsMgmt
*/
class CsModule : public Module, boost::noncopyable
{
@@ -57,9 +58,9 @@
erase(ExecuteContext& ctx);
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void
diff --git a/tools/nfdc/execute-command.cpp b/tools/nfdc/execute-command.cpp
index 6706ffc..8c9e5b5 100644
--- a/tools/nfdc/execute-command.cpp
+++ b/tools/nfdc/execute-command.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,10 +37,10 @@
ExecuteContext::makeCommandOptions() const
{
return ndn::nfd::CommandOptions()
- .setTimeout(time::duration_cast<time::milliseconds>(this->getTimeout()));
+ .setTimeout(time::duration_cast<time::milliseconds>(this->getTimeout()));
}
-Controller::CommandFailCallback
+ndn::nfd::CommandFailureCallback
ExecuteContext::makeCommandFailureHandler(const std::string& commandName)
{
return [=] (const ControlResponse& resp) {
@@ -49,7 +49,7 @@
};
}
-Controller::DatasetFailCallback
+ndn::nfd::DatasetFailureCallback
ExecuteContext::makeDatasetFailureHandler(const std::string& datasetName)
{
return [=] (uint32_t code, const std::string& reason) {
diff --git a/tools/nfdc/execute-command.hpp b/tools/nfdc/execute-command.hpp
index ee11cf4..4b1bf5d 100644
--- a/tools/nfdc/execute-command.hpp
+++ b/tools/nfdc/execute-command.hpp
@@ -38,14 +38,11 @@
namespace nfd::tools::nfdc {
-using ndn::Face;
-using ndn::KeyChain;
using ndn::nfd::ControlParameters;
using ndn::nfd::ControlResponse;
-using ndn::nfd::Controller;
/**
- * \brief Context for command execution
+ * \brief Context for command execution.
*/
class ExecuteContext
{
@@ -61,13 +58,13 @@
/** \return handler for command execution failure
* \param commandName command name used in error message (present continuous tense)
*/
- Controller::CommandFailCallback
+ ndn::nfd::CommandFailureCallback
makeCommandFailureHandler(const std::string& commandName);
/** \return handler for dataset retrieval failure
* \param datasetName dataset name used in error message (noun phrase)
*/
- Controller::DatasetFailCallback
+ ndn::nfd::DatasetFailureCallback
makeDatasetFailureHandler(const std::string& datasetName);
public:
@@ -79,13 +76,13 @@
std::ostream& out; ///< output stream
std::ostream& err; ///< error stream
- Face& face;
- KeyChain& keyChain;
- Controller& controller;
+ ndn::Face& face;
+ ndn::KeyChain& keyChain;
+ ndn::nfd::Controller& controller;
};
/**
- * \brief A function to execute a command
+ * \brief A function to execute a command.
*/
using ExecuteCommand = std::function<void(ExecuteContext&)>;
diff --git a/tools/nfdc/face-module.cpp b/tools/nfdc/face-module.cpp
index 5af5e8d..decbf7b 100644
--- a/tools/nfdc/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -363,9 +363,9 @@
}
void
-FaceModule::fetchStatus(Controller& controller,
+FaceModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::FaceDataset>(
diff --git a/tools/nfdc/face-module.hpp b/tools/nfdc/face-module.hpp
index 641e272..9a504a6 100644
--- a/tools/nfdc/face-module.hpp
+++ b/tools/nfdc/face-module.hpp
@@ -36,8 +36,9 @@
using ndn::nfd::FaceStatus;
-/** \brief Provides access to NFD face management.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt
+/**
+ * \brief Provides access to NFD face management.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt
*/
class FaceModule : public Module, boost::noncopyable
{
@@ -68,9 +69,9 @@
destroy(ExecuteContext& ctx);
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void
diff --git a/tools/nfdc/fib-module.cpp b/tools/nfdc/fib-module.cpp
index e4d3b0e..af92f7d 100644
--- a/tools/nfdc/fib-module.cpp
+++ b/tools/nfdc/fib-module.cpp
@@ -31,9 +31,9 @@
namespace nfd::tools::nfdc {
void
-FibModule::fetchStatus(Controller& controller,
+FibModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::FibDataset>(
diff --git a/tools/nfdc/fib-module.hpp b/tools/nfdc/fib-module.hpp
index ee466da..f5d3cde 100644
--- a/tools/nfdc/fib-module.hpp
+++ b/tools/nfdc/fib-module.hpp
@@ -35,16 +35,17 @@
using ndn::nfd::FibEntry;
using ndn::nfd::NextHopRecord;
-/** \brief Provides access to NFD FIB management.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/FibMgmt
+/**
+ * \brief Provides access to NFD FIB management.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/FibMgmt
*/
class FibModule : public Module, boost::noncopyable
{
public:
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void
diff --git a/tools/nfdc/forwarder-general-module.cpp b/tools/nfdc/forwarder-general-module.cpp
index 516eefd..301df32 100644
--- a/tools/nfdc/forwarder-general-module.cpp
+++ b/tools/nfdc/forwarder-general-module.cpp
@@ -32,9 +32,9 @@
namespace nfd::tools::nfdc {
void
-ForwarderGeneralModule::fetchStatus(Controller& controller,
+ForwarderGeneralModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::ForwarderGeneralStatusDataset>(
diff --git a/tools/nfdc/forwarder-general-module.hpp b/tools/nfdc/forwarder-general-module.hpp
index 5bc4ba1..38be49a 100644
--- a/tools/nfdc/forwarder-general-module.hpp
+++ b/tools/nfdc/forwarder-general-module.hpp
@@ -34,16 +34,17 @@
using ndn::nfd::ForwarderStatus;
-/** \brief Provides access to NFD forwarder general status.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
+/**
+ * \brief Provides access to NFD forwarder general status.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/ForwarderStatus
*/
class ForwarderGeneralModule : public Module, boost::noncopyable
{
public:
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void
diff --git a/tools/nfdc/main.cpp b/tools/nfdc/main.cpp
index b89a3f9..db710bf 100644
--- a/tools/nfdc/main.cpp
+++ b/tools/nfdc/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -154,9 +154,9 @@
}
try {
- Face face;
- KeyChain keyChain;
- Controller controller(face, keyChain);
+ ndn::Face face;
+ ndn::KeyChain keyChain;
+ ndn::nfd::Controller controller(face, keyChain);
size_t commandCounter = 0;
for (auto& command : commands) {
++commandCounter;
diff --git a/tools/nfdc/module.hpp b/tools/nfdc/module.hpp
index c10e27b..42725c1 100644
--- a/tools/nfdc/module.hpp
+++ b/tools/nfdc/module.hpp
@@ -34,7 +34,6 @@
namespace nfd::tools::nfdc {
using ndn::nfd::CommandOptions;
-using ndn::nfd::Controller;
/**
* \brief Provides access to an NFD management module.
@@ -54,9 +53,9 @@
* \param options passed to controller.fetch
*/
virtual void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) = 0;
/** \brief Format collected status as XML.
diff --git a/tools/nfdc/rib-module.cpp b/tools/nfdc/rib-module.cpp
index 36e8391..108709b 100644
--- a/tools/nfdc/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -302,9 +302,9 @@
}
void
-RibModule::fetchStatus(Controller& controller,
+RibModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::RibDataset>(
diff --git a/tools/nfdc/rib-module.hpp b/tools/nfdc/rib-module.hpp
index 568e100..546c3e0 100644
--- a/tools/nfdc/rib-module.hpp
+++ b/tools/nfdc/rib-module.hpp
@@ -36,8 +36,9 @@
using ndn::nfd::RibEntry;
using ndn::nfd::Route;
-/** \brief Provides access to NFD RIB management.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/RibMgmt
+/**
+ * \brief Provides access to NFD RIB management.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/RibMgmt
*/
class RibModule : public Module, boost::noncopyable
{
@@ -68,9 +69,9 @@
remove(ExecuteContext& ctx);
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void
diff --git a/tools/nfdc/status-report.cpp b/tools/nfdc/status-report.cpp
index 3611e0f..31ed573 100644
--- a/tools/nfdc/status-report.cpp
+++ b/tools/nfdc/status-report.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,9 +41,10 @@
}
uint32_t
-StatusReport::collect(Face& face, KeyChain& keyChain, Validator& validator, const CommandOptions& options)
+StatusReport::collect(ndn::Face& face, ndn::KeyChain& keyChain, ndn::security::Validator& validator,
+ const CommandOptions& options)
{
- Controller controller(face, keyChain, validator);
+ ndn::nfd::Controller controller(face, keyChain, validator);
uint32_t errorCode = 0;
for (size_t i = 0; i < sections.size(); ++i) {
@@ -62,7 +63,7 @@
}
void
-StatusReport::processEvents(Face& face)
+StatusReport::processEvents(ndn::Face& face)
{
face.processEvents();
}
diff --git a/tools/nfdc/status-report.hpp b/tools/nfdc/status-report.hpp
index 1d0cb91..0fdd4bb 100644
--- a/tools/nfdc/status-report.hpp
+++ b/tools/nfdc/status-report.hpp
@@ -35,10 +35,6 @@
namespace nfd::tools::nfdc {
-using ndn::Face;
-using ndn::KeyChain;
-using ndn::security::Validator;
-
enum class ReportFormat {
XML = 1,
TEXT = 2,
@@ -66,26 +62,30 @@
* otherwise, error code from any failed section, plus 1000000 * section index
*/
uint32_t
- collect(Face& face, KeyChain& keyChain, Validator& validator, const CommandOptions& options);
+ collect(ndn::Face& face, ndn::KeyChain& keyChain, ndn::security::Validator& validator,
+ const CommandOptions& options);
- /** \brief Print an XML report.
- * \param os output stream
+ /**
+ * \brief Print an XML report.
+ * \param os output stream
*/
void
formatXml(std::ostream& os) const;
- /** \brief Print a text report.
- * \param os output stream
+ /**
+ * \brief Print a text report.
+ * \param os output stream
*/
void
formatText(std::ostream& os) const;
private:
NFD_VIRTUAL_WITH_TESTS void
- processEvents(Face& face);
+ processEvents(ndn::Face& face);
public:
- /** \brief Modules through which status is collected.
+ /**
+ * \brief Modules through which status is collected.
*/
std::vector<unique_ptr<Module>> sections;
};
diff --git a/tools/nfdc/strategy-choice-module.cpp b/tools/nfdc/strategy-choice-module.cpp
index 1d08126..a87afe9 100644
--- a/tools/nfdc/strategy-choice-module.cpp
+++ b/tools/nfdc/strategy-choice-module.cpp
@@ -150,9 +150,9 @@
}
void
-StrategyChoiceModule::fetchStatus(Controller& controller,
+StrategyChoiceModule::fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options)
{
controller.fetch<ndn::nfd::StrategyChoiceDataset>(
diff --git a/tools/nfdc/strategy-choice-module.hpp b/tools/nfdc/strategy-choice-module.hpp
index d9f37fa..d9df3ac 100644
--- a/tools/nfdc/strategy-choice-module.hpp
+++ b/tools/nfdc/strategy-choice-module.hpp
@@ -35,8 +35,9 @@
using ndn::nfd::StrategyChoice;
-/** \brief Provides access to NFD Strategy Choice management.
- * \sa https://redmine.named-data.net/projects/nfd/wiki/StrategyChoice
+/**
+ * \brief Provides access to NFD Strategy Choice management.
+ * \sa https://redmine.named-data.net/projects/nfd/wiki/StrategyChoice
*/
class StrategyChoiceModule : public Module, boost::noncopyable
{
@@ -67,9 +68,9 @@
unset(ExecuteContext& ctx);
void
- fetchStatus(Controller& controller,
+ fetchStatus(ndn::nfd::Controller& controller,
const std::function<void()>& onSuccess,
- const Controller::DatasetFailCallback& onFailure,
+ const ndn::nfd::DatasetFailureCallback& onFailure,
const CommandOptions& options) override;
void