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