22 #ifndef NLSR_ROUTE_FIB_HPP 23 #define NLSR_ROUTE_FIB_HPP 29 #include <ndn-cxx/mgmt/nfd/controller.hpp> 30 #include <ndn-cxx/util/time.hpp> 56 Fib(ndn::Face& face, ndn::Scheduler& scheduler,
AdjacencyList& adjacencyList,
68 remove(
const ndn::Name& name);
101 m_refreshTime = fert;
126 const ndn::FaceUri& faceUri,
128 const ndn::time::milliseconds& timeout,
133 setStrategy(
const ndn::Name& name,
const std::string& strategy, uint32_t count);
144 isNotNeighbor(
const ndn::Name& name);
156 getNumberOfFacesForName(
const NexthopList& nextHopList);
162 unregisterPrefix(
const ndn::Name& namePrefix,
const std::string& faceUri);
167 onRegistrationSuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
168 const std::string& message,
const ndn::FaceUri& faceUri);
173 onRegistrationFailure(
const ndn::nfd::ControlResponse& response,
174 const std::string& message,
175 const ndn::nfd::ControlParameters& parameters,
176 const ndn::FaceUri& faceUri,
182 onUnregistrationSuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
183 const std::string& message);
188 onUnregistrationFailure(
const ndn::nfd::ControlResponse& response,
189 const std::string& message);
194 onSetStrategySuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
195 const std::string& message);
200 onSetStrategyFailure(
const ndn::nfd::ControlResponse& response,
201 const ndn::nfd::ControlParameters& parameters,
203 const std::string& message);
217 scheduleEntryRefresh(
FibEntry& entry,
const afterRefreshCallback& refreshCb);
235 cancelEntryRefresh(
const FibEntry& entry);
240 refreshEntry(
const ndn::Name& name, afterRefreshCallback refreshCb);
243 ndn::Scheduler& m_scheduler;
244 int32_t m_refreshTime;
245 ndn::nfd::Controller m_controller;
249 std::map<ndn::Name, FibEntry> m_table;
259 static const uint64_t GRACE_PERIOD;
264 #endif // NLSR_ROUTE_FIB_HPP
A class to house all the configuration parameters for NLSR.
void update(const ndn::Name &name, const NexthopList &allHops)
Set the nexthop list of a name.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
void setStrategy(const ndn::Name &name, const std::string &strategy, uint32_t count)
Maps names to lists of next hops, and exports this information to NFD.
void setEntryRefreshTime(int32_t fert)
void clean()
Remove all entries from the FIB.
Fib(ndn::Face &face, ndn::Scheduler &scheduler, AdjacencyList &adjacencyList, ConfParameter &conf, ndn::security::v2::KeyChain &keyChain)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
std::function< void(FibEntry &)> afterRefreshCallback
void registerPrefix(const ndn::Name &namePrefix, const ndn::FaceUri &faceUri, uint64_t faceCost, const ndn::time::milliseconds &timeout, uint64_t flags, uint8_t times)
Inform NFD of a next-hop.