26 #ifndef NFD_DAEMON_MGMT_RIB_MANAGER_HPP
27 #define NFD_DAEMON_MGMT_RIB_MANAGER_HPP
32 #include <ndn-cxx/mgmt/nfd/controller.hpp>
33 #include <ndn-cxx/mgmt/nfd/face-event-notification.hpp>
34 #include <ndn-cxx/mgmt/nfd/face-monitor.hpp>
35 #include <ndn-cxx/mgmt/nfd/face-status.hpp>
36 #include <ndn-cxx/security/validator-config.hpp>
37 #include <ndn-cxx/util/scheduler.hpp>
54 ndn::nfd::Controller& nfdController, Dispatcher& dispatcher);
123 slAnnounce(
const ndn::PrefixAnnouncement& pa, uint64_t faceId, time::milliseconds maxLifetime,
145 slRenew(
const Name& name, uint64_t faceId, time::milliseconds maxLifetime,
163 enum class RibUpdateResult
171 getSlAnnounceResultFromRibUpdateResult(RibUpdateResult r);
180 beginAddRoute(
const Name& name,
rib::Route route, std::optional<time::nanoseconds> expires,
181 const std::function<
void(RibUpdateResult)>& done);
189 beginRemoveRoute(
const Name& name,
const rib::Route& route,
190 const std::function<
void(RibUpdateResult)>& done);
194 const std::function<
void(RibUpdateResult)>& done);
198 registerTopPrefix(
const Name& topPrefix);
203 registerEntry(
const Interest& interest, ControlParameters parameters,
204 const ndn::mgmt::CommandContinuation& done);
209 unregisterEntry(
const Interest& interest, ControlParameters parameters,
210 const ndn::mgmt::CommandContinuation& done);
215 listEntries(ndn::mgmt::StatusDatasetContext& context);
218 setFaceForSelfRegistration(
const Interest& request, ControlParameters& parameters);
220 ndn::mgmt::Authorization
221 makeAuthorization(
const std::string& verb)
final;
228 onFetchActiveFacesFailure(uint32_t code,
const std::string& reason);
232 scheduleActiveFaceFetch(
const time::seconds& timeToWait);
235 removeInvalidFaces(
const std::vector<ndn::nfd::FaceStatus>& activeFaces);
238 onNotification(
const ndn::nfd::FaceEventNotification& notification);
245 ndn::KeyChain& m_keyChain;
246 ndn::nfd::Controller& m_nfdController;
247 Dispatcher& m_dispatcher;
249 ndn::nfd::FaceMonitor m_faceMonitor;
250 ndn::ValidatorConfig m_localhostValidator;
251 ndn::ValidatorConfig m_localhopValidator;
252 ndn::ValidatorConfig m_paValidator;
253 bool m_isLocalhopEnabled;
255 ndn::scheduler::ScopedEventId m_activeFaceFetchEvent;
A collection of common functions shared by all NFD managers, such as communicating with the dispatche...
Implements the RIB Management of NFD Management Protocol.
void slRenew(const Name &name, uint64_t faceId, time::milliseconds maxLifetime, const SlAnnounceCallback &cb)
Renew a route created by prefix announcement from self-learning strategy.
std::function< void(SlAnnounceResult res)> SlAnnounceCallback
void registerWithNfd()
Start accepting commands and dataset requests.
void disableLocalhop()
Disallow accepting commands on /localhop/nfd/rib prefix.
RibManager(rib::Rib &rib, ndn::Face &face, ndn::KeyChain &keyChain, ndn::nfd::Controller &nfdController, Dispatcher &dispatcher)
static const Name LOCALHOP_TOP_PREFIX
void applyLocalhostConfig(const ConfigSection §ion, const std::string &filename)
Apply localhost_security configuration.
void enableLocalhop(const ConfigSection §ion, const std::string &filename)
Apply localhop_security configuration and allow accepting commands on /localhop/nfd/rib prefix.
void slAnnounce(const ndn::PrefixAnnouncement &pa, uint64_t faceId, time::milliseconds maxLifetime, const SlAnnounceCallback &cb)
Insert a route by prefix announcement from self-learning strategy.
std::function< void(std::optional< ndn::PrefixAnnouncement >)> SlFindAnnCallback
@ VALIDATION_FAILURE
the announcement cannot be verified against the trust schema
@ EXPIRED
the announcement has expired
@ NOT_FOUND
route does not exist (slRenew only)
@ OK
RIB and FIB have been updated.
void enableLocalFields()
Enable NDNLP IncomingFaceId field in order to support self-registration commands.
void slFindAnn(const Name &name, const SlFindAnnCallback &cb) const
Retrieve an outgoing prefix announcement for self-learning strategy.
void applyPaConfig(const ConfigSection §ion, const std::string &filename)
Apply prefix_announcement_validation configuration.
Represents the Routing Information Base.
Represents a route that will be added to or removed from a namespace.
Represents a route for a name prefix.
#define NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE
boost::property_tree::ptree ConfigSection
A configuration file section.
std::ostream & operator<<(std::ostream &os, const Network &network)