26 #ifndef NFD_RIB_RIB_HPP 27 #define NFD_RIB_RIB_HPP 34 #include <ndn-cxx/management/nfd-control-parameters.hpp> 45 class Rib : noncopyable
49 typedef std::map<Name, shared_ptr<RibEntry>>
RibTable;
53 typedef std::set<Route, RouteComparePredicate>
RouteSet;
66 find(
const Name& prefix,
const Route& route)
const;
86 std::list<shared_ptr<RibEntry>>
97 std::list<shared_ptr<RibEntry>>
114 const UpdateSuccessCallback& onSuccess,
115 const UpdateFailureCallback& onFailure);
129 uint32_t code,
const std::string& error);
146 addUpdateToQueue(
const RibUpdate& update,
158 sendBatchFromQueue();
162 function<void(RibUpdateBatch)> m_onSendBatchFromQueue;
166 insert(
const Name& prefix,
const Route& route);
170 erase(
const Name& prefix,
const Route& route);
184 getAncestorRoutes(
const RibEntry& entry)
const;
193 getAncestorRoutes(
const Name&
name)
const;
202 typedef std::pair<const Name&,const Route&> NameAndRoute;
204 std::list<NameAndRoute>
205 findRoutesWithFaceId(uint64_t faceId);
213 FaceLookupTable m_faceMap;
221 struct UpdateQueueItem
229 typedef std::list<UpdateQueueItem> UpdateQueue;
230 UpdateQueue m_updateBatches;
233 bool m_isUpdateInProgress;
239 return m_rib.begin();
257 return m_rib.empty();
266 #endif // NFD_RIB_RIB_HPP const_iterator begin() const
std::list< shared_ptr< RibEntry > > findDescendants(const Name &prefix) const
finds namespaces under the passed prefix
const_iterator end() const
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)
const_iterator find(const Name &prefix) const
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)
provides a lightweight signal / event system
function< void(uint32_t code, const std::string &error)> UpdateFailureCallback
std::set< Route, RouteComparePredicate > RouteSet
Table::const_iterator iterator
function< void()> UpdateSuccessCallback
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.
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
Name abstraction to represent 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
void onFibUpdateFailure(const Rib::UpdateFailureCallback &onFailure, uint32_t code, const std::string &error)
ndn::util::signal::Signal< Rib, Name > afterEraseEntry
void onRouteExpiration(const Name &prefix, const Route &route)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
std::list< shared_ptr< RibEntry > > findDescendantsForNonInsertedName(const Name &prefix) const
finds namespaces under the passed prefix
void setFibUpdater(FibUpdater *updater)