26 #ifndef NFD_RIB_RIB_HPP 27 #define NFD_RIB_RIB_HPP 59 class Rib : noncopyable
63 typedef std::map<Name, shared_ptr<RibEntry>>
RibTable;
67 typedef std::set<Route, RouteComparePredicate>
RouteSet;
101 std::list<shared_ptr<RibEntry>>
112 std::list<shared_ptr<RibEntry>>
144 uint32_t code,
const std::string& error);
164 addUpdateToQueue(
const RibUpdate& update,
176 sendBatchFromQueue();
187 bool wantMockFibResponseOnce =
false;
191 erase(
const Name& prefix,
const Route& route);
205 getAncestorRoutes(
const RibEntry& entry)
const;
214 getAncestorRoutes(
const Name&
name)
const;
223 using NameAndRoute = std::pair<const Name&, const Route&>;
225 std::list<NameAndRoute>
226 findRoutesWithFaceId(uint64_t faceId);
262 struct UpdateQueueItem
270 typedef std::list<UpdateQueueItem> UpdateQueue;
271 UpdateQueue m_updateBatches;
274 bool m_isUpdateInProgress;
280 return m_rib.begin();
298 return m_rib.empty();
307 #endif // NFD_RIB_RIB_HPP #define PUBLIC_WITH_TESTS_ELSE_PRIVATE
const_iterator begin() const
std::list< shared_ptr< RibEntry > > findDescendants(const Name &prefix) const
finds namespaces under the passed prefix
const_iterator end() const
represents the Routing Information Base
std::map< uint64_t, std::list< shared_ptr< RibEntry > > > FaceLookupTable
bool(* RouteComparePredicate)(const Route &, const Route &)
void beginApplyUpdate(const RibUpdate &update, const UpdateSuccessCallback &onSuccess, const UpdateFailureCallback &onFailure)
passes the provided RibUpdateBatch to FibUpdater to calculate and send FibUpdates.
Represents a collection of RibUpdates to be applied to a single FaceId.
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
Route * findLongestPrefix(const Name &prefix, const Route &route) const
const_iterator find(const Name &prefix) const
ndn::util::signal::Signal< Rib, RibRouteRef > afterAddRoute
signals after a Route is added
computes FibUpdates based on updates to the RIB and sends them to NFD
void onFibUpdateSuccess(const RibUpdateBatch &batch, const RibUpdateList &inheritedRoutes, const Rib::UpdateSuccessCallback &onSuccess)
RibEntry::const_iterator route
provides a lightweight signal / event system
std::function< void(uint32_t code, const std::string &error)> UpdateFailureCallback
std::set< Route, RouteComparePredicate > RouteSet
Table::const_iterator iterator
std::list< shared_ptr< RibEntry > > RibEntryList
std::list< RibUpdate > RibUpdateList
void insert(const Name &prefix, const Route &route)
std::map< Name, shared_ptr< RibEntry > > RibTable
Copyright (c) 2011-2015 Regents of the University of California.
shared_ptr< RibEntry > entry
Represents a RIB entry, which contains one or more Routes with the same prefix.
represents a route for a name prefix
shared_ptr< RibEntry > findParent(const Name &prefix) const
Represents an absolute name.
RibTable::const_iterator const_iterator
void beginRemoveFace(uint64_t faceId)
starts the FIB update process when a face has been destroyed
ndn::util::signal::Signal< Rib, Name > afterInsertEntry
signals after a RIB entry is inserted
void onFibUpdateFailure(const Rib::UpdateFailureCallback &onFailure, uint32_t code, const std::string &error)
ndn::util::signal::Signal< Rib, Name > afterEraseEntry
signals after a RIB entry is erased
void onRouteExpiration(const Name &prefix, const Route &route)
RouteList::const_iterator const_iterator
std::list< shared_ptr< RibEntry > > findDescendantsForNonInsertedName(const Name &prefix) const
finds namespaces under the passed prefix
bool operator<(const ReadvertisedRoute &lhs, const ReadvertisedRoute &rhs)
std::function< void()> UpdateSuccessCallback
ndn::util::signal::Signal< Rib, RibRouteRef > beforeRemoveRoute
signals before a route is removed
void setFibUpdater(FibUpdater *updater)