akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Nick Gordon | c6a8522 | 2017-01-03 16:54:34 -0600 | [diff] [blame] | 3 | * Copyright (c) 2014-2017, The University of Memphis, |
Vince Lehman | c2e51f6 | 2015-01-20 15:03:11 -0600 | [diff] [blame] | 4 | * Regents of the University of California, |
| 5 | * Arizona Board of Regents. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 6 | * |
| 7 | * This file is part of NLSR (Named-data Link State Routing). |
| 8 | * See AUTHORS.md for complete list of NLSR authors and contributors. |
| 9 | * |
| 10 | * NLSR is free software: you can redistribute it and/or modify it under the terms |
| 11 | * of the GNU General Public License as published by the Free Software Foundation, |
| 12 | * either version 3 of the License, or (at your option) any later version. |
| 13 | * |
| 14 | * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE. See the GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License along with |
| 19 | * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 20 | **/ |
Vince Lehman | c2e51f6 | 2015-01-20 15:03:11 -0600 | [diff] [blame] | 21 | |
dmcoomes | e689dd6 | 2017-03-29 11:05:12 -0500 | [diff] [blame] | 22 | #ifndef NLSR_CONF_PARAMETER_HPP |
| 23 | #define NLSR_CONF_PARAMETER_HPP |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 24 | |
Ashlesh Gawande | 3909aa1 | 2017-07-28 16:01:35 -0500 | [diff] [blame] | 25 | #include "logger.hpp" |
| 26 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 27 | #include <iostream> |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 28 | #include <boost/cstdint.hpp> |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 29 | #include <ndn-cxx/common.hpp> |
| 30 | #include <ndn-cxx/face.hpp> |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 31 | #include <ndn-cxx/util/time.hpp> |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 32 | |
| 33 | namespace nlsr { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 34 | |
| 35 | enum { |
| 36 | LSA_REFRESH_TIME_MIN = 240, |
| 37 | LSA_REFRESH_TIME_DEFAULT = 1800, |
| 38 | LSA_REFRESH_TIME_MAX = 7200 |
| 39 | }; |
| 40 | |
| 41 | enum { |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 42 | LSA_INTEREST_LIFETIME_MIN = 1, |
| 43 | LSA_INTEREST_LIFETIME_DEFAULT = 4, |
| 44 | LSA_INTEREST_LIFETIME_MAX = 60 |
| 45 | }; |
| 46 | |
| 47 | enum { |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 48 | ADJ_LSA_BUILD_INTERVAL_MIN = 0, |
| 49 | ADJ_LSA_BUILD_INTERVAL_DEFAULT = 5, |
| 50 | ADJ_LSA_BUILD_INTERVAL_MAX = 5 |
| 51 | }; |
| 52 | |
| 53 | enum { |
| 54 | FIRST_HELLO_INTERVAL_MIN = 0, |
| 55 | FIRST_HELLO_INTERVAL_DEFAULT = 10, |
| 56 | FIRST_HELLO_INTERVAL_MAX = 10 |
| 57 | }; |
| 58 | |
| 59 | enum { |
| 60 | ROUTING_CALC_INTERVAL_MIN = 0, |
| 61 | ROUTING_CALC_INTERVAL_DEFAULT = 15, |
| 62 | ROUTING_CALC_INTERVAL_MAX = 15 |
| 63 | }; |
| 64 | |
Nick Gordon | d5c1a37 | 2016-10-31 13:56:23 -0500 | [diff] [blame] | 65 | |
| 66 | enum { |
| 67 | FACE_DATASET_FETCH_TRIES_MIN = 1, |
| 68 | FACE_DATASET_FETCH_TRIES_MAX = 10, |
| 69 | FACE_DATASET_FETCH_TRIES_DEFAULT = 3 |
| 70 | }; |
| 71 | |
| 72 | enum { |
| 73 | FACE_DATASET_FETCH_INTERVAL_MIN = 1800, |
| 74 | FACE_DATASET_FETCH_INTERVAL_MAX = 5400, |
| 75 | FACE_DATASET_FETCH_INTERVAL_DEFAULT = 3600 |
| 76 | }; |
| 77 | |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 78 | enum { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 79 | HELLO_RETRIES_MIN = 1, |
| 80 | HELLO_RETRIES_DEFAULT = 3, |
| 81 | HELLO_RETRIES_MAX = 15 |
| 82 | }; |
| 83 | |
| 84 | enum { |
| 85 | HELLO_TIMEOUT_MIN = 1, |
| 86 | HELLO_TIMEOUT_DEFAULT = 3, |
| 87 | HELLO_TIMEOUT_MAX = 15 |
| 88 | }; |
| 89 | |
| 90 | enum { |
| 91 | HELLO_INTERVAL_MIN = 30, |
| 92 | HELLO_INTERVAL_DEFAULT = 60, |
| 93 | HELLO_INTERVAL_MAX =90 |
| 94 | }; |
| 95 | |
| 96 | enum { |
| 97 | MAX_FACES_PER_PREFIX_MIN = 0, |
alvy | a2228c6 | 2014-12-09 10:25:11 -0600 | [diff] [blame] | 98 | MAX_FACES_PER_PREFIX_DEFAULT = 0, |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 99 | MAX_FACES_PER_PREFIX_MAX = 60 |
| 100 | }; |
| 101 | |
Nick Gordon | 5c467f0 | 2016-07-13 13:40:10 -0500 | [diff] [blame] | 102 | enum HyperbolicState { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 103 | HYPERBOLIC_STATE_OFF = 0, |
| 104 | HYPERBOLIC_STATE_ON = 1, |
alvy | a2228c6 | 2014-12-09 10:25:11 -0600 | [diff] [blame] | 105 | HYPERBOLIC_STATE_DRY_RUN = 2, |
| 106 | HYPERBOLIC_STATE_DEFAULT = 0 |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 107 | }; |
| 108 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 109 | class ConfParameter |
| 110 | { |
| 111 | |
| 112 | public: |
| 113 | ConfParameter() |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 114 | : m_lsaRefreshTime(LSA_REFRESH_TIME_DEFAULT) |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 115 | , m_adjLsaBuildInterval(ADJ_LSA_BUILD_INTERVAL_DEFAULT) |
| 116 | , m_firstHelloInterval(FIRST_HELLO_INTERVAL_DEFAULT) |
| 117 | , m_routingCalcInterval(ROUTING_CALC_INTERVAL_DEFAULT) |
Ashlesh Gawande | 3909aa1 | 2017-07-28 16:01:35 -0500 | [diff] [blame] | 118 | , m_faceDatasetFetchInterval(ndn::time::seconds(static_cast<int>(FACE_DATASET_FETCH_INTERVAL_DEFAULT))) |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 119 | , m_lsaInterestLifetime(ndn::time::seconds(static_cast<int>(LSA_INTEREST_LIFETIME_DEFAULT))) |
Alexander Afanasyev | 1cf1e10 | 2014-08-17 19:47:57 -0700 | [diff] [blame] | 120 | , m_routerDeadInterval(2 * LSA_REFRESH_TIME_DEFAULT) |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 121 | , m_logLevel("INFO") |
| 122 | , m_interestRetryNumber(HELLO_RETRIES_DEFAULT) |
| 123 | , m_interestResendTime(HELLO_TIMEOUT_DEFAULT) |
| 124 | , m_infoInterestInterval(HELLO_INTERVAL_DEFAULT) |
| 125 | , m_hyperbolicState(HYPERBOLIC_STATE_OFF) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 126 | , m_corR(0) |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 127 | , m_maxFacesPerPrefix(MAX_FACES_PER_PREFIX_MIN) |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 128 | , m_isLog4cxxConfAvailable(false) |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 129 | { |
| 130 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 131 | |
| 132 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 133 | setNetwork(const ndn::Name& networkName) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 134 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 135 | m_network = networkName; |
Ashlesh Gawande | 4439523 | 2016-12-13 14:35:29 -0600 | [diff] [blame] | 136 | |
| 137 | m_chronosyncPrefix.append("localhop"); |
Ashlesh Gawande | 8bfd124 | 2017-06-21 14:55:27 -0500 | [diff] [blame] | 138 | m_chronosyncPrefix.append(m_network); |
akmhoque | a816bee | 2014-06-24 14:37:40 -0500 | [diff] [blame] | 139 | m_chronosyncPrefix.append("NLSR"); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 140 | m_chronosyncPrefix.append("sync"); |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 141 | |
Ashlesh Gawande | 6077ea9 | 2017-01-19 11:48:29 -0600 | [diff] [blame] | 142 | m_lsaPrefix.append("localhop"); |
| 143 | m_lsaPrefix.append(m_network); |
akmhoque | a816bee | 2014-06-24 14:37:40 -0500 | [diff] [blame] | 144 | m_lsaPrefix.append("NLSR"); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 145 | m_lsaPrefix.append("LSA"); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 146 | } |
| 147 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 148 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 149 | getNetwork() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 150 | { |
| 151 | return m_network; |
| 152 | } |
| 153 | |
| 154 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 155 | setRouterName(const ndn::Name& routerName) |
| 156 | { |
| 157 | m_routerName = routerName; |
| 158 | } |
| 159 | |
| 160 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 161 | getRouterName() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 162 | { |
| 163 | return m_routerName; |
| 164 | } |
| 165 | |
| 166 | void |
| 167 | setSiteName(const ndn::Name& siteName) |
| 168 | { |
| 169 | m_siteName = siteName; |
| 170 | } |
| 171 | |
| 172 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 173 | getSiteName() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 174 | { |
| 175 | return m_siteName; |
| 176 | } |
| 177 | |
| 178 | void |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 179 | buildRouterPrefix() |
| 180 | { |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 181 | m_routerPrefix = m_network; |
| 182 | m_routerPrefix.append(m_siteName); |
| 183 | m_routerPrefix.append(m_routerName); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 184 | } |
| 185 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 186 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 187 | getRouterPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 188 | { |
| 189 | return m_routerPrefix; |
| 190 | } |
| 191 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 192 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 193 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 194 | getChronosyncPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 195 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 196 | return m_chronosyncPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 197 | } |
| 198 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 199 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 200 | getLsaPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 201 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 202 | return m_lsaPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 206 | setLsaRefreshTime(uint32_t lrt) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 207 | { |
| 208 | m_lsaRefreshTime = lrt; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 209 | } |
| 210 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 211 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 212 | getLsaRefreshTime() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 213 | { |
| 214 | return m_lsaRefreshTime; |
| 215 | } |
| 216 | |
| 217 | void |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 218 | setLsaInterestLifetime(const ndn::time::seconds& lifetime) |
| 219 | { |
| 220 | m_lsaInterestLifetime = lifetime; |
| 221 | } |
| 222 | |
| 223 | const ndn::time::seconds& |
| 224 | getLsaInterestLifetime() const |
| 225 | { |
| 226 | return m_lsaInterestLifetime; |
| 227 | } |
| 228 | |
| 229 | void |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 230 | setAdjLsaBuildInterval(uint32_t interval) |
| 231 | { |
| 232 | m_adjLsaBuildInterval = interval; |
| 233 | } |
| 234 | |
| 235 | uint32_t |
| 236 | getAdjLsaBuildInterval() const |
| 237 | { |
| 238 | return m_adjLsaBuildInterval; |
| 239 | } |
| 240 | |
| 241 | void |
| 242 | setFirstHelloInterval(uint32_t interval) |
| 243 | { |
| 244 | m_firstHelloInterval = interval; |
| 245 | } |
| 246 | |
| 247 | uint32_t |
| 248 | getFirstHelloInterval() const |
| 249 | { |
| 250 | return m_firstHelloInterval; |
| 251 | } |
| 252 | |
| 253 | void |
| 254 | setRoutingCalcInterval(uint32_t interval) |
| 255 | { |
| 256 | m_routingCalcInterval = interval; |
| 257 | } |
| 258 | |
| 259 | uint32_t |
| 260 | getRoutingCalcInterval() const |
| 261 | { |
| 262 | return m_routingCalcInterval; |
| 263 | } |
| 264 | |
| 265 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 266 | setRouterDeadInterval(uint32_t rdt) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 267 | { |
| 268 | m_routerDeadInterval = rdt; |
| 269 | } |
| 270 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 271 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 272 | getRouterDeadInterval() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 273 | { |
| 274 | return m_routerDeadInterval; |
| 275 | } |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 276 | |
| 277 | void |
Nick Gordon | d5c1a37 | 2016-10-31 13:56:23 -0500 | [diff] [blame] | 278 | setFaceDatasetFetchTries(uint32_t count) |
| 279 | { |
| 280 | m_faceDatasetFetchTries = count; |
| 281 | } |
| 282 | |
| 283 | uint32_t |
| 284 | getFaceDatasetFetchTries() const |
| 285 | { |
| 286 | return m_faceDatasetFetchTries; |
| 287 | } |
| 288 | |
| 289 | void |
Ashlesh Gawande | 3909aa1 | 2017-07-28 16:01:35 -0500 | [diff] [blame] | 290 | setFaceDatasetFetchInterval(uint32_t interval) |
Nick Gordon | d5c1a37 | 2016-10-31 13:56:23 -0500 | [diff] [blame] | 291 | { |
Ashlesh Gawande | 3909aa1 | 2017-07-28 16:01:35 -0500 | [diff] [blame] | 292 | m_faceDatasetFetchInterval = ndn::time::seconds(interval); |
Nick Gordon | d5c1a37 | 2016-10-31 13:56:23 -0500 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | const ndn::time::seconds |
| 296 | getFaceDatasetFetchInterval() const |
| 297 | { |
| 298 | return m_faceDatasetFetchInterval; |
| 299 | } |
| 300 | |
| 301 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 302 | setLogLevel(const std::string& logLevel) |
| 303 | { |
| 304 | m_logLevel = logLevel; |
| 305 | } |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 306 | |
| 307 | const std::string& |
| 308 | getLogLevel() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 309 | { |
| 310 | return m_logLevel; |
| 311 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 312 | |
| 313 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 314 | setInterestRetryNumber(uint32_t irn) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 315 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 316 | m_interestRetryNumber = irn; |
| 317 | } |
| 318 | |
| 319 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 320 | getInterestRetryNumber() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 321 | { |
| 322 | return m_interestRetryNumber; |
| 323 | } |
| 324 | |
| 325 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 326 | setInterestResendTime(uint32_t irt) |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 327 | { |
| 328 | m_interestResendTime = irt; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 329 | } |
| 330 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 331 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 332 | getInterestResendTime() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 333 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 334 | return m_interestResendTime; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 335 | } |
| 336 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 337 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 338 | getInfoInterestInterval() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 339 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 340 | return m_infoInterestInterval; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 344 | setInfoInterestInterval(uint32_t iii) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 345 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 346 | m_infoInterestInterval = iii; |
| 347 | } |
| 348 | |
| 349 | void |
| 350 | setHyperbolicState(int32_t ihc) |
| 351 | { |
| 352 | m_hyperbolicState = ihc; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 353 | } |
| 354 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 355 | int32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 356 | getHyperbolicState() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 357 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 358 | return m_hyperbolicState; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 359 | } |
| 360 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 361 | bool |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 362 | setCorR(double cr) |
| 363 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 364 | if ( cr >= 0 ) { |
| 365 | m_corR = cr; |
| 366 | return true; |
| 367 | } |
| 368 | return false; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | double |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 372 | getCorR() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 373 | { |
| 374 | return m_corR; |
| 375 | } |
| 376 | |
| 377 | void |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 378 | setCorTheta(const std::vector<double>& ct) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 379 | { |
| 380 | m_corTheta = ct; |
| 381 | } |
| 382 | |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 383 | std::vector<double> |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 384 | getCorTheta() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 385 | { |
| 386 | return m_corTheta; |
| 387 | } |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 388 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 389 | void |
Vince Lehman | 942eb7b | 2014-10-02 10:09:27 -0500 | [diff] [blame] | 390 | setMaxFacesPerPrefix(uint32_t mfpp) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 391 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 392 | m_maxFacesPerPrefix = mfpp; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 393 | } |
| 394 | |
Vince Lehman | 942eb7b | 2014-10-02 10:09:27 -0500 | [diff] [blame] | 395 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 396 | getMaxFacesPerPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 397 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 398 | return m_maxFacesPerPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | void |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 402 | setLogDir(const std::string& logDir) |
| 403 | { |
| 404 | m_logDir = logDir; |
| 405 | } |
| 406 | |
| 407 | const std::string& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 408 | getLogDir() const |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 409 | { |
| 410 | return m_logDir; |
| 411 | } |
| 412 | |
| 413 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 414 | setSeqFileDir(const std::string& ssfd) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 415 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 416 | m_seqFileDir = ssfd; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 417 | } |
| 418 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 419 | const std::string& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 420 | getSeqFileDir() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 421 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 422 | return m_seqFileDir; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 423 | } |
| 424 | |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 425 | bool |
| 426 | isLog4CxxConfAvailable() const |
| 427 | { |
| 428 | return m_isLog4cxxConfAvailable; |
| 429 | } |
| 430 | |
| 431 | void |
| 432 | setLog4CxxConfPath(const std::string& path) |
| 433 | { |
| 434 | m_log4CxxConfPath = path; |
| 435 | m_isLog4cxxConfAvailable = true; |
| 436 | } |
| 437 | |
| 438 | const std::string& |
| 439 | getLog4CxxConfPath() const |
| 440 | { |
| 441 | return m_log4CxxConfPath; |
| 442 | } |
| 443 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 444 | void |
| 445 | writeLog(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 446 | |
| 447 | private: |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 448 | ndn::Name m_routerName; |
| 449 | ndn::Name m_siteName; |
| 450 | ndn::Name m_network; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 451 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 452 | ndn::Name m_routerPrefix; |
| 453 | ndn::Name m_lsaRouterPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 454 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 455 | ndn::Name m_chronosyncPrefix; |
| 456 | ndn::Name m_lsaPrefix; |
| 457 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 458 | uint32_t m_lsaRefreshTime; |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 459 | |
| 460 | uint32_t m_adjLsaBuildInterval; |
| 461 | uint32_t m_firstHelloInterval; |
| 462 | uint32_t m_routingCalcInterval; |
| 463 | |
Nick Gordon | d5c1a37 | 2016-10-31 13:56:23 -0500 | [diff] [blame] | 464 | uint32_t m_faceDatasetFetchTries; |
| 465 | ndn::time::seconds m_faceDatasetFetchInterval; |
| 466 | |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 467 | ndn::time::seconds m_lsaInterestLifetime; |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 468 | uint32_t m_routerDeadInterval; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 469 | std::string m_logLevel; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 470 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 471 | uint32_t m_interestRetryNumber; |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 472 | uint32_t m_interestResendTime; |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 473 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame] | 474 | uint32_t m_infoInterestInterval; |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 475 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 476 | int32_t m_hyperbolicState; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 477 | double m_corR; |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 478 | std::vector<double> m_corTheta; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 479 | |
Vince Lehman | 942eb7b | 2014-10-02 10:09:27 -0500 | [diff] [blame] | 480 | uint32_t m_maxFacesPerPrefix; |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 481 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 482 | std::string m_logDir; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 483 | std::string m_seqFileDir; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 484 | |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 485 | bool m_isLog4cxxConfAvailable; |
| 486 | std::string m_log4CxxConfPath; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 487 | }; |
| 488 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 489 | } // namespace nlsr |
| 490 | |
dmcoomes | e689dd6 | 2017-03-29 11:05:12 -0500 | [diff] [blame] | 491 | #endif // NLSR_CONF_PARAMETER_HPP |