26 #include <ndn-cxx/mgmt/nfd/control-response.hpp>
27 #include <ndn-cxx/util/regex.hpp>
36 const ndn::PartialName
RT_DATASET = ndn::PartialName(
"routing-table");
41 : m_dispatcher(dispatcher)
45 setDispatcher(m_dispatcher);
49 DatasetInterestHandler::setDispatcher(ndn::mgmt::Dispatcher& dispatcher)
52 ndn::mgmt::makeAcceptAllAuthorization(),
53 std::bind(&DatasetInterestHandler::publishLsaStatus<AdjLsa>,
this, _1, _2, _3));
55 ndn::mgmt::makeAcceptAllAuthorization(),
56 std::bind(&DatasetInterestHandler::publishLsaStatus<CoordinateLsa>,
this, _1, _2, _3));
58 ndn::mgmt::makeAcceptAllAuthorization(),
59 std::bind(&DatasetInterestHandler::publishLsaStatus<NameLsa>,
this, _1, _2, _3));
61 ndn::mgmt::makeAcceptAllAuthorization(),
62 std::bind(&DatasetInterestHandler::publishRtStatus,
this, _1, _2, _3));
67 DatasetInterestHandler::publishLsaStatus(
const ndn::Name& topPrefix,
const ndn::Interest& interest,
68 ndn::mgmt::StatusDatasetContext& context)
71 for (
auto lsaIt = lsaRange.first; lsaIt != lsaRange.second; ++lsaIt) {
72 context.append((*lsaIt)->wireEncode());
78 DatasetInterestHandler::publishRtStatus(
const ndn::Name& topPrefix,
const ndn::Interest& interest,
79 ndn::mgmt::StatusDatasetContext& context)
DatasetInterestHandler(ndn::mgmt::Dispatcher &dispatcher, const Lsdb &lsdb, const RoutingTable &rt)
std::pair< LsaContainer::index< Lsdb::byType >::type::iterator, LsaContainer::index< Lsdb::byType >::type::iterator > getLsdbIterator() const
const ndn::Block & wireEncode() const
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
#define NLSR_LOG_DEBUG(x)
#define INIT_LOGGER(name)
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California,...
const ndn::PartialName ADJACENCIES_DATASET
const ndn::PartialName RT_DATASET
const ndn::PartialName NAMES_DATASET
const ndn::PartialName COORDINATES_DATASET