40 , m_fwCounters(fwCounters)
42 registerCommandHandler<ndn::nfd::CsConfigCommand>(
"config",
43 std::bind(&CsManager::changeConfig,
this, _4, _5));
44 registerCommandHandler<ndn::nfd::CsEraseCommand>(
"erase",
45 std::bind(&CsManager::erase,
this, _4, _5));
79 size_t count = parameters.
hasCount() ?
81 std::numeric_limits<size_t>::max();
83 [=] (
size_t nErased) {
CsInfo & setNHits(uint64_t nHits)
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest & interest
A collection of common functions shared by all NFD managers, such as communicating with the dispatche...
static constexpr size_t ERASE_LIMIT
Counters provided by Forwarder.
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest const ControlParameters const ndn::mgmt::CommandContinuation done
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)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
bool shouldAdmit() const
get CS_ENABLE_ADMIT flag
Represents an Interest packet.
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
const Name & getName() const
uint64_t getCount() const
mgmt::ControlResponse ControlResponse
Copyright (c) 2011-2015 Regents of the University of California.
CsInfo & setEnableServe(bool enableServe)
void end()
Finalizes 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 an absolute name.
represents the CS Information dataset
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
void append(span< const uint8_t > bytes)
Appends a sequence of bytes to the response.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
CsInfo & setCapacity(uint64_t capacity)
Provides ControlCommand authorization according to NFD configuration file.
ControlParameters & setName(const Name &name)
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest const ControlParameters & parameters
CsManager(cs::Cs &cs, const ForwarderCounters &fwCounters, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
ControlParameters & setCapacity(uint64_t capacity)
bool getFlagBit(size_t bit) const
Provides a context for generating the response to a StatusDataset request.
ControlParameters & setCount(uint64_t count)
CsFlagBit
CS enablement flags.
Represents a Data packet.
void registerStatusDatasetHandler(const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
ControlParameters & setFlagBit(size_t bit, bool value, bool wantMask=true)
set a bit in Flags
CsInfo & setNMisses(uint64_t nMisses)
void find(const Interest &interest, HitCallback &&hit, MissCallback &&miss) const
finds the best matching Data packet
void erase(const Name &prefix, size_t limit, AfterEraseCallback &&cb)
asynchronously erases entries under prefix
void enableServe(bool shouldServe)
set CS_ENABLE_SERVE flag