26 #ifndef NFD_RIB_RIB_HPP
27 #define NFD_RIB_RIB_HPP
32 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
37 using ndn::nfd::ControlParameters;
56 class Rib : noncopyable
60 typedef std::map<Name, shared_ptr<RibEntry>>
RibTable;
64 typedef std::set<Route, RouteComparePredicate>
RouteSet;
74 find(
const Name& prefix)
const;
77 find(
const Name& prefix,
const Route& route)
const;
97 std::list<shared_ptr<RibEntry>>
108 std::list<shared_ptr<RibEntry>>
125 const UpdateSuccessCallback& onSuccess,
126 const UpdateFailureCallback& onFailure);
140 uint32_t code,
const std::string& error);
146 insert(
const Name& prefix,
const Route& route);
160 addUpdateToQueue(
const RibUpdate& update,
172 sendBatchFromQueue();
176 function<void(RibUpdateBatch)> m_onSendBatchFromQueue;
179 erase(
const Name& prefix,
const Route& route);
193 getAncestorRoutes(
const RibEntry& entry)
const;
202 getAncestorRoutes(
const Name& name)
const;
211 typedef std::pair<const Name&,const Route&> NameAndRoute;
213 std::list<NameAndRoute>
214 findRoutesWithFaceId(uint64_t faceId);
242 FaceLookupTable m_faceMap;
250 struct UpdateQueueItem
258 typedef std::list<UpdateQueueItem> UpdateQueue;
259 UpdateQueue m_updateBatches;
262 bool m_isUpdateInProgress;
268 return m_rib.begin();
286 return m_rib.empty();
295 #endif // NFD_RIB_RIB_HPP
bool(* RouteComparePredicate)(const Route &, const Route &)
represents the Routing Information Base
std::set< Route, RouteComparePredicate > RouteSet
void onFibUpdateFailure(const Rib::UpdateFailureCallback &onFailure, uint32_t code, const std::string &error)
computes FibUpdates based on updates to the RIB and sends them to NFD
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
const_iterator find(const Name &prefix) const
std::list< shared_ptr< RibEntry > > findDescendantsForNonInsertedName(const Name &prefix) const
finds namespaces under the passed prefix
represents a collection of RibUpdates to be applied to a single FaceId
void setFibUpdater(FibUpdater *updater)
ndn::util::signal::Signal< Rib, Name > afterEraseEntry
signals after a RIB entry is erased
const_iterator end() const
ndn::util::signal::Signal< Rib, RibRouteRef > afterAddRoute
signals after a Route is added
Table::const_iterator iterator
std::list< RibUpdate > RibUpdateList
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
std::list< shared_ptr< RibEntry > > RibEntryList
function< void(uint32_t code, const std::string &error)> UpdateFailureCallback
void insert(const Name &prefix, const Route &route)
std::list< shared_ptr< RibEntry > > findDescendants(const Name &prefix) const
finds namespaces under the passed prefix
represents a route for a name prefix
RouteList::const_iterator const_iterator
RibEntry::const_iterator route
std::map< Name, shared_ptr< RibEntry > > RibTable
shared_ptr< RibEntry > entry
ndn::util::signal::Signal< Rib, RibRouteRef > beforeRemoveRoute
signals before a route is removed
const_iterator begin() const
function< void()> UpdateSuccessCallback
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
void onFibUpdateSuccess(const RibUpdateBatch &batch, const RibUpdateList &inheritedRoutes, const Rib::UpdateSuccessCallback &onSuccess)
RibTable::const_iterator const_iterator
represents a RIB entry, which contains one or more Routes with the same prefix
void beginRemoveFace(uint64_t faceId)
starts the FIB update process when a face has been destroyed
std::map< uint64_t, std::list< shared_ptr< RibEntry > > > FaceLookupTable
void onRouteExpiration(const Name &prefix, const Route &route)
void beginApplyUpdate(const RibUpdate &update, const UpdateSuccessCallback &onSuccess, const UpdateFailureCallback &onFailure)
passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates.
ndn::util::signal::Signal< Rib, Name > afterInsertEntry
signals after a RIB entry is inserted
shared_ptr< RibEntry > findParent(const Name &prefix) const