36 : m_hyperbolicState(hypState)
38 setSeqFileDirectory(filePath);
39 initiateSeqNoFromFile();
46 std::ofstream outputFile(m_seqFileNameWithPath.c_str());
47 std::ostringstream os;
48 os <<
"NameLsaSeq " << std::to_string(m_nameLsaSeq) <<
"\n"
49 <<
"AdjLsaSeq " << std::to_string(m_adjLsaSeq) <<
"\n"
50 <<
"CorLsaSeq " << std::to_string(m_corLsaSeq);
51 outputFile << os.str();
56 SequencingManager::initiateSeqNoFromFile()
59 std::ifstream inputFile(m_seqFileNameWithPath.c_str());
63 if (inputFile.good()) {
64 inputFile >> seqType >> m_nameLsaSeq;
65 inputFile >> seqType >> m_adjLsaSeq;
66 inputFile >> seqType >> m_corLsaSeq;
76 if (m_corLsaSeq != 0) {
77 NLSR_LOG_WARN(
"This router was previously configured for hyperbolic " <<
78 "routing without clearing the seq. no. file.");
86 if (m_adjLsaSeq != 0) {
87 NLSR_LOG_WARN(
"This router was previously configured for link-state " <<
88 "routing without clearing the seq. no. file.");
98 SequencingManager::setSeqFileDirectory(
const std::string& filePath)
100 m_seqFileNameWithPath = filePath;
102 if (m_seqFileNameWithPath.empty()) {
103 std::string homeDirPath(getpwuid(getuid())->pw_dir);
104 if (homeDirPath.empty()) {
105 homeDirPath = getenv(
"HOME");
107 m_seqFileNameWithPath = homeDirPath;
109 m_seqFileNameWithPath = m_seqFileNameWithPath +
"/nlsrSeqNo.txt";
113 SequencingManager::writeLog()
const
SequencingManager(const std::string &filePath, int hypState)
void writeSeqNoToFile() const
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
#define NLSR_LOG_DEBUG(x)
#define INIT_LOGGER(name)
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
@ HYPERBOLIC_STATE_DRY_RUN