Add version number after ChronoSync prefix
Change-Id: I5c6782461e6c00129850ab00df407a1f59f4353b
diff --git a/src/conf-parameter.cpp b/src/conf-parameter.cpp
index f0d41cb..5ffca5b 100644
--- a/src/conf-parameter.cpp
+++ b/src/conf-parameter.cpp
@@ -28,6 +28,9 @@
INIT_LOGGER(ConfParameter);
+// To be changed when breaking changes are made to sync
+const uint64_t ConfParameter::SYNC_VERSION = 4;
+
void
ConfParameter::writeLog()
{
@@ -59,4 +62,21 @@
NLSR_LOG_INFO("Routing calculation interval: " << m_routingCalcInterval);
}
+void
+ConfParameter::setNetwork(const ndn::Name& networkName)
+{
+ m_network = networkName;
+
+ m_chronosyncPrefix.append("localhop");
+ m_chronosyncPrefix.append(m_network);
+ m_chronosyncPrefix.append("NLSR");
+ m_chronosyncPrefix.append("sync");
+ m_chronosyncPrefix.appendVersion(SYNC_VERSION);
+
+ m_lsaPrefix.append("localhop");
+ m_lsaPrefix.append(m_network);
+ m_lsaPrefix.append("NLSR");
+ m_lsaPrefix.append("LSA");
+}
+
} // namespace nlsr
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index ac32e04..cac002a 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -24,6 +24,7 @@
#include "common.hpp"
#include "logger.hpp"
+#include "test-access-control.hpp"
#include <iostream>
#include <boost/cstdint.hpp>
@@ -146,20 +147,7 @@
}
void
- setNetwork(const ndn::Name& networkName)
- {
- m_network = networkName;
-
- m_chronosyncPrefix.append("localhop");
- m_chronosyncPrefix.append(m_network);
- m_chronosyncPrefix.append("NLSR");
- m_chronosyncPrefix.append("sync");
-
- m_lsaPrefix.append("localhop");
- m_lsaPrefix.append(m_network);
- m_lsaPrefix.append("NLSR");
- m_lsaPrefix.append("LSA");
- }
+ setNetwork(const ndn::Name& networkName);
const ndn::Name&
getNetwork() const
@@ -478,6 +466,9 @@
std::string m_seqFileDir;
ndn::time::milliseconds m_syncInterestLifetime;
+
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+ static const uint64_t SYNC_VERSION;
};
} // namespace nlsr