22 #ifndef NLSR_CONF_PARAMETER_HPP
23 #define NLSR_CONF_PARAMETER_HPP
30 #include <ndn-cxx/face.hpp>
31 #include <ndn-cxx/security/validator-config.hpp>
32 #include <ndn-cxx/security/certificate-fetcher-direct-fetch.hpp>
133 const std::string& confFileName =
"nlsr.conf");
138 return m_confFileName;
153 m_routerName = routerName;
165 m_siteName = siteName;
177 m_routerPrefix = m_network;
178 m_routerPrefix.append(m_siteName);
179 m_routerPrefix.append(m_routerName);
181 m_syncUserPrefix = m_lsaPrefix;
182 m_syncUserPrefix.append(m_siteName);
183 m_syncUserPrefix.append(m_routerName);
189 return m_routerPrefix;
195 return m_syncUserPrefix;
213 m_lsaRefreshTime = lrt;
219 return m_syncProtocol;
225 m_syncProtocol = syncProtocol;
231 return m_lsaRefreshTime;
237 m_lsaInterestLifetime = lifetime;
240 const ndn::time::seconds&
243 return m_lsaInterestLifetime;
249 m_adjLsaBuildInterval = interval;
255 return m_adjLsaBuildInterval;
261 m_routingCalcInterval = interval;
267 return m_routingCalcInterval;
273 m_routerDeadInterval = rdt;
279 return m_routerDeadInterval;
285 m_faceDatasetFetchTries = count;
291 return m_faceDatasetFetchTries;
297 m_faceDatasetFetchInterval = ndn::time::seconds(interval);
300 const ndn::time::seconds
303 return m_faceDatasetFetchInterval;
309 m_interestRetryNumber = irn;
315 return m_interestRetryNumber;
321 m_interestResendTime = irt;
327 return m_interestResendTime;
333 return m_infoInterestInterval;
339 m_infoInterestInterval = iii;
345 m_hyperbolicState = ihc;
351 return m_hyperbolicState;
385 m_maxFacesPerPrefix = mfpp;
391 return m_maxFacesPerPrefix;
397 m_stateFileDir = ssfd;
403 return m_stateFileDir;
409 m_confFileNameDynamic = confFileDynamic;
415 return m_confFileNameDynamic;
421 m_syncInterestLifetime = ndn::time::milliseconds(syncInterestLifetime);
424 const ndn::time::milliseconds&
427 return m_syncInterestLifetime;
442 ndn::security::ValidatorConfig&
448 ndn::security::ValidatorConfig&
451 return m_prefixUpdateValidator;
454 const ndn::security::SigningInfo&
457 return m_signingInfo;
463 m_certs.insert(certPath);
466 const std::unordered_set<std::string>&
478 std::optional<ndn::security::Certificate>
490 std::string m_confFileName;
491 std::string m_confFileNameDynamic;
494 ndn::Name m_routerName;
495 ndn::Name m_siteName;
498 ndn::Name m_routerPrefix;
499 ndn::Name m_syncUserPrefix;
501 ndn::Name m_syncPrefix;
502 ndn::Name m_lsaPrefix;
504 uint32_t m_lsaRefreshTime;
506 uint32_t m_adjLsaBuildInterval;
507 uint32_t m_routingCalcInterval;
509 uint32_t m_faceDatasetFetchTries;
510 ndn::time::seconds m_faceDatasetFetchInterval;
512 ndn::time::seconds m_lsaInterestLifetime;
513 uint32_t m_routerDeadInterval;
515 uint32_t m_interestRetryNumber;
516 uint32_t m_interestResendTime;
518 uint32_t m_infoInterestInterval;
522 std::vector<double> m_corTheta;
524 uint32_t m_maxFacesPerPrefix;
526 std::string m_stateFileDir;
528 ndn::time::milliseconds m_syncInterestLifetime;
534 static constexpr uint64_t SYNC_VERSION = 12;
538 ndn::security::ValidatorConfig m_validator;
539 ndn::security::ValidatorConfig m_prefixUpdateValidator;
540 ndn::security::SigningInfo m_signingInfo;
541 std::unordered_set<std::string> m_certs;
542 ndn::KeyChain& m_keyChain;
A class to house all the configuration parameters for NLSR.
const ndn::security::SigningInfo & getSigningInfo() const
std::optional< ndn::security::Certificate > initializeKey()
void setHyperbolicState(HyperbolicState ihc)
void setRouterName(const ndn::Name &routerName)
const std::string & getConfFileNameDynamic() const
void setSiteName(const ndn::Name &siteName)
void setInterestRetryNumber(uint32_t irn)
void setMaxFacesPerPrefix(uint32_t mfpp)
uint32_t getInfoInterestInterval() const
void setRouterDeadInterval(uint32_t rdt)
uint32_t getRoutingCalcInterval() const
const std::string & getConfFileName()
std::vector< double > getCorTheta() const
const ndn::Name & getSyncUserPrefix() const
void writeLog()
Dump the current state of all attributes to the log.
const ndn::Name & getLsaPrefix() const
void setSyncProtocol(SyncProtocol syncProtocol)
const ndn::Name & getSiteName() const
const std::string & getStateFileDir() const
SyncProtocol getSyncProtocol() const
const std::unordered_set< std::string > & getIdCerts() const
void setStateFileDir(const std::string &ssfd)
void setLsaRefreshTime(uint32_t lrt)
void setInterestResendTime(uint32_t irt)
uint32_t getInterestRetryNumber() const
const ndn::Name & getNetwork() const
uint32_t getRouterDeadInterval() const
const ndn::Name & getRouterPrefix() const
const ndn::time::milliseconds & getSyncInterestLifetime() const
void loadCertToValidator(const ndn::security::Certificate &cert)
ConfParameter(ndn::Face &face, ndn::KeyChain &keyChain, const std::string &confFileName="nlsr.conf")
const ndn::time::seconds & getLsaInterestLifetime() const
const ndn::time::seconds getFaceDatasetFetchInterval() const
uint32_t getLsaRefreshTime() const
uint32_t getInterestResendTime() const
void setAdjLsaBuildInterval(uint32_t interval)
void setConfFileNameDynamic(const std::string &confFileDynamic)
const ndn::Name & getSyncPrefix() const
void setInfoInterestInterval(uint32_t iii)
NamePrefixList & getNamePrefixList()
void addCertPath(const std::string &certPath)
AdjacencyList & getAdjacencyList()
void setFaceDatasetFetchTries(uint32_t count)
ndn::security::ValidatorConfig & getValidator()
void setLsaInterestLifetime(const ndn::time::seconds &lifetime)
void setSyncInterestLifetime(uint32_t syncInterestLifetime)
void setCorTheta(const std::vector< double > &ct)
ndn::security::ValidatorConfig & getPrefixUpdateValidator()
void setFaceDatasetFetchInterval(uint32_t interval)
uint32_t getMaxFacesPerPrefix() const
const ndn::Name & getRouterName() const
const ndn::KeyChain & getKeyChain() const
HyperbolicState getHyperbolicState() const
void setNetwork(const ndn::Name &networkName)
void buildRouterAndSyncUserPrefix()
uint32_t getFaceDatasetFetchTries() const
uint32_t getAdjLsaBuildInterval() const
void setRoutingCalcInterval(uint32_t interval)
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
@ FACE_DATASET_FETCH_TRIES_DEFAULT
@ FACE_DATASET_FETCH_TRIES_MIN
@ FACE_DATASET_FETCH_TRIES_MAX
@ LSA_REFRESH_TIME_DEFAULT
@ ROUTING_CALC_INTERVAL_DEFAULT
@ ROUTING_CALC_INTERVAL_MIN
@ ROUTING_CALC_INTERVAL_MAX
@ MAX_FACES_PER_PREFIX_MIN
@ MAX_FACES_PER_PREFIX_DEFAULT
@ MAX_FACES_PER_PREFIX_MAX
@ FACE_DATASET_FETCH_INTERVAL_DEFAULT
@ FACE_DATASET_FETCH_INTERVAL_MIN
@ FACE_DATASET_FETCH_INTERVAL_MAX
@ ADJ_LSA_BUILD_INTERVAL_DEFAULT
@ ADJ_LSA_BUILD_INTERVAL_MIN
@ ADJ_LSA_BUILD_INTERVAL_MAX
@ HYPERBOLIC_STATE_DRY_RUN
@ HYPERBOLIC_STATE_DEFAULT
@ LSA_INTEREST_LIFETIME_MAX
@ LSA_INTEREST_LIFETIME_DEFAULT
@ LSA_INTEREST_LIFETIME_MIN
@ SYNC_INTEREST_LIFETIME_MIN
@ SYNC_INTEREST_LIFETIME_MAX
@ SYNC_INTEREST_LIFETIME_DEFAULT
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE