35 const std::string& module)
36 : m_dispatcher(dispatcher)
37 , m_validator(validator)
38 , m_mgmtModuleName(module)
59 ManagerBase::authorize(
const Name& prefix,
const Interest& interest,
64 BOOST_ASSERT(params !=
nullptr);
68 bind(&ManagerBase::extractRequester,
this, interest, accept),
73 ManagerBase::extractRequester(
const Interest& interest,
80 if (!sigInfo.hasKeyLocator() ||
85 accept(sigInfo.getKeyLocator().getName().toUri());
95 BOOST_ASSERT(dynamic_cast<const ControlParameters*>(¶meters) !=
nullptr);
98 command.
validateRequest(static_cast<const ControlParameters&>(parameters));
107 ManagerBase::handleCommand(shared_ptr<nfd::ControlCommand> command,
113 BOOST_ASSERT(dynamic_cast<const ControlParameters*>(¶ms) !=
nullptr);
115 command->applyDefaultsToRequest(parameters);
116 handler(*command, prefix, interest, parameters, done);
const Component & at(ssize_t i) const
Get component at the specified index.
represents parameters in a ControlCommand request or response
std::function< void(const Block ¬ification)> PostNotification
a function to post a notification
represents a dispatcher on server side of NFD Management protocol
reply with a ControlResponse where StatusCode is 403
base class of NFD ControlCommand
represents an Interest packet
virtual void validateRequest(const ControlParameters ¶meters) const
validate request parameters
std::function< void(RejectReply act)> RejectContinuation
a function to be called if authorization is rejected
std::function< void(const std::string &requester)> AcceptContinuation
a function to be called if authorization is successful
indicates KeyLocator contains a Name
Authorization makeAcceptAllAuthorization()
Copyright (c) 2011-2015 Regents of the University of California.
Name abstraction to represent an absolute name.
std::function< void(const ControlResponse &resp)> CommandContinuation
a function to be called after ControlCommandHandler completes
base class for a struct that contains ControlCommand parameters
ManagerBase(Dispatcher &dispatcher, CommandValidator &validator, const std::string &module)
void addStatusDataset(const PartialName &relPrefix, const Authorization &authorization, const StatusDatasetHandler &handler)
register a StatusDataset or a prefix under which StatusDatasets can be requested
Block blockFromValue() const
std::function< bool(const ControlParameters ¶ms)> ValidateParameters
a function to validate input ControlParameters
ndn::mgmt::PostNotification registerNotificationStream(const std::string &verb)
represents an error in ControlParameters
void validate(const Interest &interest, const ndn::OnInterestValidated &onValidated, const ndn::OnInterestValidationFailed &onValidationFailed)
void addSupportedPrivilege(const std::string &privilege)
std::function< void(const Name &prefix, const Interest &interest, const ControlParameters *params, const AcceptContinuation &accept, const RejectContinuation &reject)> Authorization
a function that performs authorization
void registerStatusDatasetHandler(const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
represents an error in TLV encoding or decoding
PostNotification addNotificationStream(const PartialName &relPrefix)
register a NotificationStream
function< void(const ControlCommand &command, const Name &prefix, const Interest &interest, const ControlParameters ¶meters, const ndn::mgmt::CommandContinuation done)> ControlCommandHandler
const Name & getName() const
std::function< void(const Name &prefix, const Interest &interest, StatusDatasetContext &context)> StatusDatasetHandler
a function to handle a StatusDataset request