72 return m_lsdb.get<
byName>().find(std::make_tuple(router, lsaType)) != m_lsdb.end();
84 buildAndInstallOwnCoordinateLsa();
98 processUpdateFromSync(
const ndn::Name& updateName, uint64_t seqNo,
99 const ndn::Name& originRouter, uint64_t incomingFaceId);
121 return m_isBuildAdjLsaScheduled;
134 return std::static_pointer_cast<T>(
findLsa(router, T::type()));
151 return std::hash<ndn::Name>{}(name);
159 return static_cast<int>(t);
167 std::shared_ptr<Lsa>,
174 bmi::const_mem_fun<Lsa, Lsa::Type, &Lsa::getType>
176 bmi::composite_key_hash<name_hash, enum_class_hash>
178 bmi::hashed_non_unique<
180 bmi::const_mem_fun<Lsa, Lsa::Type, &Lsa::getType>,
187 std::pair<LsaContainer::index<Lsdb::byType>::type::iterator,
188 LsaContainer::index<Lsdb::byType>::type::iterator>
191 return m_lsdb.get<
byType>().equal_range(T::type());
198 auto it = m_lsdb.get<byName>().find(std::make_tuple(router, lsaType));
199 return it != m_lsdb.end() ? *it :
nullptr;
203 incrementDataSentStats(
Lsa::Type lsaType)
217 incrementInterestRcvdStats(
Lsa::Type lsaType)
231 incrementInterestSentStats(
Lsa::Type lsaType)
250 isLsaNew(
const ndn::Name& originRouter,
Lsa::Type lsaType, uint64_t seqNo)
const
253 auto lsaPtr =
findLsa(originRouter, lsaType);
254 return lsaPtr ? lsaPtr->getSeqNo() < seqNo :
true;
258 installLsa(std::shared_ptr<Lsa> lsa);
269 removeLsa(
const ndn::Name& router,
Lsa::Type lsaType);
272 removeLsa(
const LsaContainer::index<Lsdb::byName>::type::iterator& lsaIt);
286 buildAndInstallOwnAdjLsa();
292 ndn::scheduler::EventId
293 scheduleLsaExpiration(std::shared_ptr<Lsa> lsa, ndn::time::seconds expTime);
299 expireOrRefreshLsa(std::shared_ptr<Lsa> lsa);
302 processInterestForLsa(
const ndn::Interest& interest,
const ndn::Name& originRouter,
306 expressInterest(
const ndn::Name& interestName, uint32_t timeoutCount, uint64_t incomingFaceId,
307 ndn::time::steady_clock::time_point deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE);
324 onFetchLsaError(uint32_t errorCode,
const std::string& msg,
325 const ndn::Name& interestName, uint32_t retransmitNo,
326 const ndn::time::steady_clock::time_point& deadline,
327 ndn::Name lsaName, uint64_t seqNo);
336 afterFetchLsa(
const ndn::ConstBufferPtr& bufferPtr,
const ndn::Name& interestName);
339 emitSegmentValidatedSignal(
const ndn::Data& data)
344 ndn::time::system_clock::time_point
345 getLsaExpirationTimePoint()
const
354 std::list<nlsr::PrefixInfo>, std::list<nlsr::PrefixInfo>>;
360 ndn::Scheduler m_scheduler;
367 ndn::time::seconds m_lsaRefreshTime;
368 ndn::time::seconds m_adjLsaBuildInterval;
369 const ndn::Name& m_thisRouterPrefix;
373 std::map<ndn::Name, uint64_t> m_highestSeqNo;
377 ndn::signal::ScopedConnection m_onSyncUpdate;
379 std::set<std::shared_ptr<ndn::SegmentFetcher>> m_fetchers;
380 ndn::Segmenter m_segmenter;
381 ndn::InMemoryStorageFifo m_segmentFifo;
383 bool m_isBuildAdjLsaScheduled;
384 int64_t m_adjBuildCount;
385 ndn::scheduler::ScopedEventId m_scheduledAdjLsaBuild;
387 ndn::InMemoryStoragePersistent m_lsaStorage;
389 static inline const ndn::time::steady_clock::time_point DEFAULT_LSA_RETRIEVAL_DEADLINE =
390 ndn::time::steady_clock::time_point::min();
boost::multi_index_container< std::shared_ptr< Lsa >, bmi::indexed_by< bmi::hashed_unique< bmi::tag< byName >, bmi::composite_key< Lsa, ExtractOriginRouter, bmi::const_mem_fun< Lsa, Lsa::Type, &Lsa::getType > >, bmi::composite_key_hash< name_hash, enum_class_hash > >, bmi::hashed_non_unique< bmi::tag< byType >, bmi::const_mem_fun< Lsa, Lsa::Type, &Lsa::getType >, enum_class_hash > > > LsaContainer