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> 45 class AutoPrefixPropagator;
51 class Error :
public std::runtime_error
56 :
std::runtime_error(what)
62 RibManager(Dispatcher& dispatcher, ndn::Face& face, ndn::KeyChain& keyChain);
83 onConfig(
const ConfigSection& configSection,
bool isDryRun,
const std::string& filename);
86 registerTopPrefix(
const Name& topPrefix);
90 registerEntry(
const Name& topPrefix,
const Interest& interest,
91 ControlParameters parameters,
92 const ndn::mgmt::CommandContinuation& done);
95 unregisterEntry(
const Name& topPrefix,
const Interest& interest,
96 ControlParameters parameters,
97 const ndn::mgmt::CommandContinuation& done);
100 listEntries(
const Name& topPrefix,
const Interest& interest,
101 ndn::mgmt::StatusDatasetContext& context);
104 setFaceForSelfRegistration(
const Interest& request, ControlParameters& parameters);
106 ndn::mgmt::Authorization
107 makeAuthorization(
const std::string& verb)
override;
114 onFetchActiveFacesFailure(uint32_t code,
const std::string& reason);
117 onFaceDestroyedEvent(uint64_t faceId);
121 scheduleActiveFaceFetch(
const time::seconds& timeToWait);
129 removeInvalidFaces(
const std::vector<ndn::nfd::FaceStatus>& activeFaces);
137 onNotification(
const ndn::nfd::FaceEventNotification& notification);
141 onCommandPrefixAddNextHopSuccess(
const Name& prefix,
const ControlParameters& result);
144 onCommandPrefixAddNextHopError(
const Name& name,
const ControlResponse& response);
147 onEnableLocalFieldsSuccess();
150 onEnableLocalFieldsError(
const ControlResponse& response);
154 ndn::KeyChain& m_keyChain;
155 ndn::nfd::Controller m_nfdController;
156 ndn::nfd::FaceMonitor m_faceMonitor;
157 ndn::ValidatorConfig m_localhostValidator;
158 ndn::ValidatorConfig m_localhopValidator;
159 bool m_isLocalhopEnabled;
161 unique_ptr<Readvertise> m_readvertiseNlsr;
168 static const Name LOCAL_HOST_TOP_PREFIX;
169 static const Name LOCAL_HOP_TOP_PREFIX;
170 static const std::string MGMT_MODULE_NAME;
171 static const Name FACES_LIST_DATASET_PREFIX;
172 static const time::seconds ACTIVE_FACE_FETCH_INTERVAL;
174 static const Name READVERTISE_NLSR_PREFIX;
176 typedef std::set<uint64_t> FaceIdSet;
179 FaceIdSet m_registeredFaces;
181 std::function<void(const Name& topPrefix)> m_addTopPrefix;
187 #endif // NFD_RIB_RIB_MANAGER_HPP
represents the Routing Information Base
configuration file parsing utility
computes FibUpdates based on updates to the RIB and sends them to NFD
provides automatic prefix propagation feature
cancels an event automatically upon destruction
a collection of common functions shared by all NFD managers and RIB manager, such as communicating wi...
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void onRibUpdateFailure(const RibUpdate &update, uint32_t code, const std::string &error)
boost::property_tree::ptree ConfigSection
a config file section
void setConfigFile(ConfigFile &configFile)
Error(const std::string &what)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
void onRibUpdateSuccess(const RibUpdate &update)
RibManager(Dispatcher &dispatcher, ndn::Face &face, ndn::KeyChain &keyChain)