26 #ifndef NFD_RIB_RIB_MANAGER_HPP 27 #define NFD_RIB_RIB_MANAGER_HPP 36 #include <ndn-cxx/security/validator-config.hpp> 37 #include <ndn-cxx/mgmt/nfd/controller.hpp> 38 #include <ndn-cxx/mgmt/nfd/face-event-notification.hpp> 39 #include <ndn-cxx/mgmt/nfd/face-monitor.hpp> 40 #include <ndn-cxx/util/scheduler-scoped-event-id.hpp> 51 class Error :
public std::runtime_error
54 using std::runtime_error::runtime_error;
57 RibManager(
Rib& rib, ndn::Face& face, ndn::nfd::Controller& nfdController, Dispatcher& dispatcher);
91 enum class RibUpdateResult
105 beginAddRoute(
const Name& name,
Route route, optional<time::nanoseconds> expires,
106 const std::function<
void(RibUpdateResult)>& done);
114 beginRemoveRoute(
const Name& name,
const Route& route,
115 const std::function<
void(RibUpdateResult)>& done);
118 beginRibUpdate(
const RibUpdate& update,
const std::function<
void(RibUpdateResult)>& done);
122 registerTopPrefix(
const Name& topPrefix);
127 registerEntry(
const Name& topPrefix,
const Interest& interest,
128 ControlParameters parameters,
129 const ndn::mgmt::CommandContinuation& done);
134 unregisterEntry(
const Name& topPrefix,
const Interest& interest,
135 ControlParameters parameters,
136 const ndn::mgmt::CommandContinuation& done);
141 listEntries(
const Name& topPrefix,
const Interest& interest,
142 ndn::mgmt::StatusDatasetContext& context);
145 setFaceForSelfRegistration(
const Interest& request, ControlParameters& parameters);
147 ndn::mgmt::Authorization
148 makeAuthorization(
const std::string& verb)
override;
155 onFetchActiveFacesFailure(uint32_t code,
const std::string& reason);
158 onFaceDestroyedEvent(uint64_t faceId);
162 scheduleActiveFaceFetch(
const time::seconds& timeToWait);
170 removeInvalidFaces(
const std::vector<ndn::nfd::FaceStatus>& activeFaces);
178 onNotification(
const ndn::nfd::FaceEventNotification& notification);
182 ndn::nfd::Controller& m_nfdController;
183 Dispatcher& m_dispatcher;
185 ndn::nfd::FaceMonitor m_faceMonitor;
186 ndn::ValidatorConfig m_localhostValidator;
187 ndn::ValidatorConfig m_localhopValidator;
188 bool m_isLocalhopEnabled;
193 typedef std::set<uint64_t> FaceIdSet;
196 FaceIdSet m_registeredFaces;
202 #endif // NFD_RIB_RIB_MANAGER_HPP
Serve commands and datasets in NFD RIB management protocol.
represents the Routing Information Base
RibManager(Rib &rib, ndn::Face &face, ndn::nfd::Controller &nfdController, Dispatcher &dispatcher)
void enableLocalhop(const ConfigSection §ion, const std::string &filename)
Apply localhop_security configuration and allow accepting commands on /localhop/nfd/rib prefix...
void registerWithNfd()
Start accepting commands and dataset requests.
Cancels an event automatically upon destruction.
void applyLocalhostConfig(const ConfigSection §ion, const std::string &filename)
Apply localhost_security configuration.
void enableLocalFields()
Enable NDNLP IncomingFaceId field in order to support self-registration commands. ...
a collection of common functions shared by all NFD managers and RIB manager, such as communicating wi...
boost::property_tree::ptree ConfigSection
a config file section
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
represents a route for a name prefix
void disableLocalhop()
Disallow accepting commands on /localhop/nfd/rib prefix.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE