26 #ifndef NFD_RIB_RIB_HPP 27 #define NFD_RIB_RIB_HPP 32 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp> 56 class Rib : noncopyable
60 typedef std::map<Name, shared_ptr<RibEntry>>
RibTable;
63 typedef bool (*RouteComparePredicate)(
const Route&,
const Route&);
64 typedef std::set<Route, RouteComparePredicate>
RouteSet;
74 find(
const Name& prefix)
const;
77 find(
const Name& prefix,
const Route&
route)
const;
92 findParent(
const Name& prefix)
const;
97 std::list<shared_ptr<RibEntry>>
98 findDescendants(
const Name& prefix)
const;
108 std::list<shared_ptr<RibEntry>>
109 findDescendantsForNonInsertedName(
const Name& prefix)
const;
124 beginApplyUpdate(
const RibUpdate& update,
125 const UpdateSuccessCallback& onSuccess,
126 const UpdateFailureCallback& onFailure);
131 beginRemoveFace(uint64_t faceId);
140 uint32_t code,
const std::string& error);
143 onRouteExpiration(
const Name& prefix,
const Route&
route);
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);
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 #define PUBLIC_WITH_TESTS_ELSE_PRIVATE
const_iterator begin() const
const_iterator end() const
represents the Routing Information Base
std::map< uint64_t, std::list< shared_ptr< RibEntry > > > FaceLookupTable
Rib
Copyright (c) 2014-2016, Regents of the University of California, Arizona Board of Regents...
represents a collection of RibUpdates to be applied to a single FaceId
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
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
RibEntry::const_iterator route
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
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
Name abstraction to represent an absolute name.
RibTable::const_iterator const_iterator
ndn::util::signal::Signal< Rib, Name > afterInsertEntry
signals after a RIB entry is inserted
ndn::util::signal::Signal< Rib, Name > afterEraseEntry
signals after a RIB entry is erased
RouteList::const_iterator const_iterator
ndn::util::signal::Signal< Rib, RibRouteRef > beforeRemoveRoute
signals before a route is removed