35 : m_routerPrefix(opts.routerPrefix)
36 , m_hyperbolicState(opts.hyperbolicState)
40 , m_syncLogic(face, keyChain, opts.syncProtocol, opts.syncPrefix,
41 m_nameLsaUserPrefix, opts.syncInterestLifetime,
54SyncLogicHandler::processUpdate(
const ndn::Name& updateName, uint64_t highSeq, uint64_t incomingFaceId)
56 NLSR_LOG_DEBUG(
"Update Name: " << updateName <<
" Seq no: " << highSeq);
61 if (nlsrPosition < 0 || lsaPosition < 0) {
66 ndn::Name networkName = updateName.getSubName(1, nlsrPosition - 1);
67 ndn::Name routerName = updateName.getSubName(lsaPosition + 1).getPrefix(-1);
68 ndn::Name originRouter = networkName;
69 originRouter.append(routerName);
71 onSyncUpdate(updateName, highSeq, originRouter, incomingFaceId);
static const std::string NLSR_COMPONENT
Represents a Link State Announcement (LSA).
NLSR-to-sync interaction point.
SyncLogicHandler(ndn::Face &face, ndn::KeyChain &keyChain, const SyncLogicOptions &opts)
OnSyncUpdate onSyncUpdate
void publishRoutingUpdate(Lsa::Type type, uint64_t seqNo)
Instruct ChronoSync to publish an update.
void publishUpdate(const ndn::Name &userPrefix, uint64_t seq)
Publish update to Sync.
void addUserNode(const ndn::Name &userPrefix)
Add user node to Sync.
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
#define NLSR_LOG_DEBUG(x)
#define INIT_LOGGER(name)
int32_t getNameComponentPosition(const ndn::Name &name, const std::string &searchString)
search a name component in ndn::Name and return the position of the component
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
const std::string LSA_COMPONENT
ndn::Name makeLsaUserPrefix(const ndn::Name &userPrefix, Lsa::Type lsaType)