conf: make ChronoSync's sync interest lifetime configurable
refs: #4490
Change-Id: Id3eabeed1049d1208ba49c47206f73f798f37a35
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index ee22764..ac32e04 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -106,6 +106,12 @@
HYPERBOLIC_STATE_DEFAULT = 0
};
+enum {
+ SYNC_INTEREST_LIFETIME_MIN = 1000,
+ SYNC_INTEREST_LIFETIME_DEFAULT = 60000,
+ SYNC_INTEREST_LIFETIME_MAX = 120000,
+};
+
/*! \brief A class to house all the configuration parameters for NLSR.
*
* This class is conceptually a singleton (but not mechanically) which
@@ -421,6 +427,18 @@
}
void
+ setSyncInterestLifetime(uint32_t syncInterestLifetime)
+ {
+ m_syncInterestLifetime = ndn::time::milliseconds(syncInterestLifetime);
+ }
+
+ const ndn::time::milliseconds&
+ getSyncInterestLifetime() const
+ {
+ return m_syncInterestLifetime;
+ }
+
+ void
writeLog();
private:
@@ -459,7 +477,7 @@
uint32_t m_maxFacesPerPrefix;
std::string m_seqFileDir;
-
+ ndn::time::milliseconds m_syncInterestLifetime;
};
} // namespace nlsr