28 #include "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,
74 static const PartialName PREFIX_STATUS_GENERAL(
"status/general");
77 if (subPrefix == PREFIX_STATUS_GENERAL || subPrefix == PREFIX_STATUS) {
78 context.
setPrefix(
Name(topPrefix).append(PREFIX_STATUS_GENERAL));
86 context.
setExpiry(STATUS_SERVER_DEFAULT_FRESHNESS);
88 auto status = this->collectGeneralStatus();
89 status.wireEncode().parse();
90 for (
const auto& subblock : status.wireEncode().elements()) {
void reject(const ControlResponse &resp=ControlResponse().setCode(400))
declare the non-existence of a response
ForwarderStatus & setNOutDatas(uint64_t nOutDatas)
represents NFD Forwarder Status
StatusDatasetContext & setExpiry(const time::milliseconds &expiry)
set expiration duration
ForwarderStatus & setNFibEntries(size_t nFibEntries)
counters provided by Forwarder
ForwarderStatus & setNOutNacks(uint64_t nOutNacks)
represents a dispatcher on server side of NFD Management protocol
ForwarderStatus & setNInNacks(uint64_t nInNacks)
PacketCounter nInInterests
represents an Interest packet
ForwarderStatus & setNCsEntries(size_t nCsEntries)
static time_point now() noexcept
Authorization makeAcceptAllAuthorization()
size_t size() const
Get the number of occupied entries in the Name Tree.
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
Measurements & getMeasurements()
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
Name abstraction to represent an absolute name.
ForwarderStatus & setNPitEntries(size_t nPitEntries)
PacketCounter nOutInterests
size_t size() const
Get the number of components.
void addStatusDataset(const PartialName &relPrefix, const Authorization &authorization, const StatusDatasetHandler &handler)
register a StatusDataset or a prefix under which StatusDatasets can be requested
const time::milliseconds STATUS_SERVER_DEFAULT_FRESHNESS
const ForwarderCounters & getCounters() const
ForwarderStatus & setNInDatas(uint64_t nInDatas)
StatusDatasetContext & setPrefix(const Name &prefix)
change prefix of Data packets
void append(const Block &block)
append a Block to the response
Name PartialName
Partial name abstraction to represent an arbitrary sequence of name components.
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)
PartialName getSubName(ssize_t iStartComponent, size_t nComponents=npos) const
Extract a sub-name (PartialName) of nComponents components starting from iStartComponent.
const Name & getName() const