22 #ifndef NLSR_CONF_PARAMETER_HPP 23 #define NLSR_CONF_PARAMETER_HPP 31 #include <boost/cstdint.hpp> 32 #include <ndn-cxx/face.hpp> 33 #include <ndn-cxx/security/validator-config.hpp> 34 #include <ndn-cxx/security/v2/certificate-fetcher-direct-fetch.hpp> 35 #include <ndn-cxx/util/time.hpp> 134 const std::string& confFileName =
"nlsr.conf");
139 return m_confFileName;
154 m_routerName = routerName;
166 m_siteName = siteName;
178 m_routerPrefix = m_network;
179 m_routerPrefix.append(m_siteName);
180 m_routerPrefix.append(m_routerName);
182 m_syncUserPrefix = m_lsaPrefix;
183 m_syncUserPrefix.append(m_siteName);
184 m_syncUserPrefix.append(m_routerName);
190 return m_routerPrefix;
196 return m_syncUserPrefix;
214 m_lsaRefreshTime = lrt;
220 return m_syncProtocol;
227 m_syncProtocol = syncProtocol;
234 return m_lsaRefreshTime;
240 m_lsaInterestLifetime = lifetime;
243 const ndn::time::seconds&
246 return m_lsaInterestLifetime;
252 m_adjLsaBuildInterval = interval;
258 return m_adjLsaBuildInterval;
264 m_routingCalcInterval = interval;
270 return m_routingCalcInterval;
276 m_routerDeadInterval = rdt;
282 return m_routerDeadInterval;
288 m_faceDatasetFetchTries = count;
294 return m_faceDatasetFetchTries;
300 m_faceDatasetFetchInterval = ndn::time::seconds(interval);
303 const ndn::time::seconds
306 return m_faceDatasetFetchInterval;
312 m_interestRetryNumber = irn;
318 return m_interestRetryNumber;
324 m_interestResendTime = irt;
330 return m_interestResendTime;
336 return m_infoInterestInterval;
342 m_infoInterestInterval = iii;
348 m_hyperbolicState = ihc;
354 return m_hyperbolicState;
388 m_maxFacesPerPrefix = mfpp;
394 return m_maxFacesPerPrefix;
400 m_stateFileDir = ssfd;
406 return m_stateFileDir;
412 m_confFileNameDynamic = confFileDynamic;
418 return m_confFileNameDynamic;
424 m_syncInterestLifetime = ndn::time::milliseconds(syncInterestLifetime);
427 const ndn::time::milliseconds&
430 return m_syncInterestLifetime;
445 ndn::security::ValidatorConfig&
451 ndn::security::ValidatorConfig&
454 return m_prefixUpdateValidator;
457 const ndn::security::SigningInfo&
460 return m_signingInfo;
466 m_certs.insert(certPath);
469 const std::unordered_set<std::string>&
481 shared_ptr<ndn::security::v2::Certificate>
493 std::string m_confFileName;
494 std::string m_confFileNameDynamic;
496 ndn::Name m_routerName;
497 ndn::Name m_siteName;
500 ndn::Name m_routerPrefix;
501 ndn::Name m_syncUserPrefix;
503 ndn::Name m_syncPrefix;
504 ndn::Name m_lsaPrefix;
506 uint32_t m_lsaRefreshTime;
508 uint32_t m_adjLsaBuildInterval;
509 uint32_t m_routingCalcInterval;
511 uint32_t m_faceDatasetFetchTries;
512 ndn::time::seconds m_faceDatasetFetchInterval;
514 ndn::time::seconds m_lsaInterestLifetime;
515 uint32_t m_routerDeadInterval;
517 uint32_t m_interestRetryNumber;
518 uint32_t m_interestResendTime;
520 uint32_t m_infoInterestInterval;
522 int32_t m_hyperbolicState;
524 std::vector<double> m_corTheta;
526 uint32_t m_maxFacesPerPrefix;
528 std::string m_stateFileDir;
530 ndn::time::milliseconds m_syncInterestLifetime;
532 int32_t m_syncProtocol;
535 static const uint64_t SYNC_VERSION;
539 ndn::security::ValidatorConfig m_validator;
540 ndn::security::ValidatorConfig m_prefixUpdateValidator;
541 ndn::security::SigningInfo m_signingInfo;
542 std::unordered_set<std::string> m_certs;
543 ndn::KeyChain& m_keyChain;
548 #endif // NLSR_CONF_PARAMETER_HPP
ndn::security::ValidatorConfig & getValidator()
A class to house all the configuration parameters for NLSR.
void buildRouterAndSyncUserPrefix()
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
uint32_t getAdjLsaBuildInterval() const
uint32_t getLsaRefreshTime() const
const std::string & getStateFileDir() const
void setLsaInterestLifetime(const ndn::time::seconds &lifetime)
void setStateFileDir(const std::string &ssfd)
void setMaxFacesPerPrefix(uint32_t mfpp)
const std::string & getConfFileName()
void setRoutingCalcInterval(uint32_t interval)
void setNetwork(const ndn::Name &networkName)
const ndn::security::SigningInfo & getSigningInfo() const
AdjacencyList & getAdjacencyList()
void setAdjLsaBuildInterval(uint32_t interval)
void setSiteName(const ndn::Name &siteName)
ndn::security::ValidatorConfig & getPrefixUpdateValidator()
const ndn::Name & getSyncUserPrefix() const
const ndn::Name & getRouterPrefix() const
void setInterestResendTime(uint32_t irt)
void setInfoInterestInterval(uint32_t iii)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
uint32_t getSyncProtocol() const
const ndn::time::seconds & getLsaInterestLifetime() const
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
void setCorTheta(const std::vector< double > &ct)
uint32_t getInterestRetryNumber() const
void setSyncInterestLifetime(uint32_t syncInterestLifetime)
const ndn::Name & getRouterName() const
shared_ptr< ndn::security::v2::Certificate > initializeKey()
void setSyncProtocol(int32_t syncProtocol)
const ndn::Name & getSiteName() const
uint32_t getFaceDatasetFetchTries() const
uint32_t getRoutingCalcInterval() const
void setRouterName(const ndn::Name &routerName)
void setFaceDatasetFetchInterval(uint32_t interval)
void setInterestRetryNumber(uint32_t irn)
const ndn::Name & getSyncPrefix() const
uint32_t getMaxFacesPerPrefix() const
const ndn::KeyChain & getKeyChain() const
const ndn::Name & getNetwork() const
int32_t getHyperbolicState() const
void addCertPath(const std::string &certPath)
Copyright (c) 2014-2019, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void setConfFileNameDynamic(const std::string &confFileDynamic)
void setRouterDeadInterval(uint32_t rdt)
NamePrefixList & getNamePrefixList()
void loadCertToValidator(const ndn::security::v2::Certificate &cert)
void setLsaRefreshTime(uint32_t lrt)
const std::string & getConfFileNameDynamic() const
const std::unordered_set< std::string > & getIdCerts() const
void setHyperbolicState(int32_t ihc)
void setFaceDatasetFetchTries(uint32_t count)
const ndn::time::seconds getFaceDatasetFetchInterval() const
const ndn::time::milliseconds & getSyncInterestLifetime() const
const ndn::Name & getLsaPrefix() const
ConfParameter(ndn::Face &face, ndn::KeyChain &keyChain, const std::string &confFileName="nlsr.conf")
uint32_t getRouterDeadInterval() const
uint32_t getInterestResendTime() const
std::vector< double > getCorTheta() const
uint32_t getInfoInterestInterval() const
void writeLog()
Dump the current state of all attributes to the log.