26 #ifndef NFD_RIB_AUTO_PREFIX_PROPAGATOR_HPP 27 #define NFD_RIB_AUTO_PREFIX_PROPAGATOR_HPP 33 #include <ndn-cxx/security/key-chain.hpp> 34 #include <ndn-cxx/mgmt/nfd/controller.hpp> 35 #include <ndn-cxx/mgmt/nfd/control-command.hpp> 36 #include <ndn-cxx/mgmt/nfd/control-parameters.hpp> 37 #include <ndn-cxx/mgmt/nfd/command-options.hpp> 38 #include <ndn-cxx/util/signal.hpp> 79 class Error :
public std::runtime_error
84 :
std::runtime_error(what)
90 ndn::KeyChain& keyChain,
122 typedef std::unordered_map<Name, PropagatedEntry> PropagatedEntryList;
131 struct PrefixPropagationParameters
134 ndn::nfd::ControlParameters parameters;
135 ndn::nfd::CommandOptions options;
151 PrefixPropagationParameters
152 getPrefixPropagationParameters(
const Name& localRibPrefix);
163 doesCurrentPropagatedPrefixWork(
const Name& prefix);
179 redoPropagation(PropagatedEntryIt entryIt,
180 const ndn::nfd::ControlParameters& parameters,
181 const ndn::nfd::CommandOptions& options,
182 time::seconds retryWaitTime);
205 advertise(
const ndn::nfd::ControlParameters& parameters,
206 const ndn::nfd::CommandOptions& options,
207 time::seconds retryWaitTime);
217 withdraw(
const ndn::nfd::ControlParameters& parameters,
218 const ndn::nfd::CommandOptions& options,
219 time::seconds retryWaitTime);
231 afterInsertRibEntry(
const Name& prefix);
244 afterEraseRibEntry(
const Name& prefix);
256 afterRibInsert(
const ndn::nfd::ControlParameters& parameters,
257 const ndn::nfd::CommandOptions& options);
268 afterRibErase(
const ndn::nfd::ControlParameters& parameters,
269 const ndn::nfd::CommandOptions& options);
289 afterHubDisconnect();
311 afterPropagateSucceed(
const ndn::nfd::ControlParameters& parameters,
312 const ndn::nfd::CommandOptions& options,
313 const scheduler::EventCallback& refreshEvent);
330 afterPropagateFail(
const ndn::nfd::ControlResponse& response,
331 const ndn::nfd::ControlParameters& parameters,
332 const ndn::nfd::CommandOptions& options,
333 time::seconds retryWaitTime,
334 const scheduler::EventCallback& retryEvent);
351 afterRevokeSucceed(
const ndn::nfd::ControlParameters& parameters,
352 const ndn::nfd::CommandOptions& options,
353 time::seconds retryWaitTime);
363 afterRevokeFail(
const ndn::nfd::ControlResponse& response,
364 const ndn::nfd::ControlParameters& parameters,
365 const ndn::nfd::CommandOptions& options);
378 onRefreshTimer(
const ndn::nfd::ControlParameters& parameters,
379 const ndn::nfd::CommandOptions& options);
393 onRetryTimer(
const ndn::nfd::ControlParameters& parameters,
394 const ndn::nfd::CommandOptions& options,
395 time::seconds retryWaitTime);
398 ndn::nfd::Controller& m_nfdController;
399 ndn::KeyChain& m_keyChain;
401 ndn::util::signal::ScopedConnection m_afterInsertConnection;
402 ndn::util::signal::ScopedConnection m_afterEraseConnection;
403 ndn::nfd::ControlParameters m_controlParameters;
404 ndn::nfd::CommandOptions m_commandOptions;
405 time::seconds m_refreshInterval;
406 time::seconds m_baseRetryWait;
407 time::seconds m_maxRetryWait;
408 bool m_hasConnectedHub;
409 PropagatedEntryList m_propagatedEntries;
415 #endif // NFD_RIB_AUTO_PREFIX_PROPAGATOR_HPP AutoPrefixPropagator(ndn::nfd::Controller &controller, ndn::KeyChain &keyChain, Rib &rib)
represents the Routing Information Base
Error(const std::string &what)
provides automatic prefix propagation feature
void disable()
disable automatic prefix propagation
void enable()
enable automatic prefix propagation
Table::const_iterator iterator
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void loadConfig(const ConfigSection &configSection)
load the "auto_prefix_propagate" section from config file
boost::property_tree::ptree ConfigSection
a config file section
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE