|
ndn-cxx: NDN C++ Library 0.9.0-33-g832ea91d
|
Classes | |
| class | ControlParametersBase |
| Base class for a struct that contains the parameters for a ControlCommand. More... | |
| class | ControlResponse |
| ControlCommand response. More... | |
| class | Dispatcher |
| Implements a request dispatcher on server side of NFD Management protocol. More... | |
| class | StatusDatasetContext |
| Provides a context for generating the response to a StatusDataset request. More... | |
Typedefs | |
| using | AcceptContinuation = std::function< void(const std::string &requester)> |
| A function to be called if authorization is successful. | |
| using | Authorization = std::function< void(const Name &prefix, const Interest &interest, const ControlParametersBase *params, const AcceptContinuation &accept, const RejectContinuation &reject)> |
| A function that performs authorization. | |
| using | CommandContinuation = std::function< void(const ControlResponse &resp)> |
| A function to be called after a ControlCommandHandler completes. | |
| using | ControlCommandHandler = std::function< void(const Name &prefix, const Interest &interest, const ControlParametersBase ¶ms, const CommandContinuation &done)> |
| A function to handle an authorized ControlCommand. | |
| using | PostNotification = std::function< void(const Block ¬ification)> |
| A function to post a notification. | |
| using | RejectContinuation = std::function< void(RejectReply)> |
| A function to be called if authorization is rejected. | |
| using | StatusDatasetHandler = std::function< void(const Name &prefix, const Interest &interest, StatusDatasetContext &context)> |
| A function to handle a StatusDataset request. | |
| using | ValidateParameters = std::function< bool(ControlParametersBase ¶ms)> |
| A function to validate and normalize the incoming request parameters. | |
Enumerations | |
| enum class | RejectReply { SILENT , STATUS403 } |
| Indicates how to reply in case authorization is rejected. More... | |
Functions | |
| Authorization | makeAcceptAllAuthorization () |
| Return an Authorization that accepts all Interests, with empty string as requester. | |
Variables | |
| constexpr size_t | MAX_PAYLOAD_LENGTH = MAX_NDN_PACKET_SIZE - 800 |
| using ndn::mgmt::AcceptContinuation = typedef std::function<void(const std::string& requester)> |
A function to be called if authorization is successful.
| requester | A string that indicates the requester, whose semantics is determined by the Authorization function; this value is intended for logging only, and should not affect how the request is processed. |
Definition at line 44 of file dispatcher.hpp.
| using ndn::mgmt::Authorization = typedef std::function<void(const Name& prefix, const Interest& interest, const ControlParametersBase* params, const AcceptContinuation& accept, const RejectContinuation& reject)> |
A function that performs authorization.
| prefix | Top-level prefix, e.g., /localhost/nfd. This argument can be inspected to allow Interests only under a subset of top-level prefixes (e.g., allow "/localhost/nfd" only), or to use different trust model regarding to the prefix. |
| interest | Incoming Interest. |
| params | The parsed ControlParameters for ControlCommand, otherwise nullptr. The object is guaranteed to have the correct type for the command, but may not be valid (e.g., can have missing fields). |
accept or reject must be called after authorization completes. Definition at line 77 of file dispatcher.hpp.
| using ndn::mgmt::CommandContinuation = typedef std::function<void(const ControlResponse& resp)> |
A function to be called after a ControlCommandHandler completes.
| resp | The response that should be sent back to the requester. |
Definition at line 101 of file dispatcher.hpp.
| using ndn::mgmt::ControlCommandHandler = typedef std::function<void(const Name& prefix, const Interest& interest, const ControlParametersBase& params, const CommandContinuation& done)> |
A function to handle an authorized ControlCommand.
| prefix | Top-level prefix, e.g., /localhost/nfd. |
| interest | Incoming Interest carrying the request. |
| params | The parsed ControlParameters; guaranteed to be of the correct (sub-)type and to be valid for the command (e.g., has all the required fields). |
| done | Function that must be called after command processing is complete. |
Definition at line 111 of file dispatcher.hpp.
| using ndn::mgmt::PostNotification = typedef std::function<void(const Block& notification)> |
A function to post a notification.
Definition at line 133 of file dispatcher.hpp.
| using ndn::mgmt::RejectContinuation = typedef std::function<void(RejectReply)> |
A function to be called if authorization is rejected.
Definition at line 63 of file dispatcher.hpp.
| using ndn::mgmt::StatusDatasetHandler = typedef std::function<void(const Name& prefix, const Interest& interest, StatusDatasetContext& context)> |
A function to handle a StatusDataset request.
| prefix | Top-level prefix, e.g., /localhost/nfd. |
| interest | Incoming Interest; its Name will not contain version and segment components. |
This function can generate zero or more blocks and pass them to StatusDatasetContext::append, and must call StatusDatasetContext::end upon completion.
Definition at line 125 of file dispatcher.hpp.
| using ndn::mgmt::ValidateParameters = typedef std::function<bool(ControlParametersBase& params)> |
A function to validate and normalize the incoming request parameters.
| params | The parsed ControlParameters; guaranteed to be of the correct (sub-)type for the command. |
Definition at line 95 of file dispatcher.hpp.
|
strong |
Indicates how to reply in case authorization is rejected.
| Enumerator | |
|---|---|
| SILENT | Do not reply. |
| STATUS403 | Reply with a ControlResponse where StatusCode is 403. |
Definition at line 49 of file dispatcher.hpp.
| Authorization ndn::mgmt::makeAcceptAllAuthorization | ( | ) |
Return an Authorization that accepts all Interests, with empty string as requester.
Definition at line 33 of file dispatcher.cpp.
|
constexpr |
Definition at line 26 of file status-dataset-context.cpp.