akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
dmcoomes | cf8d0ed | 2017-02-21 11:39:01 -0600 | [diff] [blame] | 3 | * Copyright (c) 2014-2018, The University of Memphis, |
Nick Gordon | f8b5bcd | 2016-08-11 15:06:50 -0500 | [diff] [blame] | 4 | * Regents of the University of California |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 5 | * |
| 6 | * This file is part of NLSR (Named-data Link State Routing). |
| 7 | * See AUTHORS.md for complete list of NLSR authors and contributors. |
| 8 | * |
| 9 | * NLSR is free software: you can redistribute it and/or modify it under the terms |
| 10 | * of the GNU General Public License as published by the Free Software Foundation, |
| 11 | * either version 3 of the License, or (at your option) any later version. |
| 12 | * |
| 13 | * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 14 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along with |
| 18 | * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 19 | * |
| 20 | * \author A K M Mahmudul Hoque <ahoque1@memphis.edu> |
| 21 | * |
| 22 | **/ |
Muktadir R Chowdhury | bfa2760 | 2014-10-31 10:57:41 -0500 | [diff] [blame] | 23 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 24 | #include "conf-parameter.hpp" |
| 25 | #include "logger.hpp" |
| 26 | |
| 27 | namespace nlsr { |
| 28 | |
dmcoomes | cf8d0ed | 2017-02-21 11:39:01 -0600 | [diff] [blame] | 29 | INIT_LOGGER(ConfParameter); |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 30 | |
Ashlesh Gawande | 982a58f | 2018-02-14 17:39:12 -0600 | [diff] [blame] | 31 | // To be changed when breaking changes are made to sync |
| 32 | const uint64_t ConfParameter::SYNC_VERSION = 4; |
| 33 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 34 | void |
| 35 | ConfParameter::writeLog() |
| 36 | { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 37 | NLSR_LOG_INFO("Router Name: " << m_routerName); |
| 38 | NLSR_LOG_INFO("Site Name: " << m_siteName); |
| 39 | NLSR_LOG_INFO("Network: " << m_network); |
| 40 | NLSR_LOG_INFO("Router Prefix: " << m_routerPrefix); |
| 41 | NLSR_LOG_INFO("ChronoSync sync Prefix: " << m_chronosyncPrefix); |
| 42 | NLSR_LOG_INFO("ChronoSync LSA prefix: " << m_lsaPrefix); |
| 43 | NLSR_LOG_INFO("Hello Interest retry number: " << m_interestRetryNumber); |
| 44 | NLSR_LOG_INFO("Hello Interest resend second: " << m_interestResendTime); |
| 45 | NLSR_LOG_INFO("Info Interest interval: " << m_infoInterestInterval); |
| 46 | NLSR_LOG_INFO("LSA refresh time: " << m_lsaRefreshTime); |
| 47 | NLSR_LOG_INFO("FIB Entry refresh time: " << m_lsaRefreshTime * 2); |
| 48 | NLSR_LOG_INFO("LSA Interest lifetime: " << getLsaInterestLifetime()); |
| 49 | NLSR_LOG_INFO("Router dead interval: " << getRouterDeadInterval()); |
| 50 | NLSR_LOG_INFO("Max Faces Per Prefix: " << m_maxFacesPerPrefix); |
| 51 | NLSR_LOG_INFO("Hyperbolic Routing: " << m_hyperbolicState); |
| 52 | NLSR_LOG_INFO("Hyp R: " << m_corR); |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 53 | int i=0; |
| 54 | for (auto const& value: m_corTheta) { |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 55 | NLSR_LOG_INFO("Hyp Angle " << i++ << ": "<< value); |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 56 | } |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 57 | NLSR_LOG_INFO("Seq Directory: " << m_seqFileDir); |
Vince Lehman | 7b61658 | 2014-10-17 16:25:39 -0500 | [diff] [blame] | 58 | |
| 59 | // Event Intervals |
dmcoomes | 5bcb39e | 2017-10-31 15:07:55 -0500 | [diff] [blame] | 60 | NLSR_LOG_INFO("Adjacency LSA build interval: " << m_adjLsaBuildInterval); |
| 61 | NLSR_LOG_INFO("First Hello Interest interval: " << m_firstHelloInterval); |
| 62 | NLSR_LOG_INFO("Routing calculation interval: " << m_routingCalcInterval); |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 63 | } |
| 64 | |
Ashlesh Gawande | 982a58f | 2018-02-14 17:39:12 -0600 | [diff] [blame] | 65 | void |
| 66 | ConfParameter::setNetwork(const ndn::Name& networkName) |
| 67 | { |
| 68 | m_network = networkName; |
| 69 | |
| 70 | m_chronosyncPrefix.append("localhop"); |
| 71 | m_chronosyncPrefix.append(m_network); |
| 72 | m_chronosyncPrefix.append("NLSR"); |
| 73 | m_chronosyncPrefix.append("sync"); |
| 74 | m_chronosyncPrefix.appendVersion(SYNC_VERSION); |
| 75 | |
| 76 | m_lsaPrefix.append("localhop"); |
| 77 | m_lsaPrefix.append(m_network); |
| 78 | m_lsaPrefix.append("NLSR"); |
| 79 | m_lsaPrefix.append("LSA"); |
| 80 | } |
| 81 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 82 | } // namespace nlsr |