src: ConfParameter variables should be consistent with their min and max values
refs: #2084
Change-Id: Iae71da80ae47fca44ec46f4a3f0d4d86c77e5094
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index 1b5dc61..21940d6 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -256,7 +256,7 @@
}
// lsa-refresh-time
- int32_t lsaRefreshTime = section.get<int32_t>("lsa-refresh-time", LSA_REFRESH_TIME_DEFAULT);
+ uint32_t lsaRefreshTime = section.get<uint32_t>("lsa-refresh-time", LSA_REFRESH_TIME_DEFAULT);
if (lsaRefreshTime >= LSA_REFRESH_TIME_MIN && lsaRefreshTime <= LSA_REFRESH_TIME_MAX) {
m_nlsr.getConfParameter().setLsaRefreshTime(lsaRefreshTime);
@@ -270,7 +270,7 @@
}
// router-dead-interval
- int32_t routerDeadInterval = section.get<int32_t>("router-dead-interval", (2*lsaRefreshTime));
+ uint32_t routerDeadInterval = section.get<uint32_t>("router-dead-interval", (2*lsaRefreshTime));
if (routerDeadInterval > m_nlsr.getConfParameter().getLsaRefreshTime()) {
m_nlsr.getConfParameter().setRouterDeadInterval(routerDeadInterval);
@@ -422,7 +422,7 @@
}
// hello-timeout
- int timeOut = section.get<int>("hello-timeout", HELLO_TIMEOUT_DEFAULT);
+ uint32_t timeOut = section.get<uint32_t>("hello-timeout", HELLO_TIMEOUT_DEFAULT);
if (timeOut >= HELLO_TIMEOUT_MIN && timeOut <= HELLO_TIMEOUT_MAX) {
m_nlsr.getConfParameter().setInterestResendTime(timeOut);
@@ -436,7 +436,7 @@
}
// hello-interval
- int interval = section.get<int>("hello-interval", HELLO_INTERVAL_DEFAULT);
+ uint32_t interval = section.get<uint32_t>("hello-interval", HELLO_INTERVAL_DEFAULT);
if (interval >= HELLO_INTERVAL_MIN && interval <= HELLO_INTERVAL_MAX) {
m_nlsr.getConfParameter().setInfoInterestInterval(interval);
diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp
index 4edf33e..9c227de 100644
--- a/src/conf-parameter.hpp
+++ b/src/conf-parameter.hpp
@@ -188,12 +188,12 @@
}
void
- setLsaRefreshTime(int32_t lrt)
+ setLsaRefreshTime(uint32_t lrt)
{
m_lsaRefreshTime = lrt;
}
- int32_t
+ uint32_t
getLsaRefreshTime() const
{
return m_lsaRefreshTime;
@@ -248,12 +248,12 @@
}
void
- setRouterDeadInterval(int32_t rdt)
+ setRouterDeadInterval(uint32_t rdt)
{
m_routerDeadInterval = rdt;
}
- int32_t
+ uint32_t
getRouterDeadInterval() const
{
return m_routerDeadInterval;
@@ -284,25 +284,25 @@
}
void
- setInterestResendTime(int32_t irt)
+ setInterestResendTime(uint32_t irt)
{
m_interestResendTime = irt;
}
- int32_t
+ uint32_t
getInterestResendTime() const
{
return m_interestResendTime;
}
- int32_t
+ uint32_t
getInfoInterestInterval() const
{
return m_infoInterestInterval;
}
void
- setInfoInterestInterval(int32_t iii)
+ setInfoInterestInterval(uint32_t iii)
{
m_infoInterestInterval = iii;
}
@@ -416,20 +416,20 @@
ndn::Name m_chronosyncPrefix;
ndn::Name m_lsaPrefix;
- int32_t m_lsaRefreshTime;
+ uint32_t m_lsaRefreshTime;
uint32_t m_adjLsaBuildInterval;
uint32_t m_firstHelloInterval;
uint32_t m_routingCalcInterval;
ndn::time::seconds m_lsaInterestLifetime;
- int32_t m_routerDeadInterval;
+ uint32_t m_routerDeadInterval;
std::string m_logLevel;
uint32_t m_interestRetryNumber;
- int32_t m_interestResendTime;
+ uint32_t m_interestResendTime;
- int32_t m_infoInterestInterval;
+ uint32_t m_infoInterestInterval;
int32_t m_hyperbolicState;
double m_corR;