22 #ifndef NLSR_ROUTE_FIB_HPP
23 #define NLSR_ROUTE_FIB_HPP
28 #include <ndn-cxx/mgmt/nfd/controller.hpp>
29 #include <ndn-cxx/util/scheduler.hpp>
30 #include <ndn-cxx/util/time.hpp>
65 Fib(ndn::Face& face, ndn::Scheduler& scheduler,
AdjacencyList& adjacencyList,
77 remove(
const ndn::Name& name);
107 m_refreshTime = fert;
132 const ndn::FaceUri& faceUri,
134 const ndn::time::milliseconds& timeout,
139 setStrategy(
const ndn::Name& name,
const ndn::Name& strategy, uint32_t count);
150 isNotNeighbor(
const ndn::Name& name);
162 getNumberOfFacesForName(
const NexthopList& nextHopList);
168 unregisterPrefix(
const ndn::Name& namePrefix,
const ndn::FaceUri& faceUri);
173 onRegistrationSuccess(
const ndn::nfd::ControlParameters& param,
174 const ndn::FaceUri& faceUri);
179 onRegistrationFailure(
const ndn::nfd::ControlResponse& response,
180 const ndn::nfd::ControlParameters& parameters,
181 const ndn::FaceUri& faceUri,
187 onSetStrategySuccess(
const ndn::nfd::ControlParameters& commandSuccessResult);
192 onSetStrategyFailure(
const ndn::nfd::ControlResponse& response,
193 const ndn::nfd::ControlParameters& parameters,
228 ndn::Scheduler& m_scheduler;
229 int32_t m_refreshTime;
230 ndn::nfd::Controller m_controller;
233 std::map<ndn::Name, FibEntry> m_table;
243 static constexpr uint64_t GRACE_PERIOD = 10;
A class to house all the configuration parameters for NLSR.
Maps names to lists of next hops, and exports this information to NFD.
void setStrategy(const ndn::Name &name, const ndn::Name &strategy, uint32_t count)
void clean()
Remove all entries from the FIB.
void remove(const ndn::Name &name)
Completely remove a name prefix from the FIB.
void update(const ndn::Name &name, const NexthopList &allHops)
Set the nexthop list of a name.
Fib(ndn::Face &face, ndn::Scheduler &scheduler, AdjacencyList &adjacencyList, ConfParameter &conf, ndn::security::KeyChain &keyChain)
void setEntryRefreshTime(int32_t fert)
static const ndn::Name MULTICAST_STRATEGY
static const ndn::Name BEST_ROUTE_STRATEGY
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.
ndn::signal::Signal< Fib, ndn::Name > onPrefixRegistrationSuccess
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
std::function< void(FibEntry &)> AfterRefreshCallback
ndn::scheduler::ScopedEventId refreshEventId
NextHopsUriSortedSet nexthopSet
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE