23 #ifndef NLSR_ROUTE_FIB_HPP 24 #define NLSR_ROUTE_FIB_HPP 30 #include <ndn-cxx/mgmt/nfd/controller.hpp> 31 #include <ndn-cxx/util/time.hpp> 58 ndn::security::v2::KeyChain& keyChain)
59 : m_scheduler(scheduler)
61 , m_controller(face, keyChain)
62 , m_adjacencyList(adjacencyList)
63 , m_confParameter(conf)
76 remove(
const ndn::Name& name);
109 m_refreshTime = fert;
134 const ndn::FaceUri& faceUri,
136 const ndn::time::milliseconds& timeout,
141 setStrategy(
const ndn::Name& name,
const std::string& strategy, uint32_t count);
152 isPrefixUpdatable(
const ndn::Name& name);
170 unregisterPrefix(
const ndn::Name& namePrefix,
const std::string& faceUri);
175 onRegistrationSuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
176 const std::string& message,
const ndn::FaceUri& faceUri);
181 onRegistrationFailure(
const ndn::nfd::ControlResponse& response,
182 const std::string& message,
183 const ndn::nfd::ControlParameters& parameters,
184 const ndn::FaceUri& faceUri,
190 onUnregistrationSuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
191 const std::string& message);
196 onUnregistrationFailure(
const ndn::nfd::ControlResponse& response,
197 const std::string& message);
202 onSetStrategySuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
203 const std::string& message);
208 onSetStrategyFailure(
const ndn::nfd::ControlResponse& response,
209 const ndn::nfd::ControlParameters& parameters,
211 const std::string& message);
225 scheduleEntryRefresh(
FibEntry& entry,
const afterRefreshCallback& refreshCb);
243 cancelEntryRefresh(
const FibEntry& entry);
248 refreshEntry(
const ndn::Name& name, afterRefreshCallback refreshCb);
251 ndn::Scheduler& m_scheduler;
252 int32_t m_refreshTime;
253 ndn::nfd::Controller m_controller;
257 std::map<ndn::Name, FibEntry> m_table;
267 static const uint64_t GRACE_PERIOD;
272 #endif // NLSR_ROUTE_FIB_HPP
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California.
A class to house all the configuration parameters for NLSR.
#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.
void update(const ndn::Name &name, NexthopList &allHops)
Set the nexthop list of a name.
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.