blob: 32b343c632439c8c7cb4925938c195186491ed7c [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/*
Junxiao Shib032fcb2022-04-28 01:28:50 +00003 * Copyright (c) 2014-2022, 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,
41};
42
akmhoque157b0a42014-05-13 00:26:37 -050043enum {
44 LSA_REFRESH_TIME_MIN = 240,
45 LSA_REFRESH_TIME_DEFAULT = 1800,
46 LSA_REFRESH_TIME_MAX = 7200
47};
48
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -050049enum {
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -070050 LSA_INTEREST_LIFETIME_MIN = 1,
51 LSA_INTEREST_LIFETIME_DEFAULT = 4,
52 LSA_INTEREST_LIFETIME_MAX = 60
53};
54
55enum {
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -050056 ADJ_LSA_BUILD_INTERVAL_MIN = 5,
57 ADJ_LSA_BUILD_INTERVAL_DEFAULT = 10,
58 ADJ_LSA_BUILD_INTERVAL_MAX = 30
Vince Lehman7b616582014-10-17 16:25:39 -050059};
60
61enum {
62 ROUTING_CALC_INTERVAL_MIN = 0,
63 ROUTING_CALC_INTERVAL_DEFAULT = 15,
64 ROUTING_CALC_INTERVAL_MAX = 15
65};
66
Nick Gordond5c1a372016-10-31 13:56:23 -050067
68enum {
69 FACE_DATASET_FETCH_TRIES_MIN = 1,
70 FACE_DATASET_FETCH_TRIES_MAX = 10,
71 FACE_DATASET_FETCH_TRIES_DEFAULT = 3
72};
73
74enum {
75 FACE_DATASET_FETCH_INTERVAL_MIN = 1800,
76 FACE_DATASET_FETCH_INTERVAL_MAX = 5400,
77 FACE_DATASET_FETCH_INTERVAL_DEFAULT = 3600
78};
79
Vince Lehman7b616582014-10-17 16:25:39 -050080enum {
akmhoque157b0a42014-05-13 00:26:37 -050081 HELLO_RETRIES_MIN = 1,
82 HELLO_RETRIES_DEFAULT = 3,
83 HELLO_RETRIES_MAX = 15
84};
85
86enum {
87 HELLO_TIMEOUT_MIN = 1,
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -050088 HELLO_TIMEOUT_DEFAULT = 1,
akmhoque157b0a42014-05-13 00:26:37 -050089 HELLO_TIMEOUT_MAX = 15
90};
91
92enum {
93 HELLO_INTERVAL_MIN = 30,
94 HELLO_INTERVAL_DEFAULT = 60,
95 HELLO_INTERVAL_MAX =90
96};
97
98enum {
99 MAX_FACES_PER_PREFIX_MIN = 0,
alvya2228c62014-12-09 10:25:11 -0600100 MAX_FACES_PER_PREFIX_DEFAULT = 0,
akmhoque157b0a42014-05-13 00:26:37 -0500101 MAX_FACES_PER_PREFIX_MAX = 60
102};
103
Nick Gordon5c467f02016-07-13 13:40:10 -0500104enum HyperbolicState {
akmhoque157b0a42014-05-13 00:26:37 -0500105 HYPERBOLIC_STATE_OFF = 0,
106 HYPERBOLIC_STATE_ON = 1,
alvya2228c62014-12-09 10:25:11 -0600107 HYPERBOLIC_STATE_DRY_RUN = 2,
108 HYPERBOLIC_STATE_DEFAULT = 0
akmhoque157b0a42014-05-13 00:26:37 -0500109};
110
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600111enum {
112 SYNC_INTEREST_LIFETIME_MIN = 1000,
113 SYNC_INTEREST_LIFETIME_DEFAULT = 60000,
114 SYNC_INTEREST_LIFETIME_MAX = 120000,
115};
116
Nick Gordond0a7df32017-05-30 16:44:34 -0500117/*! \brief A class to house all the configuration parameters for NLSR.
118 *
119 * This class is conceptually a singleton (but not mechanically) which
120 * is just a collection of attributes that serve as a
121 * separation-of-data for NLSR's configuration variables. NLSR refers
122 * to an instance of this class for all its configuration
123 * parameters. This object is typically populated by a
124 * ConfFileProcessor reading a configuration file.
125 *
126 * \sa nlsr::ConfFileProcessor
127 */
akmhoque53353462014-04-22 08:43:45 -0500128class ConfParameter
129{
akmhoque53353462014-04-22 08:43:45 -0500130public:
Davide Pesaventod90338d2021-01-07 17:50:05 -0500131 ConfParameter(ndn::Face& face, ndn::KeyChain& keyChain,
Saurab Dulal427e0122019-11-28 11:58:02 -0600132 const std::string& confFileName = "nlsr.conf");
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600133
134 const std::string&
135 getConfFileName()
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700136 {
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600137 return m_confFileName;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700138 }
akmhoque53353462014-04-22 08:43:45 -0500139
140 void
Ashlesh Gawande982a58f2018-02-14 17:39:12 -0600141 setNetwork(const ndn::Name& networkName);
akmhoque53353462014-04-22 08:43:45 -0500142
akmhoque31d1d4b2014-05-05 22:08:14 -0500143 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700144 getNetwork() const
akmhoque53353462014-04-22 08:43:45 -0500145 {
146 return m_network;
147 }
148
149 void
akmhoque157b0a42014-05-13 00:26:37 -0500150 setRouterName(const ndn::Name& routerName)
151 {
152 m_routerName = routerName;
153 }
154
155 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700156 getRouterName() const
akmhoque157b0a42014-05-13 00:26:37 -0500157 {
158 return m_routerName;
159 }
160
161 void
162 setSiteName(const ndn::Name& siteName)
163 {
164 m_siteName = siteName;
165 }
166
167 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700168 getSiteName() const
akmhoque157b0a42014-05-13 00:26:37 -0500169 {
170 return m_siteName;
171 }
172
173 void
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500174 buildRouterAndSyncUserPrefix()
akmhoque53353462014-04-22 08:43:45 -0500175 {
akmhoque31d1d4b2014-05-05 22:08:14 -0500176 m_routerPrefix = m_network;
177 m_routerPrefix.append(m_siteName);
178 m_routerPrefix.append(m_routerName);
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500179
180 m_syncUserPrefix = m_lsaPrefix;
181 m_syncUserPrefix.append(m_siteName);
182 m_syncUserPrefix.append(m_routerName);
akmhoque53353462014-04-22 08:43:45 -0500183 }
184
akmhoque31d1d4b2014-05-05 22:08:14 -0500185 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700186 getRouterPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500187 {
188 return m_routerPrefix;
189 }
190
akmhoque31d1d4b2014-05-05 22:08:14 -0500191 const ndn::Name&
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500192 getSyncUserPrefix() const
193 {
194 return m_syncUserPrefix;
195 }
196
197 const ndn::Name&
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600198 getSyncPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500199 {
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600200 return m_syncPrefix;
akmhoque53353462014-04-22 08:43:45 -0500201 }
202
akmhoque157b0a42014-05-13 00:26:37 -0500203 const ndn::Name&
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700204 getLsaPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500205 {
akmhoque157b0a42014-05-13 00:26:37 -0500206 return m_lsaPrefix;
akmhoque53353462014-04-22 08:43:45 -0500207 }
208
209 void
alvy5a454952014-12-15 12:49:54 -0600210 setLsaRefreshTime(uint32_t lrt)
akmhoque53353462014-04-22 08:43:45 -0500211 {
212 m_lsaRefreshTime = lrt;
akmhoque53353462014-04-22 08:43:45 -0500213 }
214
Ashlesh Gawande30d96e42021-03-21 19:15:33 -0700215 SyncProtocol
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500216 getSyncProtocol() const
217 {
218 return m_syncProtocol;
219 }
220
221 void
Ashlesh Gawande30d96e42021-03-21 19:15:33 -0700222 setSyncProtocol(SyncProtocol syncProtocol)
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500223 {
Ashlesh Gawande30d96e42021-03-21 19:15:33 -0700224 m_syncProtocol = syncProtocol;
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500225 }
226
227 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700228 getLsaRefreshTime() const
akmhoque53353462014-04-22 08:43:45 -0500229 {
230 return m_lsaRefreshTime;
231 }
232
233 void
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700234 setLsaInterestLifetime(const ndn::time::seconds& lifetime)
235 {
236 m_lsaInterestLifetime = lifetime;
237 }
238
239 const ndn::time::seconds&
240 getLsaInterestLifetime() const
241 {
242 return m_lsaInterestLifetime;
243 }
244
245 void
Vince Lehman7b616582014-10-17 16:25:39 -0500246 setAdjLsaBuildInterval(uint32_t interval)
247 {
248 m_adjLsaBuildInterval = interval;
249 }
250
251 uint32_t
252 getAdjLsaBuildInterval() const
253 {
254 return m_adjLsaBuildInterval;
255 }
256
257 void
Vince Lehman7b616582014-10-17 16:25:39 -0500258 setRoutingCalcInterval(uint32_t interval)
259 {
260 m_routingCalcInterval = interval;
261 }
262
263 uint32_t
264 getRoutingCalcInterval() const
265 {
266 return m_routingCalcInterval;
267 }
268
269 void
alvy5a454952014-12-15 12:49:54 -0600270 setRouterDeadInterval(uint32_t rdt)
akmhoque53353462014-04-22 08:43:45 -0500271 {
272 m_routerDeadInterval = rdt;
273 }
274
alvy5a454952014-12-15 12:49:54 -0600275 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700276 getRouterDeadInterval() const
akmhoque53353462014-04-22 08:43:45 -0500277 {
278 return m_routerDeadInterval;
279 }
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700280
281 void
Nick Gordond5c1a372016-10-31 13:56:23 -0500282 setFaceDatasetFetchTries(uint32_t count)
283 {
284 m_faceDatasetFetchTries = count;
285 }
286
287 uint32_t
288 getFaceDatasetFetchTries() const
289 {
290 return m_faceDatasetFetchTries;
291 }
292
293 void
Ashlesh Gawande3909aa12017-07-28 16:01:35 -0500294 setFaceDatasetFetchInterval(uint32_t interval)
Nick Gordond5c1a372016-10-31 13:56:23 -0500295 {
Ashlesh Gawande3909aa12017-07-28 16:01:35 -0500296 m_faceDatasetFetchInterval = ndn::time::seconds(interval);
Nick Gordond5c1a372016-10-31 13:56:23 -0500297 }
298
299 const ndn::time::seconds
300 getFaceDatasetFetchInterval() const
301 {
302 return m_faceDatasetFetchInterval;
303 }
304
305 void
akmhoque157b0a42014-05-13 00:26:37 -0500306 setInterestRetryNumber(uint32_t irn)
akmhoque53353462014-04-22 08:43:45 -0500307 {
akmhoque157b0a42014-05-13 00:26:37 -0500308 m_interestRetryNumber = irn;
309 }
310
311 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700312 getInterestRetryNumber() const
akmhoque157b0a42014-05-13 00:26:37 -0500313 {
314 return m_interestRetryNumber;
315 }
316
317 void
alvy5a454952014-12-15 12:49:54 -0600318 setInterestResendTime(uint32_t irt)
akmhoque157b0a42014-05-13 00:26:37 -0500319 {
320 m_interestResendTime = irt;
akmhoque53353462014-04-22 08:43:45 -0500321 }
322
alvy5a454952014-12-15 12:49:54 -0600323 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700324 getInterestResendTime() const
akmhoque53353462014-04-22 08:43:45 -0500325 {
akmhoque157b0a42014-05-13 00:26:37 -0500326 return m_interestResendTime;
akmhoque53353462014-04-22 08:43:45 -0500327 }
328
alvy5a454952014-12-15 12:49:54 -0600329 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700330 getInfoInterestInterval() const
akmhoque53353462014-04-22 08:43:45 -0500331 {
akmhoque157b0a42014-05-13 00:26:37 -0500332 return m_infoInterestInterval;
akmhoque53353462014-04-22 08:43:45 -0500333 }
334
335 void
alvy5a454952014-12-15 12:49:54 -0600336 setInfoInterestInterval(uint32_t iii)
akmhoque53353462014-04-22 08:43:45 -0500337 {
akmhoque157b0a42014-05-13 00:26:37 -0500338 m_infoInterestInterval = iii;
339 }
340
341 void
342 setHyperbolicState(int32_t ihc)
343 {
344 m_hyperbolicState = ihc;
akmhoque53353462014-04-22 08:43:45 -0500345 }
346
akmhoquefdbddb12014-05-02 18:35:19 -0500347 int32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700348 getHyperbolicState() const
akmhoque53353462014-04-22 08:43:45 -0500349 {
akmhoque157b0a42014-05-13 00:26:37 -0500350 return m_hyperbolicState;
akmhoque53353462014-04-22 08:43:45 -0500351 }
352
akmhoque157b0a42014-05-13 00:26:37 -0500353 bool
akmhoque53353462014-04-22 08:43:45 -0500354 setCorR(double cr)
355 {
akmhoque157b0a42014-05-13 00:26:37 -0500356 if ( cr >= 0 ) {
357 m_corR = cr;
358 return true;
359 }
360 return false;
akmhoque53353462014-04-22 08:43:45 -0500361 }
362
363 double
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700364 getCorR() const
akmhoque53353462014-04-22 08:43:45 -0500365 {
366 return m_corR;
367 }
368
369 void
Muktadir R Chowdhuryb00dc2a2016-11-05 10:48:58 -0600370 setCorTheta(const std::vector<double>& ct)
akmhoque53353462014-04-22 08:43:45 -0500371 {
372 m_corTheta = ct;
373 }
374
Muktadir R Chowdhuryb00dc2a2016-11-05 10:48:58 -0600375 std::vector<double>
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700376 getCorTheta() const
akmhoque53353462014-04-22 08:43:45 -0500377 {
378 return m_corTheta;
379 }
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700380
akmhoque53353462014-04-22 08:43:45 -0500381 void
Vince Lehman942eb7b2014-10-02 10:09:27 -0500382 setMaxFacesPerPrefix(uint32_t mfpp)
akmhoque53353462014-04-22 08:43:45 -0500383 {
akmhoque157b0a42014-05-13 00:26:37 -0500384 m_maxFacesPerPrefix = mfpp;
akmhoque53353462014-04-22 08:43:45 -0500385 }
386
Vince Lehman942eb7b2014-10-02 10:09:27 -0500387 uint32_t
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700388 getMaxFacesPerPrefix() const
akmhoque53353462014-04-22 08:43:45 -0500389 {
akmhoque157b0a42014-05-13 00:26:37 -0500390 return m_maxFacesPerPrefix;
akmhoque53353462014-04-22 08:43:45 -0500391 }
392
393 void
dulalsaurab82a34c22019-02-04 17:31:21 +0000394 setStateFileDir(const std::string& ssfd)
akmhoque53353462014-04-22 08:43:45 -0500395 {
dulalsaurab82a34c22019-02-04 17:31:21 +0000396 m_stateFileDir = ssfd;
akmhoque53353462014-04-22 08:43:45 -0500397 }
398
akmhoque157b0a42014-05-13 00:26:37 -0500399 const std::string&
dulalsaurab82a34c22019-02-04 17:31:21 +0000400 getStateFileDir() const
akmhoque53353462014-04-22 08:43:45 -0500401 {
dulalsaurab82a34c22019-02-04 17:31:21 +0000402 return m_stateFileDir;
403 }
404
dulalsaurabd0816a32019-07-26 13:11:24 +0000405 void
406 setConfFileNameDynamic(const std::string& confFileDynamic)
dulalsaurab82a34c22019-02-04 17:31:21 +0000407 {
408 m_confFileNameDynamic = confFileDynamic;
409 }
410
411 const std::string&
412 getConfFileNameDynamic() const
413 {
414 return m_confFileNameDynamic;
akmhoque53353462014-04-22 08:43:45 -0500415 }
416
akmhoque674b0b12014-05-20 14:33:28 -0500417 void
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600418 setSyncInterestLifetime(uint32_t syncInterestLifetime)
419 {
420 m_syncInterestLifetime = ndn::time::milliseconds(syncInterestLifetime);
421 }
422
423 const ndn::time::milliseconds&
424 getSyncInterestLifetime() const
425 {
426 return m_syncInterestLifetime;
427 }
428
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600429 AdjacencyList&
430 getAdjacencyList()
431 {
432 return m_adjl;
433 }
434
435 NamePrefixList&
436 getNamePrefixList()
437 {
438 return m_npl;
439 }
440
441 ndn::security::ValidatorConfig&
442 getValidator()
443 {
444 return m_validator;
445 }
446
447 ndn::security::ValidatorConfig&
448 getPrefixUpdateValidator()
449 {
450 return m_prefixUpdateValidator;
451 }
452
Saurab Dulal427e0122019-11-28 11:58:02 -0600453 const ndn::security::SigningInfo&
454 getSigningInfo() const
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600455 {
Saurab Dulal427e0122019-11-28 11:58:02 -0600456 return m_signingInfo;
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600457 }
458
Saurab Dulal427e0122019-11-28 11:58:02 -0600459 void
460 addCertPath(const std::string& certPath)
461 {
462 m_certs.insert(certPath);
463 }
464
465 const std::unordered_set<std::string>&
466 getIdCerts() const
467 {
468 return m_certs;
469 }
470
471 const ndn::KeyChain&
472 getKeyChain() const
473 {
474 return m_keyChain;
475 }
476
Davide Pesaventoc1d0e8e2022-06-15 14:26:02 -0400477 std::optional<ndn::security::Certificate>
Saurab Dulal427e0122019-11-28 11:58:02 -0600478 initializeKey();
479
480 void
Alexander Afanasyev0ad01f32020-06-03 14:12:58 -0400481 loadCertToValidator(const ndn::security::Certificate& cert);
Saurab Dulal427e0122019-11-28 11:58:02 -0600482
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600483 /*! \brief Dump the current state of all attributes to the log.
484 */
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600485 void
akmhoque674b0b12014-05-20 14:33:28 -0500486 writeLog();
akmhoque53353462014-04-22 08:43:45 -0500487
Ashlesh Gawande328fc112019-12-12 17:06:44 -0600488PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600489 std::string m_confFileName;
Ashlesh Gawande328fc112019-12-12 17:06:44 -0600490 std::string m_confFileNameDynamic;
Davide Pesaventod90338d2021-01-07 17:50:05 -0500491
Ashlesh Gawande328fc112019-12-12 17:06:44 -0600492private:
akmhoque31d1d4b2014-05-05 22:08:14 -0500493 ndn::Name m_routerName;
494 ndn::Name m_siteName;
495 ndn::Name m_network;
akmhoque53353462014-04-22 08:43:45 -0500496
akmhoque31d1d4b2014-05-05 22:08:14 -0500497 ndn::Name m_routerPrefix;
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -0500498 ndn::Name m_syncUserPrefix;
akmhoque53353462014-04-22 08:43:45 -0500499
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600500 ndn::Name m_syncPrefix;
akmhoque157b0a42014-05-13 00:26:37 -0500501 ndn::Name m_lsaPrefix;
502
alvy5a454952014-12-15 12:49:54 -0600503 uint32_t m_lsaRefreshTime;
Vince Lehman7b616582014-10-17 16:25:39 -0500504
505 uint32_t m_adjLsaBuildInterval;
Vince Lehman7b616582014-10-17 16:25:39 -0500506 uint32_t m_routingCalcInterval;
507
Nick Gordond5c1a372016-10-31 13:56:23 -0500508 uint32_t m_faceDatasetFetchTries;
509 ndn::time::seconds m_faceDatasetFetchInterval;
510
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700511 ndn::time::seconds m_lsaInterestLifetime;
alvy5a454952014-12-15 12:49:54 -0600512 uint32_t m_routerDeadInterval;
akmhoque53353462014-04-22 08:43:45 -0500513
akmhoquefdbddb12014-05-02 18:35:19 -0500514 uint32_t m_interestRetryNumber;
alvy5a454952014-12-15 12:49:54 -0600515 uint32_t m_interestResendTime;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700516
alvy5a454952014-12-15 12:49:54 -0600517 uint32_t m_infoInterestInterval;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700518
akmhoque157b0a42014-05-13 00:26:37 -0500519 int32_t m_hyperbolicState;
akmhoque53353462014-04-22 08:43:45 -0500520 double m_corR;
Muktadir R Chowdhuryb00dc2a2016-11-05 10:48:58 -0600521 std::vector<double> m_corTheta;
akmhoque53353462014-04-22 08:43:45 -0500522
Vince Lehman942eb7b2014-10-02 10:09:27 -0500523 uint32_t m_maxFacesPerPrefix;
Alexander Afanasyev411ee4b2014-08-16 23:17:03 -0700524
dulalsaurab82a34c22019-02-04 17:31:21 +0000525 std::string m_stateFileDir;
526
Ashlesh Gawandef7da9c52018-02-06 17:36:46 -0600527 ndn::time::milliseconds m_syncInterestLifetime;
Ashlesh Gawande982a58f2018-02-14 17:39:12 -0600528
Davide Pesavento1954a0c2022-09-30 15:56:04 -0400529 SyncProtocol m_syncProtocol = SyncProtocol::PSYNC;
Ashlesh Gawande32ec3fd2018-07-18 13:42:32 -0500530
Ashlesh Gawande982a58f2018-02-14 17:39:12 -0600531PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Davide Pesaventoc1d0e8e2022-06-15 14:26:02 -0400532 // must be incremented when breaking changes are made to sync
533 static constexpr uint64_t SYNC_VERSION = 10;
Ashlesh Gawande85998a12017-12-07 22:22:13 -0600534
535 AdjacencyList m_adjl;
536 NamePrefixList m_npl;
537 ndn::security::ValidatorConfig m_validator;
538 ndn::security::ValidatorConfig m_prefixUpdateValidator;
Saurab Dulal427e0122019-11-28 11:58:02 -0600539 ndn::security::SigningInfo m_signingInfo;
540 std::unordered_set<std::string> m_certs;
541 ndn::KeyChain& m_keyChain;
akmhoque53353462014-04-22 08:43:45 -0500542};
543
akmhoque53353462014-04-22 08:43:45 -0500544} // namespace nlsr
545
dmcoomese689dd62017-03-29 11:05:12 -0500546#endif // NLSR_CONF_PARAMETER_HPP