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 std::bind(&ForwarderStatusManager::listGeneralStatus,
this, _1, _2, _3));
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(
const Name&,
const Interest&,
71 ndn::mgmt::StatusDatasetContext& context)
73 auto status = this->collectGeneralStatus();
74 const auto& wire = status.wireEncode();
76 for (
const auto& subblock : wire.elements()) {
77 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
const char NFD_VERSION_BUILD_STRING[]
NFD version string, including git commit information if NFD is build from a specific git commit.