Further reduce the use of std::bind()
And also avoid deprecated ndn-cxx type aliases Change-Id: I87e903b9671a3cf1c1b9ab30d4594d595c3c6da9
This commit is contained in:
1 parent
63b3ae818f
commit
ae43030f6f
37 files changed
+155
-168
No files matched your search
+1
-1
@@ -112,7 +112,7 @@ using namespace ndn::tlv;
|
||||
namespace lp = ndn::lp;
|
||||
namespace name = ndn::name;
|
||||
namespace scheduler = ndn::scheduler;
|
||||
namespace signal = ndn::util::signal;
|
||||
namespace signal = ndn::signal;
|
||||
namespace time = ndn::time;
|
||||
using namespace ndn::time_literals;
|
||||
|
||||
|
||||
@@ -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,
|
||||
@@ -66,7 +66,6 @@ UnsolicitedDataPolicy::getPolicyNames()
|
||||
return policyNames;
|
||||
}
|
||||
|
||||
const std::string DropAllUnsolicitedDataPolicy::POLICY_NAME("drop-all");
|
||||
NFD_REGISTER_UNSOLICITED_DATA_POLICY(DropAllUnsolicitedDataPolicy);
|
||||
|
||||
UnsolicitedDataDecision
|
||||
@@ -75,7 +74,6 @@ DropAllUnsolicitedDataPolicy::decide(const Face&, const Data&) const
|
||||
return UnsolicitedDataDecision::DROP;
|
||||
}
|
||||
|
||||
const std::string AdmitLocalUnsolicitedDataPolicy::POLICY_NAME("admit-local");
|
||||
NFD_REGISTER_UNSOLICITED_DATA_POLICY(AdmitLocalUnsolicitedDataPolicy);
|
||||
|
||||
UnsolicitedDataDecision
|
||||
@@ -87,7 +85,6 @@ AdmitLocalUnsolicitedDataPolicy::decide(const Face& inFace, const Data&) const
|
||||
return UnsolicitedDataDecision::DROP;
|
||||
}
|
||||
|
||||
const std::string AdmitNetworkUnsolicitedDataPolicy::POLICY_NAME("admit-network");
|
||||
NFD_REGISTER_UNSOLICITED_DATA_POLICY(AdmitNetworkUnsolicitedDataPolicy);
|
||||
|
||||
UnsolicitedDataDecision
|
||||
@@ -99,7 +96,6 @@ AdmitNetworkUnsolicitedDataPolicy::decide(const Face& inFace, const Data&) const
|
||||
return UnsolicitedDataDecision::DROP;
|
||||
}
|
||||
|
||||
const std::string AdmitAllUnsolicitedDataPolicy::POLICY_NAME("admit-all");
|
||||
NFD_REGISTER_UNSOLICITED_DATA_POLICY(AdmitAllUnsolicitedDataPolicy);
|
||||
|
||||
UnsolicitedDataDecision
|
||||
|
||||
@@ -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,10 +60,10 @@ public:
|
||||
public: // registry
|
||||
template<typename P>
|
||||
static void
|
||||
registerPolicy(const std::string& policyName = P::POLICY_NAME)
|
||||
registerPolicy(std::string_view policyName = P::POLICY_NAME)
|
||||
{
|
||||
BOOST_ASSERT(!policyName.empty());
|
||||
auto r = getRegistry().insert_or_assign(policyName, [] { return make_unique<P>(); });
|
||||
auto r = getRegistry().insert_or_assign(std::string(policyName), [] { return make_unique<P>(); });
|
||||
BOOST_VERIFY(r.second);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
decide(const Face& inFace, const Data& data) const final;
|
||||
|
||||
public:
|
||||
static const std::string POLICY_NAME;
|
||||
static constexpr std::string_view POLICY_NAME{"drop-all"};
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
decide(const Face& inFace, const Data& data) const final;
|
||||
|
||||
public:
|
||||
static const std::string POLICY_NAME;
|
||||
static constexpr std::string_view POLICY_NAME{"admit-local"};
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
decide(const Face& inFace, const Data& data) const final;
|
||||
|
||||
public:
|
||||
static const std::string POLICY_NAME;
|
||||
static constexpr std::string_view POLICY_NAME{"admit-network"};
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
decide(const Face& inFace, const Data& data) const final;
|
||||
|
||||
public:
|
||||
static const std::string POLICY_NAME;
|
||||
static constexpr std::string_view POLICY_NAME{"admit-all"};
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -146,9 +146,9 @@ using DefaultUnsolicitedDataPolicy = DropAllUnsolicitedDataPolicy;
|
||||
} // namespace nfd::fw
|
||||
|
||||
/**
|
||||
* \brief Registers an unsolicited data policy
|
||||
* \param P A subclass of nfd::fw::UnsolicitedDataPolicy. \p P must have a static data
|
||||
* member `POLICY_NAME` convertible to std::string that contains the policy name.
|
||||
* \brief Registers an unsolicited data policy.
|
||||
* \param P A subclass of nfd::fw::UnsolicitedDataPolicy. \p P must have a static const data
|
||||
* member `POLICY_NAME` convertible to std::string_view that contains the policy name.
|
||||
*/
|
||||
#define NFD_REGISTER_UNSOLICITED_DATA_POLICY(P) \
|
||||
static class NfdAuto ## P ## UnsolicitedDataPolicyRegistrationClass \
|
||||
|
||||
@@ -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,
|
||||
@@ -38,11 +38,11 @@ CsManager::CsManager(Cs& cs, const ForwarderCounters& fwCounters,
|
||||
, m_fwCounters(fwCounters)
|
||||
{
|
||||
registerCommandHandler<ndn::nfd::CsConfigCommand>("config",
|
||||
std::bind(&CsManager::changeConfig, this, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&, auto&&... args) { changeConfig(std::forward<decltype(args)>(args)...); });
|
||||
registerCommandHandler<ndn::nfd::CsEraseCommand>("erase",
|
||||
std::bind(&CsManager::erase, this, _4, _5));
|
||||
|
||||
registerStatusDatasetHandler("info", std::bind(&CsManager::serveInfo, this, _1, _2, _3));
|
||||
[this] (auto&&, auto&&, auto&&, auto&&... args) { erase(std::forward<decltype(args)>(args)...); });
|
||||
registerStatusDatasetHandler("info",
|
||||
[this] (auto&&, auto&&, auto&&... args) { serveInfo(std::forward<decltype(args)>(args)...); });
|
||||
}
|
||||
|
||||
void
|
||||
@@ -99,7 +99,7 @@ CsManager::erase(const ControlParameters& parameters,
|
||||
}
|
||||
|
||||
void
|
||||
CsManager::serveInfo(const Name&, const Interest&, ndn::mgmt::StatusDatasetContext& context) const
|
||||
CsManager::serveInfo(ndn::mgmt::StatusDatasetContext& context) const
|
||||
{
|
||||
ndn::nfd::CsInfo info;
|
||||
info.setCapacity(m_cs.getLimit());
|
||||
|
||||
@@ -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-2023, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
@@ -62,8 +62,7 @@ private:
|
||||
/** \brief Serve CS information dataset.
|
||||
*/
|
||||
void
|
||||
serveInfo(const Name& topPrefix, const Interest& interest,
|
||||
ndn::mgmt::StatusDatasetContext& context) const;
|
||||
serveInfo(ndn::mgmt::StatusDatasetContext& context) const;
|
||||
|
||||
public:
|
||||
static constexpr size_t ERASE_LIMIT = 256;
|
||||
|
||||
@@ -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,
|
||||
@@ -48,16 +48,19 @@ FaceManager::FaceManager(FaceSystem& faceSystem,
|
||||
{
|
||||
// register handlers for ControlCommand
|
||||
registerCommandHandler<ndn::nfd::FaceCreateCommand>("create",
|
||||
std::bind(&FaceManager::createFace, this, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&, auto&&... args) { createFace(std::forward<decltype(args)>(args)...); });
|
||||
registerCommandHandler<ndn::nfd::FaceUpdateCommand>("update",
|
||||
std::bind(&FaceManager::updateFace, this, _3, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&... args) { updateFace(std::forward<decltype(args)>(args)...); });
|
||||
registerCommandHandler<ndn::nfd::FaceDestroyCommand>("destroy",
|
||||
std::bind(&FaceManager::destroyFace, this, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&, auto&&... args) { destroyFace(std::forward<decltype(args)>(args)...); });
|
||||
|
||||
// register handlers for StatusDataset
|
||||
registerStatusDatasetHandler("list", std::bind(&FaceManager::listFaces, this, _3));
|
||||
registerStatusDatasetHandler("channels", std::bind(&FaceManager::listChannels, this, _3));
|
||||
registerStatusDatasetHandler("query", std::bind(&FaceManager::queryFaces, this, _2, _3));
|
||||
registerStatusDatasetHandler("list",
|
||||
[this] (auto&&, auto&&, auto&&... args) { listFaces(std::forward<decltype(args)>(args)...); });
|
||||
registerStatusDatasetHandler("channels",
|
||||
[this] (auto&&, auto&&, auto&&... args) { listChannels(std::forward<decltype(args)>(args)...); });
|
||||
registerStatusDatasetHandler("query",
|
||||
[this] (auto&&, auto&&... args) { queryFaces(std::forward<decltype(args)>(args)...); });
|
||||
|
||||
// register notification stream
|
||||
m_postNotification = registerNotificationStream("events");
|
||||
|
||||
@@ -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,
|
||||
@@ -45,16 +45,15 @@ FibManager::FibManager(Fib& fib, const FaceTable& faceTable,
|
||||
, m_faceTable(faceTable)
|
||||
{
|
||||
registerCommandHandler<ndn::nfd::FibAddNextHopCommand>("add-nexthop",
|
||||
std::bind(&FibManager::addNextHop, this, _2, _3, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&... args) { addNextHop(std::forward<decltype(args)>(args)...); });
|
||||
registerCommandHandler<ndn::nfd::FibRemoveNextHopCommand>("remove-nexthop",
|
||||
std::bind(&FibManager::removeNextHop, this, _2, _3, _4, _5));
|
||||
|
||||
registerStatusDatasetHandler("list", std::bind(&FibManager::listEntries, this, _1, _2, _3));
|
||||
[this] (auto&&, 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 Name&, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
FibManager::addNextHop(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done)
|
||||
{
|
||||
setFaceForSelfRegistration(interest, parameters);
|
||||
@@ -84,8 +83,7 @@ FibManager::addNextHop(const Name&, const Interest& interest,
|
||||
}
|
||||
|
||||
void
|
||||
FibManager::removeNextHop(const Name&, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
FibManager::removeNextHop(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done)
|
||||
{
|
||||
setFaceForSelfRegistration(interest, parameters);
|
||||
@@ -121,8 +119,7 @@ FibManager::removeNextHop(const Name&, const Interest& interest,
|
||||
}
|
||||
|
||||
void
|
||||
FibManager::listEntries(const Name&, const Interest&,
|
||||
ndn::mgmt::StatusDatasetContext& context)
|
||||
FibManager::listEntries(ndn::mgmt::StatusDatasetContext& context)
|
||||
{
|
||||
for (const auto& entry : m_fib) {
|
||||
const auto& nexthops = entry.getNextHops() |
|
||||
|
||||
@@ -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-2023, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
@@ -48,18 +48,15 @@ public:
|
||||
|
||||
private:
|
||||
void
|
||||
addNextHop(const Name& topPrefix, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
addNextHop(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done);
|
||||
|
||||
void
|
||||
removeNextHop(const Name& topPrefix, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
removeNextHop(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done);
|
||||
|
||||
void
|
||||
listEntries(const Name& topPrefix, const Interest& interest,
|
||||
ndn::mgmt::StatusDatasetContext& context);
|
||||
listEntries(ndn::mgmt::StatusDatasetContext& context);
|
||||
|
||||
private:
|
||||
void
|
||||
|
||||
@@ -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-2023, Regents of the University of California,
|
||||
* Arizona Board of Regents,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University,
|
||||
@@ -35,7 +35,7 @@ ForwarderStatusManager::ForwarderStatusManager(Forwarder& forwarder, Dispatcher&
|
||||
, m_startTimestamp(time::system_clock::now())
|
||||
{
|
||||
m_dispatcher.addStatusDataset("status/general", ndn::mgmt::makeAcceptAllAuthorization(),
|
||||
std::bind(&ForwarderStatusManager::listGeneralStatus, this, _1, _2, _3));
|
||||
[this] (auto&&, auto&&, auto&& ctx) { listGeneralStatus(std::forward<decltype(ctx)>(ctx)); });
|
||||
}
|
||||
|
||||
ndn::nfd::ForwarderStatus
|
||||
@@ -67,8 +67,7 @@ ForwarderStatusManager::collectGeneralStatus()
|
||||
}
|
||||
|
||||
void
|
||||
ForwarderStatusManager::listGeneralStatus(const Name&, const Interest&,
|
||||
ndn::mgmt::StatusDatasetContext& context)
|
||||
ForwarderStatusManager::listGeneralStatus(ndn::mgmt::StatusDatasetContext& context)
|
||||
{
|
||||
auto status = this->collectGeneralStatus();
|
||||
const auto& wire = status.wireEncode();
|
||||
|
||||
@@ -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,8 +51,7 @@ private:
|
||||
* \brief Provides the general status dataset.
|
||||
*/
|
||||
void
|
||||
listGeneralStatus(const Name& topPrefix, const Interest& interest,
|
||||
ndn::mgmt::StatusDatasetContext& context);
|
||||
listGeneralStatus(ndn::mgmt::StatusDatasetContext& context);
|
||||
|
||||
private:
|
||||
Forwarder& m_forwarder;
|
||||
|
||||
@@ -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,
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
namespace nfd {
|
||||
|
||||
ManagerBase::ManagerBase(const std::string& module, Dispatcher& dispatcher)
|
||||
ManagerBase::ManagerBase(std::string_view module, Dispatcher& dispatcher)
|
||||
: m_module(module)
|
||||
, m_dispatcher(dispatcher)
|
||||
{
|
||||
}
|
||||
|
||||
ManagerBase::ManagerBase(const std::string& module, Dispatcher& dispatcher,
|
||||
ManagerBase::ManagerBase(std::string_view module, Dispatcher& dispatcher,
|
||||
CommandAuthenticator& authenticator)
|
||||
: m_module(module)
|
||||
, m_dispatcher(dispatcher)
|
||||
|
||||
@@ -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,
|
||||
@@ -64,11 +64,11 @@ public:
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @warning if you use this constructor, you MUST override makeAuthorization()
|
||||
* @warning If you use this constructor, you MUST override makeAuthorization().
|
||||
*/
|
||||
ManagerBase(const std::string& module, Dispatcher& dispatcher);
|
||||
ManagerBase(std::string_view module, Dispatcher& dispatcher);
|
||||
|
||||
ManagerBase(const std::string& module, Dispatcher& dispatcher,
|
||||
ManagerBase(std::string_view module, Dispatcher& dispatcher,
|
||||
CommandAuthenticator& authenticator);
|
||||
|
||||
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
|
||||
|
||||
@@ -60,11 +60,11 @@ RibManager::RibManager(rib::Rib& rib, ndn::Face& face, ndn::KeyChain& keyChain,
|
||||
, m_isLocalhopEnabled(false)
|
||||
{
|
||||
registerCommandHandler<ndn::nfd::RibRegisterCommand>("register",
|
||||
std::bind(&RibManager::registerEntry, this, _2, _3, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&... args) { registerEntry(std::forward<decltype(args)>(args)...); });
|
||||
registerCommandHandler<ndn::nfd::RibUnregisterCommand>("unregister",
|
||||
std::bind(&RibManager::unregisterEntry, this, _2, _3, _4, _5));
|
||||
|
||||
registerStatusDatasetHandler("list", std::bind(&RibManager::listEntries, this, _1, _2, _3));
|
||||
[this] (auto&&, auto&&, auto&&... args) { unregisterEntry(std::forward<decltype(args)>(args)...); });
|
||||
registerStatusDatasetHandler("list",
|
||||
[this] (auto&&, auto&&, auto&&... args) { listEntries(std::forward<decltype(args)>(args)...); });
|
||||
}
|
||||
|
||||
void
|
||||
@@ -215,8 +215,7 @@ RibManager::registerTopPrefix(const Name& topPrefix)
|
||||
}
|
||||
|
||||
void
|
||||
RibManager::registerEntry(const Name& topPrefix, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
RibManager::registerEntry(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done)
|
||||
{
|
||||
if (parameters.getName().size() > Fib::getMaxDepth()) {
|
||||
@@ -246,8 +245,7 @@ RibManager::registerEntry(const Name& topPrefix, const Interest& interest,
|
||||
}
|
||||
|
||||
void
|
||||
RibManager::unregisterEntry(const Name&, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
RibManager::unregisterEntry(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done)
|
||||
{
|
||||
setFaceForSelfRegistration(interest, parameters);
|
||||
@@ -263,7 +261,7 @@ RibManager::unregisterEntry(const Name&, const Interest& interest,
|
||||
}
|
||||
|
||||
void
|
||||
RibManager::listEntries(const Name&, const Interest&, ndn::mgmt::StatusDatasetContext& context)
|
||||
RibManager::listEntries(ndn::mgmt::StatusDatasetContext& context)
|
||||
{
|
||||
auto now = time::steady_clock::now();
|
||||
for (const auto& kv : m_rib) {
|
||||
@@ -426,9 +424,8 @@ RibManager::fetchActiveFaces()
|
||||
NFD_LOG_DEBUG("Fetching active faces");
|
||||
|
||||
m_nfdController.fetch<ndn::nfd::FaceDataset>(
|
||||
std::bind(&RibManager::removeInvalidFaces, this, _1),
|
||||
std::bind(&RibManager::onFetchActiveFacesFailure, this, _1, _2),
|
||||
ndn::nfd::CommandOptions());
|
||||
[this] (auto&&... args) { removeInvalidFaces(std::forward<decltype(args)>(args)...); },
|
||||
[this] (auto&&... args) { onFetchActiveFacesFailure(std::forward<decltype(args)>(args)...); });
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -200,22 +200,19 @@ private: // management Dispatcher related
|
||||
/** \brief Serve rib/register command.
|
||||
*/
|
||||
void
|
||||
registerEntry(const Name& topPrefix, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
registerEntry(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done);
|
||||
|
||||
/** \brief Serve rib/unregister command.
|
||||
*/
|
||||
void
|
||||
unregisterEntry(const Name& topPrefix, const Interest& interest,
|
||||
ControlParameters parameters,
|
||||
unregisterEntry(const Interest& interest, ControlParameters parameters,
|
||||
const ndn::mgmt::CommandContinuation& done);
|
||||
|
||||
/** \brief Serve rib/list dataset.
|
||||
*/
|
||||
void
|
||||
listEntries(const Name& topPrefix, const Interest& interest,
|
||||
ndn::mgmt::StatusDatasetContext& context);
|
||||
listEntries(ndn::mgmt::StatusDatasetContext& context);
|
||||
|
||||
void
|
||||
setFaceForSelfRegistration(const Interest& request, ControlParameters& parameters);
|
||||
|
||||
@@ -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,
|
||||
@@ -43,12 +43,11 @@ StrategyChoiceManager::StrategyChoiceManager(StrategyChoice& strategyChoice,
|
||||
, m_table(strategyChoice)
|
||||
{
|
||||
registerCommandHandler<ndn::nfd::StrategyChoiceSetCommand>("set",
|
||||
std::bind(&StrategyChoiceManager::setStrategy, this, _4, _5));
|
||||
[this] (auto&&, auto&&, auto&&, auto&&... args) { setStrategy(std::forward<decltype(args)>(args)...); });
|
||||
registerCommandHandler<ndn::nfd::StrategyChoiceUnsetCommand>("unset",
|
||||
std::bind(&StrategyChoiceManager::unsetStrategy, this, _4, _5));
|
||||
|
||||
[this] (auto&&, auto&&, auto&&, auto&&... args) { unsetStrategy(std::forward<decltype(args)>(args)...); });
|
||||
registerStatusDatasetHandler("list",
|
||||
std::bind(&StrategyChoiceManager::listChoices, this, _3));
|
||||
[this] (auto&&, auto&&, auto&&... args) { listChoices(std::forward<decltype(args)>(args)...); });
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+9
-7
@@ -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,
|
||||
@@ -410,14 +410,16 @@ Rib::sendBatchFromQueue()
|
||||
UpdateQueueItem item = std::move(m_updateBatches.front());
|
||||
m_updateBatches.pop_front();
|
||||
|
||||
RibUpdateBatch& batch = item.batch;
|
||||
|
||||
// Until task #1698, each RibUpdateBatch contains exactly one RIB update
|
||||
BOOST_ASSERT(batch.size() == 1);
|
||||
BOOST_ASSERT(item.batch.size() == 1);
|
||||
|
||||
auto fibSuccessCb = std::bind(&Rib::onFibUpdateSuccess, this, batch, _1, item.managerSuccessCallback);
|
||||
auto fibFailureCb = std::bind(&Rib::onFibUpdateFailure, this, item.managerFailureCallback, _1, _2);
|
||||
m_fibUpdater->computeAndSendFibUpdates(batch, fibSuccessCb, fibFailureCb);
|
||||
m_fibUpdater->computeAndSendFibUpdates(item.batch,
|
||||
[this, batch = item.batch, successCb = item.managerSuccessCallback] (const auto& routes) {
|
||||
onFibUpdateSuccess(batch, routes, successCb);
|
||||
},
|
||||
[this, failureCb = item.managerFailureCallback] (const auto& code, const auto& error) {
|
||||
onFibUpdateFailure(failureCb, code, error);
|
||||
});
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
namespace nfd::cs::lru {
|
||||
|
||||
const std::string LruPolicy::POLICY_NAME = "lru";
|
||||
NFD_REGISTER_CS_POLICY(LruPolicy);
|
||||
|
||||
LruPolicy::LruPolicy()
|
||||
|
||||
@@ -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,
|
||||
@@ -43,16 +43,14 @@ using Queue = boost::multi_index_container<
|
||||
>
|
||||
>;
|
||||
|
||||
/** \brief Least-Recently-Used (LRU) replacement policy.
|
||||
/**
|
||||
* \brief Least-Recently-Used (LRU) replacement policy.
|
||||
*/
|
||||
class LruPolicy final : public Policy
|
||||
{
|
||||
public:
|
||||
LruPolicy();
|
||||
|
||||
public:
|
||||
static const std::string POLICY_NAME;
|
||||
|
||||
private:
|
||||
void
|
||||
doAfterInsert(EntryRef i) final;
|
||||
@@ -69,12 +67,15 @@ private:
|
||||
void
|
||||
evictEntries() final;
|
||||
|
||||
private:
|
||||
/** \brief Moves an entry to the end of queue.
|
||||
/**
|
||||
* \brief Moves an entry to the end of queue.
|
||||
*/
|
||||
void
|
||||
insertToQueue(EntryRef i, bool isNewEntry);
|
||||
|
||||
public:
|
||||
static constexpr std::string_view POLICY_NAME{"lru"};
|
||||
|
||||
private:
|
||||
Queue m_queue;
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
namespace nfd::cs::priority_fifo {
|
||||
|
||||
const std::string PriorityFifoPolicy::POLICY_NAME = "priority_fifo";
|
||||
NFD_REGISTER_CS_POLICY(PriorityFifoPolicy);
|
||||
|
||||
PriorityFifoPolicy::PriorityFifoPolicy()
|
||||
|
||||
@@ -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,
|
||||
@@ -68,9 +68,6 @@ public:
|
||||
|
||||
~PriorityFifoPolicy() final;
|
||||
|
||||
public:
|
||||
static const std::string POLICY_NAME;
|
||||
|
||||
private:
|
||||
void
|
||||
doAfterInsert(EntryRef i) final;
|
||||
@@ -111,6 +108,9 @@ private:
|
||||
void
|
||||
moveToStaleQueue(EntryRef i);
|
||||
|
||||
public:
|
||||
static constexpr std::string_view POLICY_NAME{"priority_fifo"};
|
||||
|
||||
private:
|
||||
Queue m_queues[QUEUE_MAX];
|
||||
std::map<EntryRef, EntryInfo*> m_entryInfoMap;
|
||||
|
||||
@@ -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,
|
||||
@@ -40,10 +40,10 @@ class Policy : noncopyable
|
||||
public: // registry
|
||||
template<typename P>
|
||||
static void
|
||||
registerPolicy(const std::string& policyName = P::POLICY_NAME)
|
||||
registerPolicy(std::string_view policyName = P::POLICY_NAME)
|
||||
{
|
||||
BOOST_ASSERT(!policyName.empty());
|
||||
auto r = getRegistry().insert_or_assign(policyName, [] { return make_unique<P>(); });
|
||||
auto r = getRegistry().insert_or_assign(std::string(policyName), [] { return make_unique<P>(); });
|
||||
BOOST_VERIFY(r.second);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
@@ -580,7 +580,7 @@ BOOST_AUTO_TEST_CASE(NoCongestion)
|
||||
options.allowCongestionMarking = true;
|
||||
options.baseCongestionMarkingInterval = 100_ms;
|
||||
initialize(options, MTU_UNLIMITED, 65536);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -594,7 +594,7 @@ BOOST_AUTO_TEST_CASE(NoCongestion)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
|
||||
lp::Packet pkt1(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt1.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -604,7 +604,7 @@ BOOST_AUTO_TEST_CASE(NoCongestion)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 2);
|
||||
lp::Packet pkt2(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
}
|
||||
@@ -615,7 +615,7 @@ BOOST_AUTO_TEST_CASE(CongestionCoDel)
|
||||
options.allowCongestionMarking = true;
|
||||
options.baseCongestionMarkingInterval = 100_ms;
|
||||
initialize(options, MTU_UNLIMITED, 65536);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -627,7 +627,7 @@ BOOST_AUTO_TEST_CASE(CongestionCoDel)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
|
||||
lp::Packet pkt0(transport->sentPackets.back());
|
||||
BOOST_REQUIRE_EQUAL(pkt0.count<lp::CongestionMarkField>(), 0);
|
||||
time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
|
||||
auto nextMarkTime = time::steady_clock::now() + 100_ms;
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
|
||||
|
||||
time::nanoseconds markingInterval(
|
||||
@@ -747,7 +747,7 @@ BOOST_AUTO_TEST_CASE(CongestionCoDel)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 9);
|
||||
lp::Packet pkt8(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt8.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 4);
|
||||
|
||||
@@ -823,7 +823,7 @@ BOOST_AUTO_TEST_CASE(CongestionCoDel)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 14);
|
||||
lp::Packet pkt13(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt13.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 6);
|
||||
|
||||
@@ -847,7 +847,7 @@ BOOST_AUTO_TEST_CASE(CongestionCoDel)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 16);
|
||||
lp::Packet pkt15(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt15.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 6);
|
||||
}
|
||||
@@ -858,7 +858,7 @@ BOOST_AUTO_TEST_CASE(DefaultThreshold)
|
||||
options.allowCongestionMarking = true;
|
||||
options.baseCongestionMarkingInterval = 100_ms;
|
||||
initialize(options, MTU_UNLIMITED, QUEUE_UNSUPPORTED);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -873,7 +873,7 @@ BOOST_AUTO_TEST_CASE(DefaultThreshold)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
|
||||
lp::Packet pkt1(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt1.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -883,7 +883,7 @@ BOOST_AUTO_TEST_CASE(DefaultThreshold)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 2);
|
||||
lp::Packet pkt2(transport->sentPackets.back());
|
||||
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::time_point::max());
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -893,7 +893,7 @@ BOOST_AUTO_TEST_CASE(DefaultThreshold)
|
||||
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 3);
|
||||
lp::Packet pkt3(transport->sentPackets.back());
|
||||
BOOST_REQUIRE_EQUAL(pkt3.count<lp::CongestionMarkField>(), 0);
|
||||
time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
|
||||
auto nextMarkTime = time::steady_clock::now() + 100_ms;
|
||||
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
|
||||
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
|
||||
BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 0);
|
||||
|
||||
@@ -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,
|
||||
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(ExpirationTime)
|
||||
{
|
||||
auto transport = make_unique<NullTransport>();
|
||||
|
||||
BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SendQueue)
|
||||
|
||||
@@ -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,
|
||||
@@ -111,13 +111,13 @@ BOOST_AUTO_TEST_CASE(ExpirationTime)
|
||||
{
|
||||
SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
|
||||
initializeUnicast(nullptr, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
|
||||
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
|
||||
BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
|
||||
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Close)
|
||||
|
||||
@@ -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,
|
||||
@@ -67,13 +67,13 @@ BOOST_AUTO_TEST_CASE(PersistencyChange)
|
||||
BOOST_AUTO_TEST_CASE(ExpirationTime)
|
||||
{
|
||||
TRANSPORT_TEST_INIT(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
|
||||
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
|
||||
BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
|
||||
transport->setPersistency(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
|
||||
BOOST_CHECK_NE(transport->getExpirationTime(), time::steady_clock::time_point::max());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(IdleClose)
|
||||
|
||||
@@ -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,
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
findFaceIdByUri(const std::string& uri) const;
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
Dispatcher dispatcher;
|
||||
shared_ptr<CommandAuthenticator> authenticator;
|
||||
|
||||
|
||||
@@ -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,
|
||||
@@ -45,7 +45,7 @@ protected:
|
||||
FaceTable m_faceTable;
|
||||
Forwarder m_forwarder;
|
||||
ForwarderStatusManager m_manager;
|
||||
time::system_clock::TimePoint m_startTime;
|
||||
time::system_clock::time_point m_startTime;
|
||||
};
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(Mgmt)
|
||||
|
||||
@@ -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,
|
||||
@@ -146,7 +146,7 @@ public: // verify
|
||||
concatenateResponses(size_t startIndex = 0, size_t nResponses = 0);
|
||||
|
||||
protected:
|
||||
ndn::util::DummyClientFace m_face{g_io, m_keyChain, {true, true}};
|
||||
ndn::DummyClientFace m_face{g_io, m_keyChain, {true, true}};
|
||||
Dispatcher m_dispatcher{m_face, m_keyChain};
|
||||
std::vector<Data>& m_responses{m_face.sentData};
|
||||
};
|
||||
|
||||
@@ -178,7 +178,7 @@ protected:
|
||||
unique_ptr<RibManager> manager;
|
||||
|
||||
private:
|
||||
ndn::util::DummyClientFace m_face;
|
||||
ndn::DummyClientFace m_face;
|
||||
ndn::nfd::Controller m_nfdController;
|
||||
Dispatcher m_dispatcher;
|
||||
MockFibUpdater m_fibUpdater;
|
||||
|
||||
@@ -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,
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ndn::nfd::Controller controller;
|
||||
|
||||
rib::Rib rib;
|
||||
|
||||
@@ -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,
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
uint32_t nFailureCallbacks;
|
||||
|
||||
protected:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ndn::nfd::Controller controller;
|
||||
Rib rib;
|
||||
NfdRibReadvertiseDestination dest;
|
||||
|
||||
@@ -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,
|
||||
@@ -157,7 +157,7 @@ protected:
|
||||
unique_ptr<Readvertise> readvertise;
|
||||
|
||||
private:
|
||||
ndn::util::DummyClientFace m_face;
|
||||
ndn::DummyClientFace m_face;
|
||||
Rib m_rib;
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
@@ -204,7 +204,7 @@ private:
|
||||
}
|
||||
|
||||
protected:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
std::function<void(const Interest&)> processInterest;
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
@@ -46,7 +46,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
util::DummyClientFace face{{true, true}};
|
||||
DummyClientFace face{{true, true}};
|
||||
unique_ptr<Program> program;
|
||||
};
|
||||
|
||||
@@ -88,12 +88,11 @@ BOOST_AUTO_TEST_CASE(RoutablePrefixesDataset)
|
||||
}
|
||||
this->initialize(options);
|
||||
|
||||
util::DummyClientFace clientFace(face.getIoService());
|
||||
DummyClientFace clientFace(face.getIoService());
|
||||
clientFace.linkTo(face);
|
||||
|
||||
Name baseName("/localhop/nfd/rib/routable-prefixes");
|
||||
auto fetcher = util::SegmentFetcher::start(clientFace, Interest(baseName),
|
||||
security::getAcceptAllValidator());
|
||||
auto fetcher = SegmentFetcher::start(clientFace, Interest(baseName), security::getAcceptAllValidator());
|
||||
fetcher->afterSegmentReceived.connect([baseName] (const Data& data) {
|
||||
const Name& dataName = data.getName();
|
||||
BOOST_CHECK_EQUAL(dataName.size(), baseName.size() + 2);
|
||||
|
||||
@@ -149,7 +149,7 @@ protected:
|
||||
}
|
||||
|
||||
protected:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ValidatorNull validator;
|
||||
ndn::nfd::Controller controller;
|
||||
StatusReportTester report;
|
||||
|
||||
@@ -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,
|
||||
@@ -74,11 +74,12 @@ private:
|
||||
registerPrefixes(uint64_t hubFaceId, size_t index = 0);
|
||||
|
||||
public:
|
||||
/** \brief Signal when procedure completes.
|
||||
/**
|
||||
* \brief Signal emitted when the procedure completes.
|
||||
*
|
||||
* Argument indicates whether the procedure succeeds (true) or fails (false).
|
||||
* Argument indicates whether the procedure succeeds (true) or fails (false).
|
||||
*/
|
||||
util::Signal<Procedure, bool> onComplete;
|
||||
signal::Signal<Procedure, bool> onComplete;
|
||||
|
||||
NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
|
||||
std::vector<unique_ptr<Stage>> m_stages;
|
||||
|
||||
@@ -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,
|
||||
@@ -33,7 +33,8 @@
|
||||
|
||||
namespace ndn::autoconfig {
|
||||
|
||||
/** \brief A discovery stage.
|
||||
/**
|
||||
* \brief A discovery stage.
|
||||
*/
|
||||
class Stage : boost::noncopyable
|
||||
{
|
||||
@@ -76,17 +77,19 @@ private:
|
||||
doStart() = 0;
|
||||
|
||||
public:
|
||||
/** \brief Signal when a HUB FaceUri is found.
|
||||
/**
|
||||
* \brief Signal emitted when a HUB FaceUri is found.
|
||||
*
|
||||
* Argument is HUB FaceUri, may not be canonical.
|
||||
* Argument is HUB FaceUri, may not be canonical.
|
||||
*/
|
||||
util::Signal<Stage, FaceUri> onSuccess;
|
||||
signal::Signal<Stage, FaceUri> onSuccess;
|
||||
|
||||
/** \brief Signal when discovery fails.
|
||||
/**
|
||||
* \brief Signal emitted when discovery fails.
|
||||
*
|
||||
* Argument is error message.
|
||||
* Argument is error message.
|
||||
*/
|
||||
util::Signal<Stage, std::string> onFailure;
|
||||
signal::Signal<Stage, std::string> onFailure;
|
||||
|
||||
private:
|
||||
bool m_isInProgress = false;
|
||||
|
||||
Reference in new issue
Block a user