tools: fix compilation with latest ndn-cxx
Change-Id: Ifded624f3256452be98f288f9193dd26e464cd36
This commit is contained in:
1 parent
4064127b97
commit
63b3ae818f
23 files changed
+91
-87
No files matched your search
@@ -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 @@ protected:
|
||||
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;
|
||||
|
||||
@@ -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: // status fetching
|
||||
|
||||
protected:
|
||||
ValidatorUniquePtr validator;
|
||||
Controller controller;
|
||||
ndn::nfd::Controller controller;
|
||||
|
||||
M module;
|
||||
|
||||
|
||||
@@ -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 @@ public:
|
||||
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:
|
||||
protected:
|
||||
ndn::util::DummyClientFace face;
|
||||
ValidatorNull validator;
|
||||
Controller controller;
|
||||
ndn::nfd::Controller controller;
|
||||
StatusReportTester report;
|
||||
|
||||
uint32_t res;
|
||||
|
||||
@@ -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>(
|
||||
|
||||
@@ -34,16 +34,17 @@ namespace nfd::tools::nfdc {
|
||||
|
||||
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
|
||||
|
||||
@@ -130,9 +130,9 @@ CsModule::erase(ExecuteContext& ctx)
|
||||
}
|
||||
|
||||
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>(
|
||||
|
||||
@@ -35,8 +35,9 @@ namespace nfd::tools::nfdc {
|
||||
|
||||
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 @@ public:
|
||||
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
|
||||
|
||||
@@ -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 @@ ndn::nfd::CommandOptions
|
||||
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 @@ ExecuteContext::makeCommandFailureHandler(const std::string& commandName)
|
||||
};
|
||||
}
|
||||
|
||||
Controller::DatasetFailCallback
|
||||
ndn::nfd::DatasetFailureCallback
|
||||
ExecuteContext::makeDatasetFailureHandler(const std::string& datasetName)
|
||||
{
|
||||
return [=] (uint32_t code, const std::string& reason) {
|
||||
|
||||
@@ -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 @@ public:
|
||||
/** \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 @@ public:
|
||||
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&)>;
|
||||
|
||||
|
||||
@@ -363,9 +363,9 @@ FaceModule::destroy(ExecuteContext& ctx)
|
||||
}
|
||||
|
||||
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>(
|
||||
|
||||
@@ -36,8 +36,9 @@ namespace nfd::tools::nfdc {
|
||||
|
||||
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 @@ public:
|
||||
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
|
||||
|
||||
@@ -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>(
|
||||
|
||||
@@ -35,16 +35,17 @@ namespace nfd::tools::nfdc {
|
||||
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
|
||||
|
||||
@@ -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>(
|
||||
|
||||
@@ -34,16 +34,17 @@ namespace nfd::tools::nfdc {
|
||||
|
||||
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
|
||||
|
||||
+4
-4
@@ -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 @@ main(int argc, char** argv)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -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 @@ public:
|
||||
* \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.
|
||||
|
||||
@@ -302,9 +302,9 @@ RibModule::remove(ExecuteContext& ctx)
|
||||
}
|
||||
|
||||
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>(
|
||||
|
||||
@@ -36,8 +36,9 @@ namespace nfd::tools::nfdc {
|
||||
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 @@ public:
|
||||
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
|
||||
|
||||
@@ -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 @@ operator<<(std::ostream& os, ReportFormat fmt)
|
||||
}
|
||||
|
||||
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 @@ StatusReport::collect(Face& face, KeyChain& keyChain, Validator& validator, cons
|
||||
}
|
||||
|
||||
void
|
||||
StatusReport::processEvents(Face& face)
|
||||
StatusReport::processEvents(ndn::Face& face)
|
||||
{
|
||||
face.processEvents();
|
||||
}
|
||||
|
||||
@@ -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 @@ public:
|
||||
* 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;
|
||||
};
|
||||
|
||||
@@ -150,9 +150,9 @@ StrategyChoiceModule::unset(ExecuteContext& ctx)
|
||||
}
|
||||
|
||||
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>(
|
||||
|
||||
@@ -35,8 +35,9 @@ namespace nfd::tools::nfdc {
|
||||
|
||||
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 @@ public:
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user