33 : m_forwarder(forwarder)
34 , m_dispatcher(dispatcher)
35 , m_startTimestamp(time::system_clock::now())
37 m_dispatcher.addStatusDataset(
"status/general", ndn::mgmt::makeAcceptAllAuthorization(),
38 [
this] (
auto&&,
auto&&,
auto&& ctx) { listGeneralStatus(std::forward<decltype(ctx)>(ctx)); });
41 ndn::nfd::ForwarderStatus
42 ForwarderStatusManager::collectGeneralStatus()
44 ndn::nfd::ForwarderStatus status;
47 status.setStartTimestamp(m_startTimestamp);
48 status.setCurrentTimestamp(time::system_clock::now());
51 status.setNFibEntries(m_forwarder.
getFib().
size());
52 status.setNPitEntries(m_forwarder.
getPit().
size());
54 status.setNCsEntries(m_forwarder.
getCs().
size());
57 status.setNInInterests(counters.nInInterests)
58 .setNOutInterests(counters.nOutInterests)
59 .setNInData(counters.nInData)
60 .setNOutData(counters.nOutData)
61 .setNInNacks(counters.nInNacks)
62 .setNOutNacks(counters.nOutNacks)
63 .setNSatisfiedInterests(counters.nSatisfiedInterests)
64 .setNUnsatisfiedInterests(counters.nUnsatisfiedInterests);
70 ForwarderStatusManager::listGeneralStatus(ndn::mgmt::StatusDatasetContext& context)
72 auto status = this->collectGeneralStatus();
73 const auto& wire = status.wireEncode();
75 for (
const auto& subblock : wire.elements()) {
76 context.append(subblock);
Main class of NFD's forwarding engine.
NameTree & getNameTree() noexcept
Measurements & getMeasurements() noexcept
const ForwarderCounters & getCounters() const noexcept
ForwarderStatusManager(Forwarder &forwarder, Dispatcher &dispatcher)
size_t size() const
Get number of stored packets.
size_t size() const noexcept
size_t size() const
Returns the number of entries.
const char NFD_VERSION_BUILD_STRING[]
NFD version string, including git commit information if NFD is build from a specific git commit.