28 #include "core/version.hpp" 35 : m_forwarder(forwarder)
36 , m_dispatcher(dispatcher)
37 , m_startTimestamp(
time::system_clock::now())
40 bind(&ForwarderStatusManager::listGeneralStatus,
this, _1, _2, _3));
44 ForwarderStatusManager::collectGeneralStatus()
70 ForwarderStatusManager::listGeneralStatus(
const Name& topPrefix,
const Interest& interest,
75 auto status = this->collectGeneralStatus();
76 const Block& wire = status.wireEncode();
78 for (
const auto& subblock : wire.
elements()) {
represents NFD General Status dataset
StatusDatasetContext & setExpiry(const time::milliseconds &expiry)
set expiration duration
const element_container & elements() const
Get container of sub elements.
ForwarderStatus & setNFibEntries(size_t nFibEntries)
static const time::milliseconds STATUS_FRESHNESS(5000)
counters provided by Forwarder
ForwarderStatus & setNOutNacks(uint64_t nOutNacks)
represents a dispatcher on server side of NFD Management protocol
boost::posix_time::time_duration milliseconds(long duration)
ForwarderStatus & setNInData(uint64_t nInData)
ForwarderStatus & setNOutData(uint64_t nOutData)
ForwarderStatus & setNInNacks(uint64_t nInNacks)
const ForwarderCounters & getCounters() const
PacketCounter nInInterests
Represents a TLV element of NDN packet format.
represents an Interest packet
ForwarderStatus & setNCsEntries(size_t nCsEntries)
static time_point now() noexcept
Authorization makeAcceptAllAuthorization()
ForwarderStatus & setNNameTreeEntries(size_t nNameTreeEntries)
ForwarderStatus & setNInInterests(uint64_t nInInterests)
ForwarderStatus & setStartTimestamp(const time::system_clock::TimePoint &startTimestamp)
Copyright (c) 2011-2015 Regents of the University of California.
void end()
end the response successfully after appending zero or more blocks
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
Represents an absolute name.
ForwarderStatus & setNPitEntries(size_t nPitEntries)
PacketCounter nOutInterests
void parse() const
Parse TLV-VALUE into sub elements.
void addStatusDataset(const PartialName &relPrefix, const Authorization &authorization, const StatusDatasetHandler &handler)
register a StatusDataset or a prefix under which StatusDatasets can be requested
Measurements & getMeasurements()
void append(const Block &block)
append a Block to the response
provides a context for generating response to a StatusDataset request
ForwarderStatus & setNMeasurementsEntries(size_t nMeasurementsEntries)
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint ¤tTimestamp)
ForwarderStatusManager(Forwarder &forwarder, Dispatcher &dispatcher)