26 #ifndef NFD_DAEMON_RIB_FIB_UPDATER_HPP 27 #define NFD_DAEMON_RIB_FIB_UPDATER_HPP 34 #include <ndn-cxx/mgmt/nfd/controller.hpp> 44 class Error :
public std::runtime_error
47 using std::runtime_error::runtime_error;
66 const FibUpdateSuccessCallback& onSuccess,
67 const FibUpdateFailureCallback& onFailure);
85 sendUpdates(
const FibUpdateList& updates,
86 const FibUpdateSuccessCallback& onSuccess,
87 const FibUpdateFailureCallback& onFailure);
93 sendUpdatesForBatchFaceId(
const FibUpdateSuccessCallback& onSuccess,
94 const FibUpdateFailureCallback& onFailure);
100 sendUpdatesForNonBatchFaceId(
const FibUpdateSuccessCallback& onSuccess,
101 const FibUpdateFailureCallback& onFailure);
109 sendAddNextHopUpdate(
const FibUpdate& update,
110 const FibUpdateSuccessCallback& onSuccess,
111 const FibUpdateFailureCallback& onFailure,
112 uint32_t nTimeouts = 0);
120 sendRemoveNextHopUpdate(
const FibUpdate& update,
121 const FibUpdateSuccessCallback& onSuccess,
122 const FibUpdateFailureCallback& onFailure,
123 uint32_t nTimeouts = 0);
129 computeUpdatesForRegistration(
const RibUpdate& update);
134 computeUpdatesForUnregistration(
const RibUpdate& update);
150 const FibUpdateSuccessCallback& onSuccess,
151 const FibUpdateFailureCallback& onFailure);
170 const FibUpdateSuccessCallback& onSuccess,
171 const FibUpdateFailureCallback& onFailure,
172 const ndn::nfd::ControlResponse& response, uint32_t nTimeouts);
194 addInheritedRoutes(
const Name& name,
const Rib::RouteSet& routesToAdd,
const Route& ignore);
204 createFibUpdatesForNewRibEntry(
const Name& name,
const Route& route,
210 createFibUpdatesForNewRoute(
const RibEntry& entry,
const Route& route,
211 const bool captureWasTurnedOn);
216 createFibUpdatesForUpdatedRoute(
const RibEntry& entry,
const Route& route,
217 const Route& existingRoute);
222 createFibUpdatesForErasedRoute(
const RibEntry& entry,
const Route& route,
223 const bool captureWasTurnedOff);
228 createFibUpdatesForErasedRibEntry(
const RibEntry& entry);
246 addInheritedRoute(
const Name& name,
const Route& route);
251 removeInheritedRoute(
const Name& name,
const Route& route);
255 ndn::nfd::Controller& m_controller;
256 uint64_t m_batchFaceId;
259 FibUpdateList m_updatesForBatchFaceId;
260 FibUpdateList m_updatesForNonBatchFaceId;
268 static const unsigned int MAX_NUM_TIMEOUTS;
269 static const uint32_t ERROR_FACE_NOT_FOUND;
275 #endif // NFD_DAEMON_RIB_FIB_UPDATER_HPP std::list< FibUpdate > FibUpdateList
represents the Routing Information Base
std::set< Route, RouteComparePredicate > RouteSet
computes FibUpdates based on updates to the RIB and sends them to NFD
std::function< void(RibUpdateList inheritedRoutes)> FibUpdateSuccessCallback
Represents a collection of RibUpdates to be applied to a single FaceId.
void computeAndSendFibUpdates(const RibUpdateBatch &batch, const FibUpdateSuccessCallback &onSuccess, const FibUpdateFailureCallback &onFailure)
computes FibUpdates using the provided RibUpdateBatch and then sends the updates to NFD's FIB ...
std::list< RibUpdate > RibUpdateList
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
std::list< shared_ptr< RibEntry > > RibEntryList
represents a route for a name prefix
FibUpdater(Rib &rib, ndn::nfd::Controller &controller)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Represents a RIB entry, which contains one or more Routes with the same prefix.
std::function< void(uint32_t code, const std::string &error)> FibUpdateFailureCallback