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;
117 sendAddNextHopUpdate(
const FibUpdate& update,
120 uint32_t nTimeouts = 0);
128 sendRemoveNextHopUpdate(
const FibUpdate& update,
131 uint32_t nTimeouts = 0);
138 computeUpdatesForRegistration(
const RibUpdate& update);
144 computeUpdatesForUnregistration(
const RibUpdate& update);
184 const ndn::nfd::ControlResponse& response, uint32_t nTimeouts);
202 addInheritedRoutes(
const RibEntry& entry,
const Rib::RouteSet& routesToAdd);
209 addInheritedRoutes(
const Name& name,
const Rib::RouteSet& routesToAdd,
const Route& ignore);
215 removeInheritedRoutes(
const RibEntry& entry,
const Rib::RouteSet& routesToRemove);
221 createFibUpdatesForNewRibEntry(
const Name& name,
const Route& route,
228 createFibUpdatesForNewRoute(
const RibEntry& entry,
const Route& route,
229 bool captureWasTurnedOn);
235 createFibUpdatesForUpdatedRoute(
const RibEntry& entry,
const Route& route,
236 const Route& existingRoute);
242 createFibUpdatesForErasedRoute(
const RibEntry& entry,
const Route& route,
243 bool captureWasTurnedOff);
249 createFibUpdatesForErasedRibEntry(
const RibEntry& entry);
256 const Rib::RouteSet& routesToAdd,
257 const Rib::RouteSet& routesToRemove);
263 traverseSubTree(
const RibEntry& entry, Rib::RouteSet routesToAdd, Rib::RouteSet routesToRemove);
269 addInheritedRoute(
const Name& name,
const Route& route);
275 removeInheritedRoute(
const Name& name,
const Route& route);
279 ndn::nfd::Controller& m_controller;
280 uint64_t m_batchFaceId;
Computes FibUpdates based on updates to the RIB and sends them to NFD.
std::function< void(RibUpdateList inheritedRoutes)> FibUpdateSuccessCallback
std::list< FibUpdate > FibUpdateList
FibUpdater(Rib &rib, ndn::nfd::Controller &controller)
std::function< void(uint32_t code, const std::string &error)> FibUpdateFailureCallback
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.
Represents a RIB entry, which contains one or more Routes with the same prefix.
Represents the Routing Information Base.
std::list< shared_ptr< RibEntry > > RibEntryList
Represents a collection of RibUpdates to be applied to a single FaceId.
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
#define NFD_VIRTUAL_WITH_TESTS
#define NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE
std::list< RibUpdate > RibUpdateList