26 #ifndef NFD_DAEMON_MGMT_MANAGER_BASE_HPP 27 #define NFD_DAEMON_MGMT_MANAGER_BASE_HPP 34 #include <ndn-cxx/management/nfd-control-command.hpp> 35 #include <ndn-cxx/management/nfd-control-response.hpp> 36 #include <ndn-cxx/management/nfd-control-parameters.hpp> 50 struct Error :
public std::runtime_error
52 Error(
const std::string& what) :
std::runtime_error(what) {}
56 const std::string& privilege,
57 ndn::KeyChain& keyChain);
64 const std::string& error);
75 const std::string& text);
79 const std::string& text,
89 const std::string& text);
94 const std::string& text,
127 const std::string& text)
129 response.setCode(code);
130 response.setText(text);
136 const std::string& text,
140 response.setBody(body);
147 m_face->getValidator().addInterestRule(regex, certificate);
155 m_face->getValidator().addInterestRule(regex, keyName, publicKey);
163 m_face->getValidator().validate(interest, onValidated, onValidationFailed);
169 #endif // NFD_DAEMON_MGMT_MANAGER_BASE_HPP shared_ptr< InternalFace > m_face
represents parameters in a ControlCommand request or response
ndn::KeyChain & m_keyChain
void sendResponse(const Name &name, const ControlResponse &response)
base class of NFD ControlCommand
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
static bool extractParameters(const Name::Component ¶meterComponent, ControlParameters &extractedParameters)
ndn::mgmt::ControlResponse ControlResponse
Copyright (c) 2011-2015 Regents of the University of California.
void onCommandValidationFailed(const shared_ptr< const Interest > &command, const std::string &error)
ManagerBase(shared_ptr< InternalFace > face, const std::string &privilege, ndn::KeyChain &keyChain)
Name abstraction to represent an absolute name.
#define PUBLIC_WITH_TESTS_ELSE_PROTECTED
void sendNack(const Name &name)
function< void(const shared_ptr< const Interest > &, const std::string &)> OnInterestValidationFailed
Callback to report a failed Interest validation.
Component holds a read-only name component value.
void addInterestRule(const std::string ®ex, const ndn::IdentityCertificate &certificate)
void setResponse(ControlResponse &response, uint32_t code, const std::string &text)
virtual bool validateParameters(const ControlCommand &command, ControlParameters ¶meters)
void validate(const Interest &interest, const ndn::OnInterestValidated &onValidated, const ndn::OnInterestValidationFailed &onValidationFailed)
function< void(const shared_ptr< const Interest > &)> OnInterestValidated
Callback to report a successful Interest validation.
Error(const std::string &what)