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> 57 ndn::security::v2::KeyChain& keyChain)
58 : m_scheduler(scheduler)
60 , m_controller(face, keyChain)
61 , m_adjacencyList(adjacencyList)
62 , m_confParameter(conf)
78 remove(
const ndn::Name& name);
111 m_refreshTime = fert;
136 const ndn::FaceUri& faceUri,
138 const ndn::time::milliseconds& timeout,
143 setStrategy(
const ndn::Name& name,
const std::string& strategy, uint32_t count);
154 isPrefixUpdatable(
const ndn::Name& name);
172 unregisterPrefix(
const ndn::Name& namePrefix,
const std::string& faceUri);
177 onRegistrationSuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
178 const std::string& message,
const ndn::FaceUri& faceUri);
183 onRegistrationFailure(
const ndn::nfd::ControlResponse& response,
184 const std::string& message,
185 const ndn::nfd::ControlParameters& parameters,
186 const ndn::FaceUri& faceUri,
192 onUnregistrationSuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
193 const std::string& message);
198 onUnregistrationFailure(
const ndn::nfd::ControlResponse& response,
199 const std::string& message);
204 onSetStrategySuccess(
const ndn::nfd::ControlParameters& commandSuccessResult,
205 const std::string& message);
210 onSetStrategyFailure(
const ndn::nfd::ControlResponse& response,
211 const ndn::nfd::ControlParameters& parameters,
213 const std::string& message);
227 scheduleEntryRefresh(
FibEntry& entry,
const afterRefreshCallback& refreshCb);
245 cancelEntryRefresh(
const FibEntry& entry);
250 refreshEntry(
const ndn::Name& name, afterRefreshCallback refreshCb);
253 ndn::Scheduler& m_scheduler;
254 int32_t m_refreshTime;
255 ndn::nfd::Controller m_controller;
259 std::map<ndn::Name, FibEntry> m_table;
269 static const uint64_t GRACE_PERIOD;
274 #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.