72 ndn::KeyChain& keyChain,
73 const ndn::Name& syncPrefix,
78 ndn::KeyChain& keyChain,
79 size_t expectedNumEntries,
80 const ndn::Name& syncPrefix,
81 const ndn::Name& userPrefix,
102 publishName(
const ndn::Name& prefix, std::optional<uint64_t> seq = std::nullopt);
116 processWaitingInterests();
119 scheduleProcessWaitingInterests();
137 onSyncInterest(
const ndn::Name& prefixName,
const ndn::Interest& interest,
138 bool isTimedProcessing =
false);
152 sendSyncData(
const ndn::Name& name,
const ndn::Block& block,
153 ndn::time::milliseconds syncReplyFreshness);
171 onSyncData(
const ndn::Interest& interest,
const ndn::ConstBufferPtr& bufferPtr);
184 satisfyPendingInterests(
const ndn::Name& updatedPrefixWithSeq);
190 deletePendingInterests(
const ndn::Name& interestName);
199 isFutureHash(
const ndn::Name& prefix,
const std::set<uint32_t>& negative);
201#ifdef PSYNC_WITH_TESTS
203 size_t nIbfDecodeFailuresAboveThreshold = 0;
204 size_t nIbfDecodeFailuresBelowThreshold = 0;
208 struct PendingEntryInfo
211 ndn::scheduler::ScopedEventId expirationEvent;
214 struct WaitingEntryInfo
216 uint16_t numTries = 0;
217 ndn::Interest::Nonce nonce;
220 ndn::time::milliseconds m_syncInterestLifetime;
222 ndn::scheduler::ScopedEventId m_scheduledSyncInterestId;
223 static constexpr int MIN_JITTER = 100;
224 static constexpr int MAX_JITTER = 500;
225 std::uniform_int_distribution<> m_jitter{MIN_JITTER, MAX_JITTER};
226 ndn::time::system_clock::time_point m_lastInterestSentTime;
227 ndn::Name m_outstandingInterestName;
228 ndn::ScopedRegisteredPrefixHandle m_registeredPrefix;
229 std::shared_ptr<ndn::SegmentFetcher> m_fetcher;
230 uint64_t m_incomingFace = 0;
231 std::map<ndn::Name, WaitingEntryInfo> m_waitingForProcessing;
232 bool m_inNoNewDataWaitOutPeriod =
false;
233 ndn::scheduler::ScopedEventId m_interestDelayTimerId;
236 std::map<ndn::Name, PendingEntryInfo> m_pendingEntries;