32 , m_dispatcher(dispatcher)
39 , m_dispatcher(dispatcher)
40 , m_authenticator(&authenticator)
69 if (!sigInfo.hasKeyLocator() || sigInfo.getKeyLocator().getType() !=
tlv::Name) {
73 accept(sigInfo.getKeyLocator().getName().toUri());
81 ManagerBase::makeAuthorization(
const std::string& verb)
83 BOOST_ASSERT(m_authenticator !=
nullptr);
91 BOOST_ASSERT(dynamic_cast<const ControlParameters*>(¶meters) !=
nullptr);
94 command.
validateRequest(static_cast<const ControlParameters&>(parameters));
109 BOOST_ASSERT(dynamic_cast<const ControlParameters*>(¶ms) !=
nullptr);
112 command->applyDefaultsToRequest(parameters);
113 handler(*command, prefix, interest, parameters, done);
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name & prefix
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest & interest
Represents a SignatureInfo or InterestSignatureInfo TLV element.
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
std::function< void(const Block ¬ification)> PostNotification
a function to post a notification
represents a dispatcher on server side of NFD Management protocol
base class of NFD ControlCommand
Represents an Interest packet.
virtual void validateRequest(const ControlParameters ¶meters) const
validate request parameters
std::function< void(const std::string &requester)> AcceptContinuation
a function to be called if authorization is successful
Authorization makeAcceptAllAuthorization()
return an Authorization that accepts all Interests, with empty string as requester ...
ManagerBase(const std::string &module, Dispatcher &dispatcher)
const Component & at(ssize_t i) const
Returns an immutable reference to the component at the specified index, with bounds checking...
static bool validateParameters(const ControlCommand &command, const ndn::mgmt::ControlParameters ¶meters)
Validates the parameters for a given command.
Copyright (c) 2011-2015 Regents of the University of California.
ndn::mgmt::Authorization makeAuthorization(const std::string &module, const std::string &verb)
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const ndn::mgmt::AcceptContinuation & accept
Represents an absolute name.
std::function< void(const ControlResponse &resp)> CommandContinuation
a function to be called after ControlCommandHandler completes
PartialName makeRelPrefix(const std::string &verb)
Generates the relative prefix for a handler by appending the verb name to the module name...
base class for a struct that contains ControlCommand parameters
Provides ControlCommand authorization according to NFD configuration file.
std::function< void(const Name &prefix, const Interest &interest, const ControlParameters ¶ms, const CommandContinuation &done)> ControlCommandHandler
a function to handle an authorized ControlCommand
Block blockFromValue() const
Return a new Block constructed from the TLV-VALUE of this Block.
const ssize_t POS_SIG_INFO
const Name & getName() const noexcept
NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED const Name const Interest const ControlParameters & parameters
void addStatusDataset(const PartialName &relPrefix, Authorization authorize, StatusDatasetHandler handle)
register a StatusDataset or a prefix under which StatusDatasets can be requested
ndn::mgmt::PostNotification registerNotificationStream(const std::string &verb)
represents an error in ControlParameters
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)
static void handleCommand(shared_ptr< ControlCommand > command, const ControlCommandHandler &handler, const Name &prefix, const Interest &interest, const ndn::mgmt::ControlParameters ¶ms, const ndn::mgmt::CommandContinuation &done)
Handles a control command.
represents an error in TLV encoding or decoding
PostNotification addNotificationStream(const PartialName &relPrefix)
register a NotificationStream
std::function< void(const Name &prefix, const Interest &interest, StatusDatasetContext &context)> StatusDatasetHandler
a function to handle a StatusDataset request