|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
40 , m_fwCounters(fwCounters)
42 registerCommandHandler<ndn::nfd::CsConfigCommand>(
"config",
43 bind(&CsManager::changeConfig,
this, _4, _5));
44 registerCommandHandler<ndn::nfd::CsEraseCommand>(
"erase",
45 bind(&CsManager::erase,
this, _4, _5));
79 size_t count = parameters.hasCount() ?
80 parameters.getCount() :
81 std::numeric_limits<size_t>::max();
83 [=] (
size_t nErased) {
84 ControlParameters body;
85 body.setName(parameters.getName());
86 body.setCount(nErased);
87 if (nErased == ERASE_LIMIT && count > ERASE_LIMIT) {
88 m_cs.find(Interest(parameters.getName()).setCanBePrefix(true),
89 [=] (const Interest&, const Data&) mutable {
90 body.setCapacity(ERASE_LIMIT);
91 done(ControlResponse(200,
"OK").setBody(body.wireEncode()));
93 [=] (const Interest&) {
94 done(ControlResponse(200,
"OK").setBody(body.wireEncode()));
98 done(ControlResponse(200,
"OK").setBody(body.wireEncode()));
104 CsManager::serveInfo(
const Name& topPrefix,
const Interest& interest,
112 info.
setNHits(m_fwCounters.nCsHits);
size_t getLimit() const
get capacity (in number of packets)
bool shouldAdmit() const
get CS_ENABLE_ADMIT flag
void enableAdmit(bool shouldAdmit)
set CS_ENABLE_ADMIT flag
void append(const Block &block)
append a Block to the response
CsInfo & setNMisses(uint64_t nMisses)
implements the Content Store
size_t wireEncode(EncodingImpl< TAG > &encoder) const
std::function< void(const ControlResponse &resp)> CommandContinuation
a function to be called after ControlCommandHandler completes
mgmt::ControlResponse ControlResponse
void registerStatusDatasetHandler(const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
void enableServe(bool shouldServe)
set CS_ENABLE_SERVE flag
CsInfo & setNHits(uint64_t nHits)
bool hasFlagBit(size_t bit) const
represents the CS Information dataset
counters provided by Forwarder
CsInfo & setEnableServe(bool enableServe)
CsInfo & setNEntries(uint64_t nEntries)
Copyright (c) 2011-2015 Regents of the University of California.
void erase(const Name &prefix, size_t limit, AfterEraseCallback &&cb)
asynchronously erases entries under prefix
provides a context for generating response to a StatusDataset request
static constexpr size_t ERASE_LIMIT
CsFlagBit
CS enablement flags.
CsInfo & setEnableAdmit(bool enableAdmit)
@ BIT_CS_ENABLE_SERVE
enables the CS to satisfy Interests using cached Data
CsManager(cs::Cs &cs, const ForwarderCounters &fwCounters, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
bool getFlagBit(size_t bit) const
@ BIT_CS_ENABLE_ADMIT
enables the CS to admit new Data
A collection of common functions shared by all NFD managers, such as communicating with the dispatche...
represents parameters in a ControlCommand request or response
represents a dispatcher on server side of NFD Management protocol
void setLimit(size_t nMaxPackets)
change capacity (in number of packets)
void end()
end the response successfully after appending zero or more blocks
bool shouldServe() const
get CS_ENABLE_SERVE flag
uint64_t getCapacity() const
Provides ControlCommand authorization according to NFD configuration file.
CsInfo & setCapacity(uint64_t capacity)