22 #ifndef NLSR_SYNC_LOGIC_HANDLER_HPP 23 #define NLSR_SYNC_LOGIC_HANDLER_HPP 30 #include <ndn-cxx/face.hpp> 31 #include <ndn-cxx/util/signal.hpp> 32 #include <ChronoSync/socket.hpp> 33 #include <boost/throw_exception.hpp> 35 class InterestManager;
53 std::function<bool(const ndn::Name&, const Lsa::Type& lsaType, const uint64_t&)>;
55 class Error :
public std::runtime_error
60 :
std::runtime_error(what)
99 const ndn::time::milliseconds& syncInterestLifetime =
118 processUpdateFromSync(
const ndn::Name& originRouter,
119 const ndn::Name& updateName,
const uint64_t& seqNo);
128 publishSyncUpdate(
const ndn::Name& updatePrefix, uint64_t seqNo);
134 ndn::Face& m_syncFace;
135 std::shared_ptr<chronosync::Socket> m_syncSocket;
136 ndn::Name m_syncPrefix;
141 ndn::Name m_nameLsaUserPrefix;
142 ndn::Name m_adjLsaUserPrefix;
143 ndn::Name m_coorLsaUserPrefix;
153 #endif // NLSR_SYNC_LOGIC_HANDLER_HPP
const std::string NLSR_COMPONENT
A class to house all the configuration parameters for NLSR.
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
std::unique_ptr< OnNewLsa > onNewLsa
std::function< bool(const ndn::Name &, const Lsa::Type &lsaType, const uint64_t &)> IsLsaNew
NLSR-to-ChronoSync interaction point.
Error(const std::string &what)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void createSyncSocket(const ndn::Name &syncPrefix, const ndn::time::milliseconds &syncInterestLifetime=ndn::time::milliseconds(SYNC_INTEREST_LIFETIME_DEFAULT))
Create and configure a socket to enable ChronoSync for this NLSR.
const std::string LSA_COMPONENT
SyncLogicHandler(ndn::Face &face, const IsLsaNew &isLsaNew, const ConfParameter &conf)
void onChronoSyncUpdate(const std::vector< chronosync::MissingDataInfo > &v)
Hook function to call whenever sync detects new data.
void publishRoutingUpdate(const Lsa::Type &type, const uint64_t &seqNo)
Instruct ChronoSync to publish an update.