26 #ifndef NFD_RIB_RIB_MANAGER_HPP
27 #define NFD_RIB_RIB_MANAGER_HPP
35 #include <ndn-cxx/encoding/buffer-stream.hpp>
36 #include <ndn-cxx/security/validator-config.hpp>
37 #include <ndn-cxx/mgmt/nfd/face-monitor.hpp>
38 #include <ndn-cxx/mgmt/nfd/controller.hpp>
39 #include <ndn-cxx/mgmt/nfd/control-command.hpp>
40 #include <ndn-cxx/mgmt/nfd/control-response.hpp>
41 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
46 using ndn::nfd::ControlCommand;
47 using ndn::nfd::ControlResponse;
48 using ndn::nfd::ControlParameters;
50 using ndn::nfd::FaceEventNotification;
55 class Error :
public std::runtime_error
60 :
std::runtime_error(what)
66 RibManager(Dispatcher& dispatcher, ndn::Face& face, ndn::KeyChain& keyChain);
87 onConfig(
const ConfigSection& configSection,
bool isDryRun,
const std::string& filename);
90 registerTopPrefix(
const Name& topPrefix);
94 registerEntry(
const Name& topPrefix,
const Interest& interest,
95 ControlParameters parameters,
96 const ndn::mgmt::CommandContinuation& done);
99 unregisterEntry(
const Name& topPrefix,
const Interest& interest,
100 ControlParameters parameters,
101 const ndn::mgmt::CommandContinuation& done);
104 listEntries(
const Name& topPrefix,
const Interest& interest,
105 ndn::mgmt::StatusDatasetContext& context);
108 setFaceForSelfRegistration(
const Interest& request, ControlParameters& parameters);
110 virtual ndn::mgmt::Authorization
111 makeAuthorization(
const std::string& verb)
override;
118 fetchSegments(
const Data& data, shared_ptr<ndn::OBufferStream> buffer);
121 onFetchFaceStatusTimeout();
124 onFaceDestroyedEvent(uint64_t faceId);
128 scheduleActiveFaceFetch(
const time::seconds& timeToWait);
136 removeInvalidFaces(shared_ptr<ndn::OBufferStream> buffer);
144 onNotification(
const FaceEventNotification& notification);
148 onCommandPrefixAddNextHopSuccess(
const Name& prefix,
149 const ndn::nfd::ControlParameters& result);
152 onCommandPrefixAddNextHopError(
const Name& name,
const ndn::nfd::ControlResponse& response);
155 onControlHeaderSuccess();
158 onControlHeaderError(
const ndn::nfd::ControlResponse& response);
162 ndn::KeyChain& m_keyChain;
163 ndn::nfd::Controller m_nfdController;
164 ndn::nfd::FaceMonitor m_faceMonitor;
165 ndn::ValidatorConfig m_localhostValidator;
166 ndn::ValidatorConfig m_localhopValidator;
167 bool m_isLocalhopEnabled;
175 static const Name LOCAL_HOST_TOP_PREFIX;
176 static const Name LOCAL_HOP_TOP_PREFIX;
177 static const std::string MGMT_MODULE_NAME;
178 static const Name FACES_LIST_DATASET_PREFIX;
179 static const time::seconds ACTIVE_FACE_FETCH_INTERVAL;
180 scheduler::EventId m_activeFaceFetchEvent;
182 typedef std::set<uint64_t> FaceIdSet;
185 FaceIdSet m_registeredFaces;
187 std::function<void(const Name& topPrefix)> m_addTopPrefix;
193 #endif // NFD_RIB_RIB_MANAGER_HPP
configuration file parsing utility
computes FibUpdates based on updates to the RIB and sends them to NFD
provides automatic prefix propagation feature
void enableLocalControlHeader()
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
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)