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;
59 class Rib : noncopyable
63 typedef std::map<Name, shared_ptr<RibEntry>>
RibTable;
66 typedef bool (*RouteComparePredicate)(
const Route&,
const Route&);
67 typedef std::set<Route, RouteComparePredicate>
RouteSet;
75 find(
const Name& prefix)
const;
78 find(
const Name& prefix,
const Route&
route)
const;
81 findLongestPrefix(
const Name& prefix,
const Route&
route)
const;
96 findParent(
const Name& prefix)
const;
101 std::list<shared_ptr<RibEntry>>
102 findDescendants(
const Name& prefix)
const;
112 std::list<shared_ptr<RibEntry>>
113 findDescendantsForNonInsertedName(
const Name& prefix)
const;
128 beginApplyUpdate(
const RibUpdate& update,
135 beginRemoveFace(uint64_t faceId);
144 uint32_t code,
const std::string& error);
147 onRouteExpiration(
const Name& prefix,
const Route&
route);
150 insert(
const Name& prefix,
const Route&
route);
164 addUpdateToQueue(
const RibUpdate& update,
176 sendBatchFromQueue();
185 std::function<bool(const RibUpdateBatch&)> mockFibResponse;
187 bool wantMockFibResponseOnce =
false;
191 erase(
const Name& prefix,
const Route&
route);
214 getAncestorRoutes(
const Name& name)
const;
223 using NameAndRoute = std::pair<const Name&, const Route&>;
225 std::list<NameAndRoute>
226 findRoutesWithFaceId(uint64_t faceId);
254 FaceLookupTable m_faceMap;
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
represents the Routing Information Base
std::set< Route, RouteComparePredicate > RouteSet
computes FibUpdates based on updates to the RIB and sends them to NFD
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
std::function< void(uint32_t code, const std::string &error)> UpdateFailureCallback
Represents a collection of RibUpdates to be applied to a single FaceId.
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
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
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
RibTable::const_iterator const_iterator
Represents a RIB entry, which contains one or more Routes with the same prefix.
std::map< uint64_t, std::list< shared_ptr< RibEntry > > > FaceLookupTable
bool operator<(const ReadvertisedRoute &lhs, const ReadvertisedRoute &rhs)
std::function< void()> UpdateSuccessCallback
ndn::util::signal::Signal< Rib, Name > afterInsertEntry
signals after a RIB entry is inserted