27 #include <ndn-cxx/mgmt/nfd/cs-info.hpp> 39 registerCommandHandler<ndn::nfd::CsConfigCommand>(
"config",
40 bind(&CsManager::changeConfig,
this, _4, _5));
41 registerCommandHandler<ndn::nfd::CsEraseCommand>(
"erase",
42 bind(&CsManager::erase,
this, _4, _5));
76 size_t count = parameters.hasCount() ?
77 parameters.getCount() :
78 std::numeric_limits<size_t>::max();
80 [=] (
size_t nErased) {
82 body.setName(parameters.getName());
83 body.setCount(nErased);
85 m_cs.
find(
Interest(parameters.getName()).setCanBePrefix(
true),
101 CsManager::serveInfo(
const Name& topPrefix,
const Interest& interest,
CsInfo & setNHits(uint64_t nHits)
static constexpr size_t ERASE_LIMIT
counters provided by Forwarder
represents parameters in a ControlCommand request or response
represents a dispatcher on server side of NFD Management protocol
size_t getLimit() const
get capacity (in number of packets)
CsManager(Cs &cs, const ForwarderCounters &fwCnt, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
bool shouldAdmit() const
get CS_ENABLE_ADMIT flag
CsInfo & setNEntries(uint64_t nEntries)
bool shouldServe() const
get CS_ENABLE_SERVE flag
void enableAdmit(bool shouldAdmit)
set CS_ENABLE_ADMIT flag
CsInfo & setEnableAdmit(bool enableAdmit)
uint64_t getCapacity() const
size_t size() const
get number of stored packets
mgmt::ControlResponse ControlResponse
Copyright (c) 2011-2015 Regents of the University of California.
void erase(const Name &prefix, size_t limit, const AfterEraseCallback &cb)
asynchronously erases entries under prefix
CsInfo & setEnableServe(bool enableServe)
void end()
end the response successfully after appending zero or more blocks
enables the CS to satisfy Interests using cached Data
void setLimit(size_t nMaxPackets)
change capacity (in number of packets)
enables the CS to admit new Data
represents the CS Information dataset
void find(const Interest &interest, const HitCallback &hitCallback, const MissCallback &missCallback) const
finds the best matching Data packet
bool hasFlagBit(size_t bit) const
std::function< void(const ControlResponse &resp)> CommandContinuation
a function to be called after ControlCommandHandler completes
implements the Content Store
size_t wireEncode(EncodingImpl< TAG > &encoder) const
CsInfo & setCapacity(uint64_t capacity)
provides ControlCommand authorization according to NFD configuration file
void append(const Block &block)
append a Block to the response
bool getFlagBit(size_t bit) const
provides a context for generating response to a StatusDataset request
a collection of common functions shared by all NFD managers, such as communicating with the dispatche...
CsFlagBit
CS enablement flags.
void registerStatusDatasetHandler(const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
CsInfo & setNMisses(uint64_t nMisses)
void enableServe(bool shouldServe)
set CS_ENABLE_SERVE flag