26 #ifndef NFD_RIB_RIB_MANAGER_HPP 27 #define NFD_RIB_RIB_MANAGER_HPP 35 #include <ndn-cxx/security/validator-config.hpp> 36 #include <ndn-cxx/management/nfd-face-monitor.hpp> 37 #include <ndn-cxx/management/nfd-controller.hpp> 38 #include <ndn-cxx/management/nfd-control-command.hpp> 39 #include <ndn-cxx/management/nfd-control-response.hpp> 40 #include <ndn-cxx/management/nfd-control-parameters.hpp> 54 class Error :
public std::runtime_error
59 :
std::runtime_error(what)
87 const std::string& filename);
93 onLocalhopRequest(
const Interest& request);
96 onLocalhostRequest(
const Interest& request);
103 sendResponse(
const Name& name,
105 const std::string& text);
108 sendSuccessResponse(
const shared_ptr<const Interest>& request,
112 sendErrorResponse(uint32_t code,
const std::string& error,
113 const shared_ptr<const Interest>& request);
116 registerEntry(
const shared_ptr<const Interest>& request,
120 unregisterEntry(
const shared_ptr<const Interest>& request,
125 onCommandValidated(
const shared_ptr<const Interest>& request);
128 onCommandValidationFailed(
const shared_ptr<const Interest>& request,
129 const std::string& failureInfo);
133 onCommandError(uint32_t code,
const std::string& error,
134 const shared_ptr<const Interest>& request,
138 onRegSuccess(
const shared_ptr<const Interest>& request,
143 onUnRegSuccess(
const shared_ptr<const Interest>& request,
149 onNrdCommandPrefixAddNextHopSuccess(
const Name& prefix,
154 onNrdCommandPrefixAddNextHopError(
const Name& name,
const std::string& msg);
157 onControlHeaderSuccess();
160 onControlHeaderError(uint32_t code,
const std::string& reason);
175 onFaceDestroyedEvent(uint64_t faceId);
179 listEntries(
const Interest& request);
182 scheduleActiveFaceFetch(
const time::seconds& timeToWait);
188 fetchSegments(
const Data& data, shared_ptr<ndn::OBufferStream> buffer);
191 onFetchFaceStatusTimeout();
197 removeInvalidFaces(shared_ptr<ndn::OBufferStream> buffer);
204 ndn::KeyChain& m_keyChain;
209 bool m_isLocalhopEnabled;
219 const shared_ptr<const Interest>& request,
222 typedef std::map<name::Component, SignedVerbProcessor> SignedVerbDispatchTable;
224 typedef std::pair<name::Component, SignedVerbProcessor> SignedVerbAndProcessor;
227 const SignedVerbDispatchTable m_signedVerbDispatch;
229 static const Name COMMAND_PREFIX;
232 static const Name REMOTE_COMMAND_PREFIX;
237 static const size_t COMMAND_UNSIGNED_NCOMPS;
241 static const size_t COMMAND_SIGNED_NCOMPS;
243 static const SignedVerbAndProcessor SIGNED_COMMAND_VERBS[];
245 typedef function<void(RibManager*, const Interest&)> UnsignedVerbProcessor;
246 typedef std::map<Name::Component, UnsignedVerbProcessor> UnsignedVerbDispatchTable;
247 typedef std::pair<Name::Component, UnsignedVerbProcessor> UnsignedVerbAndProcessor;
249 const UnsignedVerbDispatchTable m_unsignedVerbDispatch;
250 static const UnsignedVerbAndProcessor UNSIGNED_COMMAND_VERBS[];
252 static const Name LIST_COMMAND_PREFIX;
253 static const size_t LIST_COMMAND_NCOMPS;
255 static const Name FACES_LIST_DATASET_PREFIX;
257 static const time::seconds ACTIVE_FACE_FETCH_INTERVAL;
260 typedef std::set<uint64_t> FaceIdSet;
263 FaceIdSet m_registeredFaces;
269 #endif // NFD_RIB_RIB_MANAGER_HPP Error(const std::string &what)
RibManager(ndn::Face &face, ndn::KeyChain &keyChain)
represents parameters in a ControlCommand request or response
base class of NFD ControlCommand
computes FibUpdates based on updates to the RIB and sends them to NFD
represents a Face status change notification
represents an Interest packet
A subscriber for Face status change notification stream.
function< void(const InterestFilter &, const Interest &)> OnInterest
Callback called when incoming Interest matches the specified InterestFilter.
std::shared_ptr< ns3::EventId > EventId
void onRibUpdateSuccess(const RibUpdate &update)
ndn::mgmt::ControlResponse ControlResponse
void enableLocalControlHeader()
Copyright (c) 2011-2015 Regents of the University of California.
represents a route for a name prefix
Abstraction to communicate with local or remote NDN forwarder.
NFD Management protocol - ControlCommand client.
boost::property_tree::ptree ConfigSection
Name abstraction to represent an absolute name.
define the RemoteRegistrator class, which handles the registration/unregistration to remote hub(s)...
Component holds a read-only name component value.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
void onRibUpdateFailure(const RibUpdate &update, uint32_t code, const std::string &error)
void setConfigFile(ConfigFile &configFile)