conf: make ChronoSync's sync interest lifetime configurable
refs: #4490
Change-Id: Id3eabeed1049d1208ba49c47206f73f798f37a35
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index e93ef35..d388221 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -287,6 +287,19 @@
return false;
}
+ uint32_t syncInterestLifetime = section.get<uint32_t>("sync-interest-lifetime", SYNC_INTEREST_LIFETIME_DEFAULT);
+ if (syncInterestLifetime >= SYNC_INTEREST_LIFETIME_MIN &&
+ syncInterestLifetime <= SYNC_INTEREST_LIFETIME_MAX) {
+ m_nlsr.getConfParameter().setSyncInterestLifetime(syncInterestLifetime);
+ }
+ else {
+ std::cerr << "Wrong value for sync-interest-lifetime. "
+ << "Allowed value:" << SYNC_INTEREST_LIFETIME_MIN << "-"
+ << SYNC_INTEREST_LIFETIME_MAX << std::endl;
+
+ return false;
+ }
+
try {
std::string seqDir = section.get<std::string>("seq-dir");
if (boost::filesystem::exists(seqDir)) {