blob: 687aa1cc461a2ce2c5a21da39cd0ae03c4249bf4 [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Alexander Afanasyev0ad01f32020-06-03 14:12:58 -04002/*
Saurab Dulalecb0b712023-08-18 01:48:54 +00003 * Copyright (c) 2014-2023, The University of Memphis,
Vince Lehmanc2e51f62015-01-20 15:03:11 -06004 * Regents of the University of California,
5 * Arizona Board of Regents.
akmhoque3d06e792014-05-27 16:23:20 -05006 *
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/>.
Alexander Afanasyev0ad01f32020-06-03 14:12:58 -040020 */
Vince Lehmanc2e51f62015-01-20 15:03:11 -060021
dmcoomese689dd62017-03-29 11:05:12 -050022#ifndef NLSR_CONF_PARAMETER_HPP
23#define NLSR_CONF_PARAMETER_HPP
akmhoque53353462014-04-22 08:43:45 -050024
Nick Gordone98480b2017-05-24 11:23:03 -050025#include "common.hpp"
Ashlesh Gawande982a58f2018-02-14 17:39:12 -060026#include "test-access-control.hpp"
Ashlesh Gawande85998a12017-12-07 22:22:13 -060027#include "adjacency-list.hpp"
28#include "name-prefix-list.hpp"
Ashlesh Gawande3909aa12017-07-28 16:01:35 -050029
akmhoque31d1d4b2014-05-05 22:08:14 -050030#include <ndn-cxx/face.hpp>
Ashlesh Gawande85998a12017-12-07 22:22:13 -060031#include <ndn-cxx/security/validator-config.hpp>
Alexander Afanasyev0ad01f32020-06-03 14:12:58 -040032#include <ndn-cxx/security/certificate-fetcher-direct-fetch.hpp>
akmhoque53353462014-04-22 08:43:45 -050033
Davide Pesaventoc1d0e8e2022-06-15 14:26:02 -040034#include <optional>
35
akmhoque53353462014-04-22 08:43:45 -050036namespace nlsr {
akmhoque157b0a42014-05-13 00:26:37 -050037
Davide Pesavento1954a0c2022-09-30 15:56:04 -040038enum class SyncProtocol {
39 CHRONOSYNC,
40 PSYNC,
Varun Patil7d2d6892022-10-14 12:50:30 -070041 SVS,
Davide Pesavento1954a0c2022-09-30 15:56:04 -040042};
43
akmhoque157b0a42014-05-13 00:26:37 -050044enum {
45 LSA_REFRESH_TIME_MIN = 240,
46 LSA_REFRESH_TIME_DEFAULT = 1800,
47 LSA_REFRESH_TIME_MAX = 7200
48};
49
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -050050enum {
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -070051 LSA_INTEREST_LIFETIME_MIN = 1,
52 LSA_INTEREST_LIFETIME_DEFAULT = 4,
53 LSA_INTEREST_LIFETIME_MAX = 60
54};
55
56enum {
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -050057 ADJ_LSA_BUILD_INTERVAL_MIN = 5,
58 ADJ_LSA_BUILD_INTERVAL_DEFAULT = 10,
59 ADJ_LSA_BUILD_INTERVAL_MAX = 30
Vince Lehman7b616582014-10-17 16:25:39 -050060};
61
62enum {
63 ROUTING_CALC_INTERVAL_MIN = 0,
64 ROUTING_CALC_INTERVAL_DEFAULT = 15,
65 ROUTING_CALC_INTERVAL_MAX = 15
66};
67
Nick Gordond5c1a372016-10-31 13:56:23 -050068
69enum {
70 FACE_DATASET_FETCH_TRIES_MIN = 1,
71 FACE_DATASET_FETCH_TRIES_MAX = 10,
72 FACE_DATASET_FETCH_TRIES_DEFAULT = 3
73};
74
75enum {
76 FACE_DATASET_FETCH_INTERVAL_MIN = 1800,
77 FACE_DATASET_FETCH_INTERVAL_MAX = 5400,
78 FACE_DATASET_FETCH_INTERVAL_DEFAULT = 3600
79};
80
Vince Lehman7b616582014-10-17 16:25:39 -050081enum {
akmhoque157b0a42014-05-13 00:26:37 -050082 HELLO_RETRIES_MIN = 1,
83 HELLO_RETRIES_DEFAULT = 3,
84 HELLO_RETRIES_MAX = 15
85};
86
87enum {
88 HELLO_TIMEOUT_MIN = 1,
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -050089 HELLO_TIMEOUT_DEFAULT = 1,
akmhoque157b0a42014-05-13 00:26:37 -050090 HELLO_TIMEOUT_MAX = 15
91};
92
93enum {
94 HELLO_INTERVAL_MIN = 30,
95 HELLO_INTERVAL_DEFAULT = 60,
96 HELLO_INTERVAL_MAX =90
97};
98
99enum {
100 MAX_FACES_PER_PREFIX_MIN = 0,
alvya2228c62014-12-09 10:25:11 -0600101 MAX_FACES_PER_PREFIX_DEFAULT = 0,
akmhoque157b0a42014-05-13 00:26:37 -0500102 MAX_FACES_PER_PREFIX_MAX = 60
103};
104
Nick Gordon5c467f02016-07-13 13:40:10 -0500105enum HyperbolicState {
akmhoque157b0a42014-05-13 00:26:37 -0500106 HYPERBOLIC_STATE_OFF = 0,
107 HYPERBOLIC_STATE_ON = 1,
alvya2228c62014-12-09 10:25:11 -0600108 HYPERBOLIC_STATE_DRY_RUN = 2,
109 HYPERBOLIC_STATE_DEFAULT = 0
akmhoque157b0a42014-05-13 00:26:37 -0500110};
111
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600112enum {
113 SYNC_INTEREST_LIFETIME_MIN = 1000,
114 SYNC_INTEREST_LIFETIME_DEFAULT = 60000,
115 SYNC_INTEREST_LIFETIME_MAX = 120000,
116};
117
Nick Gordond0a7df32017-05-30 16:44:34 -0500118/*! \brief A class to house all the configuration parameters for NLSR.
119 *
120 * This class is conceptually a singleton (but not mechanically) which
121 * is just a collection of attributes that serve as a
122 * separation-of-data for NLSR's configuration variables. NLSR refers
123 * to an instance of this class for all its configuration
124 * parameters. This object is typically populated by a
125 * ConfFileProcessor reading a configuration file.
126 *
127 * \sa nlsr::ConfFileProcessor
128 */
akmhoque53353462014-04-22 08:43:45 -0500129class ConfParameter
130{
akmhoque53353462014-04-22 08:43:45 -0500131public:
Davide Pesaventod90338d2021-01-07 17:50:05 -0500132 ConfParameter(ndn::Face& face, ndn::KeyChain& keyChain,
Saurab Dulal427e0122019-11-28 11:58:02 -0600133 const std::string& confFileName = "nlsr.conf");
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600134
135 const std::string&
136 getConfFileName()
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700137 {
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600138 return m_confFileName;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700139 }
akmhoque53353462014-04-22 08:43:45 -0500140
141 void
Ashlesh Gawande982a58f2018-02-14 17:39:12 -0600142 setNetwork(const ndn::Name& networkName);
akmhoque53353462014-04-22 08:43:45 -0500143
akmhoque31d1d4b2014-05-05 22:08:14 -0500144 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700145 getNetwork() const
akmhoque53353462014-04-22 08:43:45 -0500146 {
147 return m_network;
148 }
149
150 void
akmhoque157b0a42014-05-13 00:26:37 -0500151 setRouterName(const ndn::Name& routerName)
152 {
153 m_routerName = routerName;
154 }
155
156 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700157 getRouterName() const
akmhoque157b0a42014-05-13 00:26:37 -0500158 {
159 return m_routerName;
160 }
161
162 void
163 setSiteName(const ndn::Name& siteName)
164 {
165 m_siteName = siteName;
166 }
167
168 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700169 getSiteName() const
akmhoque157b0a42014-05-13 00:26:37 -0500170 {
171 return m_siteName;
172 }
173
174 void
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500175 buildRouterAndSyncUserPrefix()
akmhoque53353462014-04-22 08:43:45 -0500176 {
akmhoque31d1d4b2014-05-05 22:08:14 -0500177 m_routerPrefix = m_network;
178 m_routerPrefix.append(m_siteName);
179 m_routerPrefix.append(m_routerName);
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500180
181 m_syncUserPrefix = m_lsaPrefix;
182 m_syncUserPrefix.append(m_siteName);
183 m_syncUserPrefix.append(m_routerName);
akmhoque53353462014-04-22 08:43:45 -0500184 }
185
akmhoque31d1d4b2014-05-05 22:08:14 -0500186 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700187 getRouterPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500188 {
189 return m_routerPrefix;
190 }
191
akmhoque31d1d4b2014-05-05 22:08:14 -0500192 const ndn::Name&
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500193 getSyncUserPrefix() const
194 {
195 return m_syncUserPrefix;
196 }
197
198 const ndn::Name&
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600199 getSyncPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500200 {
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600201 return m_syncPrefix;
akmhoque53353462014-04-22 08:43:45 -0500202 }
203
akmhoque157b0a42014-05-13 00:26:37 -0500204 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700205 getLsaPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500206 {
akmhoque157b0a42014-05-13 00:26:37 -0500207 return m_lsaPrefix;
akmhoque53353462014-04-22 08:43:45 -0500208 }
209
210 void
alvy5a454952014-12-15 12:49:54 -0600211 setLsaRefreshTime(uint32_t lrt)
akmhoque53353462014-04-22 08:43:45 -0500212 {
213 m_lsaRefreshTime = lrt;
akmhoque53353462014-04-22 08:43:45 -0500214 }
215
Ashlesh Gawande30d96e42021-03-21 19:15:33 -0700216 SyncProtocol
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500217 getSyncProtocol() const
218 {
219 return m_syncProtocol;
220 }
221
222 void
Ashlesh Gawande30d96e42021-03-21 19:15:33 -0700223 setSyncProtocol(SyncProtocol syncProtocol)
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500224 {
Ashlesh Gawande30d96e42021-03-21 19:15:33 -0700225 m_syncProtocol = syncProtocol;
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500226 }
227
228 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700229 getLsaRefreshTime() const
akmhoque53353462014-04-22 08:43:45 -0500230 {
231 return m_lsaRefreshTime;
232 }
233
234 void
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700235 setLsaInterestLifetime(const ndn::time::seconds& lifetime)
236 {
237 m_lsaInterestLifetime = lifetime;
238 }
239
240 const ndn::time::seconds&
241 getLsaInterestLifetime() const
242 {
243 return m_lsaInterestLifetime;
244 }
245
246 void
Vince Lehman7b616582014-10-17 16:25:39 -0500247 setAdjLsaBuildInterval(uint32_t interval)
248 {
249 m_adjLsaBuildInterval = interval;
250 }
251
252 uint32_t
253 getAdjLsaBuildInterval() const
254 {
255 return m_adjLsaBuildInterval;
256 }
257
258 void
Vince Lehman7b616582014-10-17 16:25:39 -0500259 setRoutingCalcInterval(uint32_t interval)
260 {
261 m_routingCalcInterval = interval;
262 }
263
264 uint32_t
265 getRoutingCalcInterval() const
266 {
267 return m_routingCalcInterval;
268 }
269
270 void
alvy5a454952014-12-15 12:49:54 -0600271 setRouterDeadInterval(uint32_t rdt)
akmhoque53353462014-04-22 08:43:45 -0500272 {
273 m_routerDeadInterval = rdt;
274 }
275
alvy5a454952014-12-15 12:49:54 -0600276 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700277 getRouterDeadInterval() const
akmhoque53353462014-04-22 08:43:45 -0500278 {
279 return m_routerDeadInterval;
280 }
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700281
282 void
Nick Gordond5c1a372016-10-31 13:56:23 -0500283 setFaceDatasetFetchTries(uint32_t count)
284 {
285 m_faceDatasetFetchTries = count;
286 }
287
288 uint32_t
289 getFaceDatasetFetchTries() const
290 {
291 return m_faceDatasetFetchTries;
292 }
293
294 void
Ashlesh Gawande3909aa12017-07-28 16:01:35 -0500295 setFaceDatasetFetchInterval(uint32_t interval)
Nick Gordond5c1a372016-10-31 13:56:23 -0500296 {
Ashlesh Gawande3909aa12017-07-28 16:01:35 -0500297 m_faceDatasetFetchInterval = ndn::time::seconds(interval);
Nick Gordond5c1a372016-10-31 13:56:23 -0500298 }
299
300 const ndn::time::seconds
301 getFaceDatasetFetchInterval() const
302 {
303 return m_faceDatasetFetchInterval;
304 }
305
306 void
akmhoque157b0a42014-05-13 00:26:37 -0500307 setInterestRetryNumber(uint32_t irn)
akmhoque53353462014-04-22 08:43:45 -0500308 {
akmhoque157b0a42014-05-13 00:26:37 -0500309 m_interestRetryNumber = irn;
310 }
311
312 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700313 getInterestRetryNumber() const
akmhoque157b0a42014-05-13 00:26:37 -0500314 {
315 return m_interestRetryNumber;
316 }
317
318 void
alvy5a454952014-12-15 12:49:54 -0600319 setInterestResendTime(uint32_t irt)
akmhoque157b0a42014-05-13 00:26:37 -0500320 {
321 m_interestResendTime = irt;
akmhoque53353462014-04-22 08:43:45 -0500322 }
323
alvy5a454952014-12-15 12:49:54 -0600324 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700325 getInterestResendTime() const
akmhoque53353462014-04-22 08:43:45 -0500326 {
akmhoque157b0a42014-05-13 00:26:37 -0500327 return m_interestResendTime;
akmhoque53353462014-04-22 08:43:45 -0500328 }
329
alvy5a454952014-12-15 12:49:54 -0600330 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700331 getInfoInterestInterval() const
akmhoque53353462014-04-22 08:43:45 -0500332 {
akmhoque157b0a42014-05-13 00:26:37 -0500333 return m_infoInterestInterval;
akmhoque53353462014-04-22 08:43:45 -0500334 }
335
336 void
alvy5a454952014-12-15 12:49:54 -0600337 setInfoInterestInterval(uint32_t iii)
akmhoque53353462014-04-22 08:43:45 -0500338 {
akmhoque157b0a42014-05-13 00:26:37 -0500339 m_infoInterestInterval = iii;
340 }
341
342 void
343 setHyperbolicState(int32_t ihc)
344 {
345 m_hyperbolicState = ihc;
akmhoque53353462014-04-22 08:43:45 -0500346 }
347
akmhoquefdbddb12014-05-02 18:35:19 -0500348 int32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700349 getHyperbolicState() const
akmhoque53353462014-04-22 08:43:45 -0500350 {
akmhoque157b0a42014-05-13 00:26:37 -0500351 return m_hyperbolicState;
akmhoque53353462014-04-22 08:43:45 -0500352 }
353
akmhoque157b0a42014-05-13 00:26:37 -0500354 bool
akmhoque53353462014-04-22 08:43:45 -0500355 setCorR(double cr)
356 {
akmhoque157b0a42014-05-13 00:26:37 -0500357 if ( cr >= 0 ) {
358 m_corR = cr;
359 return true;
360 }
361 return false;
akmhoque53353462014-04-22 08:43:45 -0500362 }
363
364 double
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700365 getCorR() const
akmhoque53353462014-04-22 08:43:45 -0500366 {
367 return m_corR;
368 }
369
370 void
Muktadir R Chowdhuryb00dc2a2016-11-05 10:48:58 -0600371 setCorTheta(const std::vector<double>& ct)
akmhoque53353462014-04-22 08:43:45 -0500372 {
373 m_corTheta = ct;
374 }
375
Muktadir R Chowdhuryb00dc2a2016-11-05 10:48:58 -0600376 std::vector<double>
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700377 getCorTheta() const
akmhoque53353462014-04-22 08:43:45 -0500378 {
379 return m_corTheta;
380 }
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700381
akmhoque53353462014-04-22 08:43:45 -0500382 void
Vince Lehman942eb7b2014-10-02 10:09:27 -0500383 setMaxFacesPerPrefix(uint32_t mfpp)
akmhoque53353462014-04-22 08:43:45 -0500384 {
akmhoque157b0a42014-05-13 00:26:37 -0500385 m_maxFacesPerPrefix = mfpp;
akmhoque53353462014-04-22 08:43:45 -0500386 }
387
Vince Lehman942eb7b2014-10-02 10:09:27 -0500388 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700389 getMaxFacesPerPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500390 {
akmhoque157b0a42014-05-13 00:26:37 -0500391 return m_maxFacesPerPrefix;
akmhoque53353462014-04-22 08:43:45 -0500392 }
393
394 void
dulalsaurab82a34c22019-02-04 17:31:21 +0000395 setStateFileDir(const std::string& ssfd)
akmhoque53353462014-04-22 08:43:45 -0500396 {
dulalsaurab82a34c22019-02-04 17:31:21 +0000397 m_stateFileDir = ssfd;
akmhoque53353462014-04-22 08:43:45 -0500398 }
399
akmhoque157b0a42014-05-13 00:26:37 -0500400 const std::string&
dulalsaurab82a34c22019-02-04 17:31:21 +0000401 getStateFileDir() const
akmhoque53353462014-04-22 08:43:45 -0500402 {
dulalsaurab82a34c22019-02-04 17:31:21 +0000403 return m_stateFileDir;
404 }
405
dulalsaurabd0816a32019-07-26 13:11:24 +0000406 void
407 setConfFileNameDynamic(const std::string& confFileDynamic)
dulalsaurab82a34c22019-02-04 17:31:21 +0000408 {
409 m_confFileNameDynamic = confFileDynamic;
410 }
411
412 const std::string&
413 getConfFileNameDynamic() const
414 {
415 return m_confFileNameDynamic;
akmhoque53353462014-04-22 08:43:45 -0500416 }
417
akmhoque674b0b12014-05-20 14:33:28 -0500418 void
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600419 setSyncInterestLifetime(uint32_t syncInterestLifetime)
420 {
421 m_syncInterestLifetime = ndn::time::milliseconds(syncInterestLifetime);
422 }
423
424 const ndn::time::milliseconds&
425 getSyncInterestLifetime() const
426 {
427 return m_syncInterestLifetime;
428 }
429
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600430 AdjacencyList&
431 getAdjacencyList()
432 {
433 return m_adjl;
434 }
435
436 NamePrefixList&
437 getNamePrefixList()
438 {
439 return m_npl;
440 }
441
442 ndn::security::ValidatorConfig&
443 getValidator()
444 {
445 return m_validator;
446 }
447
448 ndn::security::ValidatorConfig&
449 getPrefixUpdateValidator()
450 {
451 return m_prefixUpdateValidator;
452 }
453
Saurab Dulal427e0122019-11-28 11:58:02 -0600454 const ndn::security::SigningInfo&
455 getSigningInfo() const
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600456 {
Saurab Dulal427e0122019-11-28 11:58:02 -0600457 return m_signingInfo;
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600458 }
459
Saurab Dulal427e0122019-11-28 11:58:02 -0600460 void
461 addCertPath(const std::string& certPath)
462 {
463 m_certs.insert(certPath);
464 }
465
466 const std::unordered_set<std::string>&
467 getIdCerts() const
468 {
469 return m_certs;
470 }
471
472 const ndn::KeyChain&
473 getKeyChain() const
474 {
475 return m_keyChain;
476 }
477
Davide Pesaventoc1d0e8e2022-06-15 14:26:02 -0400478 std::optional<ndn::security::Certificate>
Saurab Dulal427e0122019-11-28 11:58:02 -0600479 initializeKey();
480
481 void
Alexander Afanasyev0ad01f32020-06-03 14:12:58 -0400482 loadCertToValidator(const ndn::security::Certificate& cert);
Saurab Dulal427e0122019-11-28 11:58:02 -0600483
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600484 /*! \brief Dump the current state of all attributes to the log.
485 */
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600486 void
akmhoque674b0b12014-05-20 14:33:28 -0500487 writeLog();
akmhoque53353462014-04-22 08:43:45 -0500488
Ashlesh Gawande328fc112019-12-12 17:06:44 -0600489PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600490 std::string m_confFileName;
Ashlesh Gawande328fc112019-12-12 17:06:44 -0600491 std::string m_confFileNameDynamic;
Davide Pesaventod90338d2021-01-07 17:50:05 -0500492
Ashlesh Gawande328fc112019-12-12 17:06:44 -0600493private:
akmhoque31d1d4b2014-05-05 22:08:14 -0500494 ndn::Name m_routerName;
495 ndn::Name m_siteName;
496 ndn::Name m_network;
akmhoque53353462014-04-22 08:43:45 -0500497
akmhoque31d1d4b2014-05-05 22:08:14 -0500498 ndn::Name m_routerPrefix;
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500499 ndn::Name m_syncUserPrefix;
akmhoque53353462014-04-22 08:43:45 -0500500
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600501 ndn::Name m_syncPrefix;
akmhoque157b0a42014-05-13 00:26:37 -0500502 ndn::Name m_lsaPrefix;
503
alvy5a454952014-12-15 12:49:54 -0600504 uint32_t m_lsaRefreshTime;
Vince Lehman7b616582014-10-17 16:25:39 -0500505
506 uint32_t m_adjLsaBuildInterval;
Vince Lehman7b616582014-10-17 16:25:39 -0500507 uint32_t m_routingCalcInterval;
508
Nick Gordond5c1a372016-10-31 13:56:23 -0500509 uint32_t m_faceDatasetFetchTries;
510 ndn::time::seconds m_faceDatasetFetchInterval;
511
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700512 ndn::time::seconds m_lsaInterestLifetime;
alvy5a454952014-12-15 12:49:54 -0600513 uint32_t m_routerDeadInterval;
akmhoque53353462014-04-22 08:43:45 -0500514
akmhoquefdbddb12014-05-02 18:35:19 -0500515 uint32_t m_interestRetryNumber;
alvy5a454952014-12-15 12:49:54 -0600516 uint32_t m_interestResendTime;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700517
alvy5a454952014-12-15 12:49:54 -0600518 uint32_t m_infoInterestInterval;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700519
akmhoque157b0a42014-05-13 00:26:37 -0500520 int32_t m_hyperbolicState;
akmhoque53353462014-04-22 08:43:45 -0500521 double m_corR;
Muktadir R Chowdhuryb00dc2a2016-11-05 10:48:58 -0600522 std::vector<double> m_corTheta;
akmhoque53353462014-04-22 08:43:45 -0500523
Vince Lehman942eb7b2014-10-02 10:09:27 -0500524 uint32_t m_maxFacesPerPrefix;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700525
dulalsaurab82a34c22019-02-04 17:31:21 +0000526 std::string m_stateFileDir;
527
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600528 ndn::time::milliseconds m_syncInterestLifetime;
Ashlesh Gawande982a58f2018-02-14 17:39:12 -0600529
Davide Pesavento1954a0c2022-09-30 15:56:04 -0400530 SyncProtocol m_syncProtocol = SyncProtocol::PSYNC;
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500531
Ashlesh Gawande982a58f2018-02-14 17:39:12 -0600532PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Davide Pesaventoc1d0e8e2022-06-15 14:26:02 -0400533 // must be incremented when breaking changes are made to sync
Saurab Dulalecb0b712023-08-18 01:48:54 +0000534 static constexpr uint64_t SYNC_VERSION = 11;
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600535
536 AdjacencyList m_adjl;
537 NamePrefixList m_npl;
538 ndn::security::ValidatorConfig m_validator;
539 ndn::security::ValidatorConfig m_prefixUpdateValidator;
Saurab Dulal427e0122019-11-28 11:58:02 -0600540 ndn::security::SigningInfo m_signingInfo;
541 std::unordered_set<std::string> m_certs;
542 ndn::KeyChain& m_keyChain;
akmhoque53353462014-04-22 08:43:45 -0500543};
544
akmhoque53353462014-04-22 08:43:45 -0500545} // namespace nlsr
546
dmcoomese689dd62017-03-29 11:05:12 -0500547#endif // NLSR_CONF_PARAMETER_HPP