ndn::mgmt Namespace Reference

Classes

class  ControlParameters
 Base class for a struct that contains ControlCommand parameters. 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

typedef std::function< void(const std::string &requester)> AcceptContinuation
 A function to be called if authorization is successful. More...
 
typedef std::function< void(const Name &prefix, const Interest &interest, const ControlParameters *params, const AcceptContinuation &accept, const RejectContinuation &reject)> Authorization
 A function that performs authorization. More...
 
typedef std::function< void(const ControlResponse &resp)> CommandContinuation
 A function to be called after ControlCommandHandler completes. More...
 
typedef std::function< void(const Name &prefix, const Interest &interest, const ControlParameters &params, const CommandContinuation &done)> ControlCommandHandler
 A function to handle an authorized ControlCommand. More...
 
typedef std::function< void(const Block &notification)> PostNotification
 A function to post a notification. More...
 
typedef std::function< void(RejectReply reply)> RejectContinuation
 A function to be called if authorization is rejected. More...
 
typedef std::function< void(const Name &prefix, const Interest &interest, StatusDatasetContext &context)> StatusDatasetHandler
 A function to handle a StatusDataset request. More...
 
typedef std::function< bool(const ControlParameters &params)> ValidateParameters
 A function to validate input ControlParameters. More...
 

Enumerations

enum class  RejectReply {
  SILENT ,
  STATUS403
}
 Indicate how to reply in case authorization is rejected. More...
 

Functions

Authorization makeAcceptAllAuthorization ()
 Return an Authorization that accepts all Interests, with empty string as requester. More...
 
std::ostream & operator<< (std::ostream &os, const ControlResponse &response)
 

Variables

const size_t MAX_PAYLOAD_LENGTH = MAX_NDN_PACKET_SIZE - 800
 

Typedef Documentation

◆ AcceptContinuation

typedef std::function<void(const std::string& requester)> ndn::mgmt::AcceptContinuation

A function to be called if authorization is successful.

Parameters
requestera 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 45 of file dispatcher.hpp.

◆ Authorization

typedef std::function<void(const Name& prefix, const Interest& interest, const ControlParameters* params, const AcceptContinuation& accept, const RejectContinuation& reject)> ndn::mgmt::Authorization

A function that performs authorization.

Parameters
prefixtop-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.
interestincoming Interest
paramsparsed ControlParameters for ControlCommand, otherwise nullptr; This is guaranteed to be not-null and have correct type for the command, but may not be valid (e.g., can have missing fields).

Either accept or reject must be called after authorization completes.

Definition at line 77 of file dispatcher.hpp.

◆ CommandContinuation

typedef std::function<void(const ControlResponse& resp)> ndn::mgmt::CommandContinuation

A function to be called after ControlCommandHandler completes.

Parameters
respthe response to be sent to requester

Definition at line 95 of file dispatcher.hpp.

◆ ControlCommandHandler

typedef std::function<void(const Name& prefix, const Interest& interest, const ControlParameters& params, const CommandContinuation& done)> ndn::mgmt::ControlCommandHandler

A function to handle an authorized ControlCommand.

Parameters
prefixtop-level prefix, e.g., "/localhost/nfd";
interestincoming Interest
paramsparsed ControlParameters; This is guaranteed to have correct type for the command, and is valid (e.g., has all required fields).

Definition at line 106 of file dispatcher.hpp.

◆ PostNotification

typedef std::function<void(const Block& notification)> ndn::mgmt::PostNotification

A function to post a notification.

Definition at line 124 of file dispatcher.hpp.

◆ RejectContinuation

typedef std::function<void(RejectReply reply)> ndn::mgmt::RejectContinuation

A function to be called if authorization is rejected.

Definition at line 60 of file dispatcher.hpp.

◆ StatusDatasetHandler

typedef std::function<void(const Name& prefix, const Interest& interest, StatusDatasetContext& context)> ndn::mgmt::StatusDatasetHandler

A function to handle a StatusDataset request.

Parameters
prefixtop-level prefix, e.g., "/localhost/nfd";
interestincoming Interest; its Name doesn't contain version and segment components

This function can generate zero or more blocks and pass them to append, and must call end upon completion.

Definition at line 118 of file dispatcher.hpp.

◆ ValidateParameters

typedef std::function<bool(const ControlParameters& params)> ndn::mgmt::ValidateParameters

A function to validate input ControlParameters.

Parameters
paramsparsed ControlParameters; This is guaranteed to have correct type for the command.

Definition at line 90 of file dispatcher.hpp.

Enumeration Type Documentation

◆ RejectReply

Indicate 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.

Function Documentation

◆ makeAcceptAllAuthorization()

Authorization ndn::mgmt::makeAcceptAllAuthorization ( )

Return an Authorization that accepts all Interests, with empty string as requester.

Definition at line 32 of file dispatcher.cpp.

◆ operator<<()

std::ostream & ndn::mgmt::operator<< ( std::ostream &  os,
const ControlResponse response 
)

Definition at line 97 of file control-response.cpp.

Variable Documentation

◆ MAX_PAYLOAD_LENGTH

const size_t ndn::mgmt::MAX_PAYLOAD_LENGTH = MAX_NDN_PACKET_SIZE - 800

Definition at line 27 of file status-dataset-context.cpp.