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, |
alvy | a2228c6 | 2014-12-09 10:25:11 -0600 | [diff] [blame] | 86 | MAX_FACES_PER_PREFIX_DEFAULT = 0, |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 87 | MAX_FACES_PER_PREFIX_MAX = 60 |
| 88 | }; |
| 89 | |
| 90 | enum { |
| 91 | HYPERBOLIC_STATE_OFF = 0, |
| 92 | HYPERBOLIC_STATE_ON = 1, |
alvy | a2228c6 | 2014-12-09 10:25:11 -0600 | [diff] [blame] | 93 | HYPERBOLIC_STATE_DRY_RUN = 2, |
| 94 | HYPERBOLIC_STATE_DEFAULT = 0 |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 95 | }; |
| 96 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 97 | class ConfParameter |
| 98 | { |
| 99 | |
| 100 | public: |
| 101 | ConfParameter() |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 102 | : m_lsaRefreshTime(LSA_REFRESH_TIME_DEFAULT) |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 103 | , m_adjLsaBuildInterval(ADJ_LSA_BUILD_INTERVAL_DEFAULT) |
| 104 | , m_firstHelloInterval(FIRST_HELLO_INTERVAL_DEFAULT) |
| 105 | , m_routingCalcInterval(ROUTING_CALC_INTERVAL_DEFAULT) |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 106 | , m_lsaInterestLifetime(ndn::time::seconds(static_cast<int>(LSA_INTEREST_LIFETIME_DEFAULT))) |
Alexander Afanasyev | 1cf1e10 | 2014-08-17 19:47:57 -0700 | [diff] [blame] | 107 | , m_routerDeadInterval(2 * LSA_REFRESH_TIME_DEFAULT) |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 108 | , m_logLevel("INFO") |
| 109 | , m_interestRetryNumber(HELLO_RETRIES_DEFAULT) |
| 110 | , m_interestResendTime(HELLO_TIMEOUT_DEFAULT) |
| 111 | , m_infoInterestInterval(HELLO_INTERVAL_DEFAULT) |
| 112 | , m_hyperbolicState(HYPERBOLIC_STATE_OFF) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 113 | , m_corR(0) |
| 114 | , m_corTheta(0) |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 115 | , m_maxFacesPerPrefix(MAX_FACES_PER_PREFIX_MIN) |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 116 | , m_isLog4cxxConfAvailable(false) |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 117 | { |
| 118 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 119 | |
| 120 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 121 | setNetwork(const ndn::Name& networkName) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 122 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 123 | m_network = networkName; |
| 124 | m_chronosyncPrefix = m_network; |
akmhoque | a816bee | 2014-06-24 14:37:40 -0500 | [diff] [blame] | 125 | m_chronosyncPrefix.append("NLSR"); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 126 | m_chronosyncPrefix.append("sync"); |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 127 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 128 | m_lsaPrefix = m_network; |
akmhoque | a816bee | 2014-06-24 14:37:40 -0500 | [diff] [blame] | 129 | m_lsaPrefix.append("NLSR"); |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 130 | m_lsaPrefix.append("LSA"); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 131 | } |
| 132 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 133 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 134 | getNetwork() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 135 | { |
| 136 | return m_network; |
| 137 | } |
| 138 | |
| 139 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 140 | setRouterName(const ndn::Name& routerName) |
| 141 | { |
| 142 | m_routerName = routerName; |
| 143 | } |
| 144 | |
| 145 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 146 | getRouterName() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 147 | { |
| 148 | return m_routerName; |
| 149 | } |
| 150 | |
| 151 | void |
| 152 | setSiteName(const ndn::Name& siteName) |
| 153 | { |
| 154 | m_siteName = siteName; |
| 155 | } |
| 156 | |
| 157 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 158 | getSiteName() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 159 | { |
| 160 | return m_siteName; |
| 161 | } |
| 162 | |
| 163 | void |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 164 | buildRouterPrefix() |
| 165 | { |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 166 | m_routerPrefix = m_network; |
| 167 | m_routerPrefix.append(m_siteName); |
| 168 | m_routerPrefix.append(m_routerName); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 169 | } |
| 170 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 171 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 172 | getRouterPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 173 | { |
| 174 | return m_routerPrefix; |
| 175 | } |
| 176 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 177 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 178 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 179 | getChronosyncPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 180 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 181 | return m_chronosyncPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 182 | } |
| 183 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 184 | const ndn::Name& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 185 | getLsaPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 186 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 187 | return m_lsaPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 191 | setLsaRefreshTime(uint32_t lrt) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 192 | { |
| 193 | m_lsaRefreshTime = lrt; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 194 | } |
| 195 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 196 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 197 | getLsaRefreshTime() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 198 | { |
| 199 | return m_lsaRefreshTime; |
| 200 | } |
| 201 | |
| 202 | void |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 203 | setLsaInterestLifetime(const ndn::time::seconds& lifetime) |
| 204 | { |
| 205 | m_lsaInterestLifetime = lifetime; |
| 206 | } |
| 207 | |
| 208 | const ndn::time::seconds& |
| 209 | getLsaInterestLifetime() const |
| 210 | { |
| 211 | return m_lsaInterestLifetime; |
| 212 | } |
| 213 | |
| 214 | void |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 215 | setAdjLsaBuildInterval(uint32_t interval) |
| 216 | { |
| 217 | m_adjLsaBuildInterval = interval; |
| 218 | } |
| 219 | |
| 220 | uint32_t |
| 221 | getAdjLsaBuildInterval() const |
| 222 | { |
| 223 | return m_adjLsaBuildInterval; |
| 224 | } |
| 225 | |
| 226 | void |
| 227 | setFirstHelloInterval(uint32_t interval) |
| 228 | { |
| 229 | m_firstHelloInterval = interval; |
| 230 | } |
| 231 | |
| 232 | uint32_t |
| 233 | getFirstHelloInterval() const |
| 234 | { |
| 235 | return m_firstHelloInterval; |
| 236 | } |
| 237 | |
| 238 | void |
| 239 | setRoutingCalcInterval(uint32_t interval) |
| 240 | { |
| 241 | m_routingCalcInterval = interval; |
| 242 | } |
| 243 | |
| 244 | uint32_t |
| 245 | getRoutingCalcInterval() const |
| 246 | { |
| 247 | return m_routingCalcInterval; |
| 248 | } |
| 249 | |
| 250 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 251 | setRouterDeadInterval(uint32_t rdt) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 252 | { |
| 253 | m_routerDeadInterval = rdt; |
| 254 | } |
| 255 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 256 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 257 | getRouterDeadInterval() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 258 | { |
| 259 | return m_routerDeadInterval; |
| 260 | } |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 261 | |
| 262 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 263 | setLogLevel(const std::string& logLevel) |
| 264 | { |
| 265 | m_logLevel = logLevel; |
| 266 | } |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 267 | |
| 268 | const std::string& |
| 269 | getLogLevel() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 270 | { |
| 271 | return m_logLevel; |
| 272 | } |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 273 | |
| 274 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 275 | setInterestRetryNumber(uint32_t irn) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 276 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 277 | m_interestRetryNumber = irn; |
| 278 | } |
| 279 | |
| 280 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 281 | getInterestRetryNumber() const |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 282 | { |
| 283 | return m_interestRetryNumber; |
| 284 | } |
| 285 | |
| 286 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 287 | setInterestResendTime(uint32_t irt) |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 288 | { |
| 289 | m_interestResendTime = irt; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 290 | } |
| 291 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 292 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 293 | getInterestResendTime() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 294 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 295 | return m_interestResendTime; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 296 | } |
| 297 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 298 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 299 | getInfoInterestInterval() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 300 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 301 | return m_infoInterestInterval; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | void |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 305 | setInfoInterestInterval(uint32_t iii) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 306 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 307 | m_infoInterestInterval = iii; |
| 308 | } |
| 309 | |
| 310 | void |
| 311 | setHyperbolicState(int32_t ihc) |
| 312 | { |
| 313 | m_hyperbolicState = ihc; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 314 | } |
| 315 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 316 | int32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 317 | getHyperbolicState() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 318 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 319 | return m_hyperbolicState; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 320 | } |
| 321 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 322 | bool |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 323 | setCorR(double cr) |
| 324 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 325 | if ( cr >= 0 ) { |
| 326 | m_corR = cr; |
| 327 | return true; |
| 328 | } |
| 329 | return false; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 330 | } |
| 331 | |
| 332 | double |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 333 | getCorR() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 334 | { |
| 335 | return m_corR; |
| 336 | } |
| 337 | |
| 338 | void |
| 339 | setCorTheta(double ct) |
| 340 | { |
| 341 | m_corTheta = ct; |
| 342 | } |
| 343 | |
| 344 | double |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 345 | getCorTheta() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 346 | { |
| 347 | return m_corTheta; |
| 348 | } |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 349 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 350 | void |
Vince Lehman | 942eb7b | 2014-10-02 10:09:27 -0500 | [diff] [blame] | 351 | setMaxFacesPerPrefix(uint32_t mfpp) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 352 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 353 | m_maxFacesPerPrefix = mfpp; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 354 | } |
| 355 | |
Vince Lehman | 942eb7b | 2014-10-02 10:09:27 -0500 | [diff] [blame] | 356 | uint32_t |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 357 | getMaxFacesPerPrefix() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 358 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 359 | return m_maxFacesPerPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | void |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 363 | setLogDir(const std::string& logDir) |
| 364 | { |
| 365 | m_logDir = logDir; |
| 366 | } |
| 367 | |
| 368 | const std::string& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 369 | getLogDir() const |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 370 | { |
| 371 | return m_logDir; |
| 372 | } |
| 373 | |
| 374 | void |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 375 | setSeqFileDir(const std::string& ssfd) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 376 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 377 | m_seqFileDir = ssfd; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 378 | } |
| 379 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 380 | const std::string& |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 381 | getSeqFileDir() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 382 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 383 | return m_seqFileDir; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 384 | } |
| 385 | |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 386 | bool |
| 387 | isLog4CxxConfAvailable() const |
| 388 | { |
| 389 | return m_isLog4cxxConfAvailable; |
| 390 | } |
| 391 | |
| 392 | void |
| 393 | setLog4CxxConfPath(const std::string& path) |
| 394 | { |
| 395 | m_log4CxxConfPath = path; |
| 396 | m_isLog4cxxConfAvailable = true; |
| 397 | } |
| 398 | |
| 399 | const std::string& |
| 400 | getLog4CxxConfPath() const |
| 401 | { |
| 402 | return m_log4CxxConfPath; |
| 403 | } |
| 404 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 405 | void |
| 406 | writeLog(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 407 | |
| 408 | private: |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 409 | ndn::Name m_routerName; |
| 410 | ndn::Name m_siteName; |
| 411 | ndn::Name m_network; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 412 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 413 | ndn::Name m_routerPrefix; |
| 414 | ndn::Name m_lsaRouterPrefix; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 415 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 416 | ndn::Name m_chronosyncPrefix; |
| 417 | ndn::Name m_lsaPrefix; |
| 418 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 419 | uint32_t m_lsaRefreshTime; |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 420 | |
| 421 | uint32_t m_adjLsaBuildInterval; |
| 422 | uint32_t m_firstHelloInterval; |
| 423 | uint32_t m_routingCalcInterval; |
| 424 | |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 425 | ndn::time::seconds m_lsaInterestLifetime; |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 426 | uint32_t m_routerDeadInterval; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 427 | std::string m_logLevel; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 428 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 429 | uint32_t m_interestRetryNumber; |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 430 | uint32_t m_interestResendTime; |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 431 | |
alvy | 5a45495 | 2014-12-15 12:49:54 -0600 | [diff] [blame^] | 432 | uint32_t m_infoInterestInterval; |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 433 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 434 | int32_t m_hyperbolicState; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 435 | double m_corR; |
| 436 | double m_corTheta; |
| 437 | |
Vince Lehman | 942eb7b | 2014-10-02 10:09:27 -0500 | [diff] [blame] | 438 | uint32_t m_maxFacesPerPrefix; |
Alexander Afanasyev | 411ee4b | 2014-08-16 23:17:03 -0700 | [diff] [blame] | 439 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 440 | std::string m_logDir; |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 441 | std::string m_seqFileDir; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 442 | |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 443 | bool m_isLog4cxxConfAvailable; |
| 444 | std::string m_log4CxxConfPath; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 445 | }; |
| 446 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 447 | } // namespace nlsr |
| 448 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 449 | #endif //CONF_PARAMETER_HPP |