From e98480b5d1eb37efdf97b9b4a72b4c4ae7b33100 Mon Sep 17 00:00:00 2001 From: Nick Gordon Date: Wed, 24 May 2017 11:23:03 -0500 Subject: [PATCH] nlsr: removed references to ndn-cxx/common aliases and improved namespacing Change-Id: I65e4691305b0157f334fc68d96998c119ef8b03b refs: #3406 --- src/adjacency-list.cpp | 2 - src/adjacency-list.hpp | 2 +- src/communication/sync-logic-handler.cpp | 10 ++-- src/conf-file-processor.cpp | 50 ++++++++----------- src/conf-file-processor.hpp | 7 +-- src/conf-parameter.hpp | 2 +- src/lsa.cpp | 8 ++- src/lsdb.cpp | 9 ++-- src/lsdb.hpp | 23 +++++---- src/name-prefix-list.cpp | 5 -- src/nlsr.cpp | 11 ++-- src/route/fib-entry.cpp | 2 - src/route/fib.cpp | 3 -- src/route/map.cpp | 3 -- src/route/nexthop-list.cpp | 5 +- src/route/routing-table-calculator.cpp | 12 ++--- src/route/routing-table.cpp | 5 +- src/sequencing-manager.cpp | 12 ++--- tests/test-adjacency-list.cpp | 3 +- tests/test-lsdb.cpp | 4 +- tests/update/test-prefix-update-processor.cpp | 2 +- 21 files changed, 73 insertions(+), 107 deletions(-) diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp index b82346f..f2a8302 100644 --- a/src/adjacency-list.cpp +++ b/src/adjacency-list.cpp @@ -31,8 +31,6 @@ namespace nlsr { INIT_LOGGER("AdjacencyList"); -using namespace std; - AdjacencyList::AdjacencyList() { } diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp index c21e70b..66a2710 100644 --- a/src/adjacency-list.hpp +++ b/src/adjacency-list.hpp @@ -23,10 +23,10 @@ #define NLSR_ADJACENCY_LIST_HPP #include "adjacent.hpp" +#include "common.hpp" #include #include -#include namespace nlsr { diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp index c43a070..5a4d709 100644 --- a/src/communication/sync-logic-handler.cpp +++ b/src/communication/sync-logic-handler.cpp @@ -32,9 +32,6 @@ namespace nlsr { INIT_LOGGER("SyncLogicHandler"); -using namespace ndn; -using namespace std; - const std::string NLSR_COMPONENT = "NLSR"; const std::string LSA_COMPONENT = "LSA"; @@ -75,9 +72,8 @@ SyncLogicHandler::createSyncSocket(const ndn::Name& syncPrefix) // of the object std::shared_ptr facePtr(&m_syncFace, NullDeleter()); - m_syncSocket = std::make_shared(m_syncPrefix, m_nameLsaUserPrefix, *facePtr, - bind(&SyncLogicHandler::onChronoSyncUpdate, this, _1)); + std::bind(&SyncLogicHandler::onChronoSyncUpdate, this, _1)); if (m_confParam.getHyperbolicState() == HYPERBOLIC_STATE_OFF) { m_syncSocket->addSyncNode(m_adjLsaUserPrefix); @@ -88,7 +84,7 @@ SyncLogicHandler::createSyncSocket(const ndn::Name& syncPrefix) } void -SyncLogicHandler::onChronoSyncUpdate(const vector& v) +SyncLogicHandler::onChronoSyncUpdate(const std::vector& v) { _LOG_DEBUG("Received ChronoSync update event"); @@ -224,7 +220,7 @@ SyncLogicHandler::publishSyncUpdate(const ndn::Name& updatePrefix, uint64_t seqN _LOG_DEBUG("Publishing Sync Update. Prefix: " << updatePrefix << " Seq No: " << seqNo); ndn::Name updateName(updatePrefix); - string data("NoData"); + std::string data("NoData"); m_syncSocket->publishData(reinterpret_cast(data.c_str()), data.size(), ndn::time::milliseconds(1000), seqNo, updateName); diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp index e48158c..8359d37 100644 --- a/src/conf-file-processor.cpp +++ b/src/conf-file-processor.cpp @@ -25,22 +25,16 @@ #include "utility/name-helper.hpp" #include "update/prefix-update-processor.hpp" -#include -#include +#include #include #include -// boost needs to be included after ndn-cxx, otherwise there will be conflict with _1, _2, ... -#include -#include -#include -#include +#include +#include namespace nlsr { -using namespace std; - template class ConfigurationVariable { @@ -144,12 +138,12 @@ bool ConfFileProcessor::processConfFile() { bool ret = true; - ifstream inputFile; + std::ifstream inputFile; inputFile.open(m_confFileName.c_str()); if (!inputFile.is_open()) { - string msg = "Failed to read configuration file: "; + std::string msg = "Failed to read configuration file: "; msg += m_confFileName; - cerr << msg << endl; + std::cerr << msg << std::endl; return false; } ret = load(inputFile); @@ -158,7 +152,7 @@ ConfFileProcessor::processConfFile() } bool -ConfFileProcessor::load(istream& input) +ConfFileProcessor::load(std::istream& input) { ConfigSection pt; bool ret = true; @@ -166,7 +160,7 @@ ConfFileProcessor::load(istream& input) boost::property_tree::read_info(input, pt); } catch (const boost::property_tree::info_parser_error& error) { - stringstream msg; + std::stringstream msg; std::cerr << "Failed to parse configuration file " << std::endl; std::cerr << m_confFileName << std::endl; return false; @@ -221,15 +215,15 @@ bool ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) { try { - std::string network = section.get("network"); - std::string site = section.get("site"); - std::string router = section.get("router"); + std::string network = section.get("network"); + std::string site = section.get("site"); + std::string router = section.get("router"); ndn::Name networkName(network); if (!networkName.empty()) { m_nlsr.getConfParameter().setNetwork(networkName); } else { - cerr << " Network can not be null or empty or in bad URI format :(!" << endl; + std::cerr << " Network can not be null or empty or in bad URI format :(!" << std::endl; return false; } ndn::Name siteName(site); @@ -237,7 +231,7 @@ ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) m_nlsr.getConfParameter().setSiteName(siteName); } else { - cerr << "Site can not be null or empty or in bad URI format:( !" << endl; + std::cerr << "Site can not be null or empty or in bad URI format:( !" << std::endl; return false; } ndn::Name routerName(router); @@ -245,12 +239,12 @@ ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) m_nlsr.getConfParameter().setRouterName(routerName); } else { - cerr << " Router name can not be null or empty or in bad URI format:( !" << endl; + std::cerr << " Router name can not be null or empty or in bad URI format:( !" << std::endl; return false; } } catch (const std::exception& ex) { - cerr << ex.what() << endl; + std::cerr << ex.what() << std::endl; return false; } @@ -294,7 +288,7 @@ ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) } // log-level - std::string logLevel = section.get("log-level", "INFO"); + std::string logLevel = section.get("log-level", "INFO"); if (isValidLogLevel(logLevel)) { m_nlsr.getConfParameter().setLogLevel(logLevel); @@ -306,11 +300,11 @@ ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) } try { - std::string logDir = section.get("log-dir"); + std::string logDir = section.get("log-dir"); if (boost::filesystem::exists(logDir)) { if (boost::filesystem::is_directory(logDir)) { std::string testFileName=logDir+"/test.log"; - ofstream testOutFile; + std::ofstream testOutFile; testOutFile.open(testFileName.c_str()); if (testOutFile.is_open() && testOutFile.good()) { m_nlsr.getConfParameter().setLogDir(logDir); @@ -340,11 +334,11 @@ ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) } try { - std::string seqDir = section.get("seq-dir"); + std::string seqDir = section.get("seq-dir"); if (boost::filesystem::exists(seqDir)) { if (boost::filesystem::is_directory(seqDir)) { std::string testFileName=seqDir+"/test.seq"; - ofstream testOutFile; + std::ofstream testOutFile; testOutFile.open(testFileName.c_str()); if (testOutFile.is_open() && testOutFile.good()) { m_nlsr.getConfParameter().setSeqFileDir(seqDir); @@ -374,7 +368,7 @@ ConfFileProcessor::processConfSectionGeneral(const ConfigSection& section) } try { - std::string log4cxxPath = section.get("log4cxx-conf"); + std::string log4cxxPath = section.get("log4cxx-conf"); if (log4cxxPath == "") { std::cerr << "No value provided for log4cxx-conf" << std::endl; @@ -533,7 +527,7 @@ bool ConfFileProcessor::processConfSectionHyperbolic(const ConfigSection& section) { // state - std::string state = section.get("state", "off"); + std::string state = section.get("state", "off"); if (boost::iequals(state, "off")) { m_nlsr.getConfParameter().setHyperbolicState(HYPERBOLIC_STATE_OFF); diff --git a/src/conf-file-processor.hpp b/src/conf-file-processor.hpp index 1f0918a..d3e91c9 100644 --- a/src/conf-file-processor.hpp +++ b/src/conf-file-processor.hpp @@ -21,11 +21,12 @@ #ifndef NLSR_CONF_FILE_PROCESSOR_HPP #define NLSR_CONF_FILE_PROCESSOR_HPP +#include "common.hpp" #include "nlsr.hpp" -#include -#include -#include +#include +#include +#include namespace nlsr { diff --git a/src/conf-parameter.hpp b/src/conf-parameter.hpp index 29f9f9c..00aa06a 100644 --- a/src/conf-parameter.hpp +++ b/src/conf-parameter.hpp @@ -22,11 +22,11 @@ #ifndef NLSR_CONF_PARAMETER_HPP #define NLSR_CONF_PARAMETER_HPP +#include "common.hpp" #include "logger.hpp" #include #include -#include #include #include diff --git a/src/lsa.cpp b/src/lsa.cpp index 7ecad7a..440c2ba 100644 --- a/src/lsa.cpp +++ b/src/lsa.cpp @@ -38,8 +38,6 @@ namespace nlsr { INIT_LOGGER("Lsa"); -using namespace std; - const std::string NameLsa::TYPE_STRING = "name"; const std::string AdjLsa::TYPE_STRING = "adjacency"; const std::string CoordinateLsa::TYPE_STRING = "coordinate"; @@ -65,7 +63,7 @@ NameLsa::NameLsa(const ndn::Name& origR, uint32_t lsn, } } -string +std::string NameLsa::getData() { std::ostringstream os; @@ -172,7 +170,7 @@ CoordinateLsa::isEqualContent(const CoordinateLsa& clsa) std::numeric_limits::epsilon()); } -string +std::string CoordinateLsa::getData() { std::ostringstream os; @@ -266,7 +264,7 @@ AdjLsa::isEqualContent(AdjLsa& alsa) return m_adl == alsa.getAdl(); } -string +std::string AdjLsa::getData() { std::ostringstream os; diff --git a/src/lsdb.cpp b/src/lsdb.cpp index 5cfc783..3fed788 100644 --- a/src/lsdb.cpp +++ b/src/lsdb.cpp @@ -59,7 +59,8 @@ private: const ndn::Name::Component Lsdb::NAME_COMPONENT = ndn::Name::Component("lsdb"); const ndn::time::seconds Lsdb::GRACE_PERIOD = ndn::time::seconds(10); -const steady_clock::TimePoint Lsdb::DEFAULT_LSA_RETRIEVAL_DEADLINE = steady_clock::TimePoint::min(); +const ndn::time::steady_clock::TimePoint Lsdb::DEFAULT_LSA_RETRIEVAL_DEADLINE = + ndn::time::steady_clock::TimePoint::min(); Lsdb::Lsdb(Nlsr& nlsr, ndn::Scheduler& scheduler) : m_nlsr(nlsr) @@ -800,7 +801,7 @@ Lsdb::getAdjLsdb() } void -Lsdb::setLsaRefreshTime(const seconds& lsaRefreshTime) +Lsdb::setLsaRefreshTime(const ndn::time::seconds& lsaRefreshTime) { m_lsaRefreshTime = lsaRefreshTime; } @@ -957,13 +958,13 @@ Lsdb::expireOrRefreshCoordinateLsa(const ndn::Name& lsaKey, void Lsdb::expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, - steady_clock::TimePoint deadline) + ndn::time::steady_clock::TimePoint deadline) { // increment SENT_LSA_INTEREST lsaIncrementSignal(Statistics::PacketType::SENT_LSA_INTEREST); if (deadline == DEFAULT_LSA_RETRIEVAL_DEADLINE) { - deadline = steady_clock::now() + ndn::time::seconds(static_cast(LSA_REFRESH_TIME_MAX)); + deadline = ndn::time::steady_clock::now() + ndn::time::seconds(static_cast(LSA_REFRESH_TIME_MAX)); } // The first component of the interest is the name. ndn::Name lsaName = interestName.getSubName(0, interestName.size()-1); diff --git a/src/lsdb.hpp b/src/lsdb.hpp index bb0b9d8..8d01155 100644 --- a/src/lsdb.hpp +++ b/src/lsdb.hpp @@ -42,9 +42,12 @@ #include #include -namespace nlsr { +#include +#include +#include +#include -using namespace ndn::time; +namespace nlsr { class Nlsr; @@ -206,14 +209,14 @@ public: writeAdjLsdbLog(); void - setLsaRefreshTime(const seconds& lsaRefreshTime); + setLsaRefreshTime(const ndn::time::seconds& lsaRefreshTime); void setThisRouterPrefix(std::string trp); void expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, - steady_clock::TimePoint deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE); + ndn::time::steady_clock::TimePoint deadline = DEFAULT_LSA_RETRIEVAL_DEADLINE); void processInterest(const ndn::Name& name, const ndn::Interest& interest); @@ -272,7 +275,7 @@ private: */ ndn::EventId scheduleNameLsaExpiration(const ndn::Name& key, int seqNo, - const seconds& expTime); + const ndn::time::seconds& expTime); /*! \brief Either allow to expire, or refresh a name LSA. \param lsaKey The name of the router that published the LSA. @@ -289,7 +292,7 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE: */ ndn::EventId scheduleAdjLsaExpiration(const ndn::Name& key, int seqNo, - const seconds& expTime); + const ndn::time::seconds& expTime); private: @@ -298,7 +301,7 @@ private: ndn::EventId scheduleCoordinateLsaExpiration(const ndn::Name& key, int seqNo, - const seconds& expTime); + const ndn::time::seconds& expTime); void expireOrRefreshCoordinateLsa(const ndn::Name& lsaKey, @@ -372,7 +375,7 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE: afterFetchLsa(const ndn::ConstBufferPtr& data, ndn::Name& interestName); private: - system_clock::TimePoint + ndn::time::system_clock::TimePoint getLsaExpirationTimePoint(); /*! \brief Cancels an event in the event scheduler. */ @@ -393,7 +396,7 @@ private: std::list m_adjLsdb; std::list m_corLsdb; - seconds m_lsaRefreshTime; + ndn::time::seconds m_lsaRefreshTime; std::string m_thisRouterPrefix; typedef std::map SequenceNumberMap; @@ -403,7 +406,7 @@ private: SequenceNumberMap m_highestSeqNo; static const ndn::time::seconds GRACE_PERIOD; - static const steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE; + static const ndn::time::steady_clock::TimePoint DEFAULT_LSA_RETRIEVAL_DEADLINE; ndn::time::seconds m_adjLsaBuildInterval; diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp index 742367b..7df0eef 100644 --- a/src/name-prefix-list.cpp +++ b/src/name-prefix-list.cpp @@ -20,21 +20,16 @@ **/ #include "name-prefix-list.hpp" - #include "common.hpp" #include "logger.hpp" #include #include -#include - namespace nlsr { INIT_LOGGER("NamePrefixList"); -using namespace std; - NamePrefixList::NamePrefixList() { } diff --git a/src/nlsr.cpp b/src/nlsr.cpp index 70648e3..32bda23 100644 --- a/src/nlsr.cpp +++ b/src/nlsr.cpp @@ -37,9 +37,6 @@ INIT_LOGGER("nlsr"); const ndn::Name Nlsr::LOCALHOST_PREFIX = ndn::Name("/localhost/nlsr"); -using namespace ndn; -using namespace std; - Nlsr::Nlsr(boost::asio::io_service& ioService, ndn::Scheduler& scheduler, ndn::Face& face, ndn::KeyChain& keyChain) : m_nlsrFace(face) , m_scheduler(scheduler) @@ -303,13 +300,13 @@ Nlsr::initializeKey() std::shared_ptr certificate = std::make_shared(); std::shared_ptr pubKey = m_keyChain.getPublicKey(keyName); - Name certificateName = keyName.getPrefix(-1); + ndn::Name certificateName = keyName.getPrefix(-1); certificateName.append("KEY").append(keyName.get(-1)).append("ID-CERT").appendVersion(); certificate->setName(certificateName); - certificate->setNotBefore(time::system_clock::now() - time::days(1)); - certificate->setNotAfter(time::system_clock::now() + time::days(7300)); // ~20 years + certificate->setNotBefore(ndn::time::system_clock::now() - ndn::time::days(1)); + certificate->setNotAfter(ndn::time::system_clock::now() + ndn::time::days(7300)); // ~20 years certificate->setPublicKeyInfo(*pubKey); - certificate->addSubjectDescription(CertificateSubjectDescription(ndn::oid::ATTRIBUTE_NAME, + certificate->addSubjectDescription(ndn::CertificateSubjectDescription(ndn::oid::ATTRIBUTE_NAME, keyName.toUri())); certificate->encode(); m_keyChain.signByIdentity(*certificate, m_confParam.getRouterPrefix()); diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp index ccbb887..91eb422 100644 --- a/src/route/fib-entry.cpp +++ b/src/route/fib-entry.cpp @@ -25,8 +25,6 @@ namespace nlsr { INIT_LOGGER("FibEntry"); -using namespace std; - void FibEntry::writeLog() { diff --git a/src/route/fib.cpp b/src/route/fib.cpp index de73310..592b2bd 100644 --- a/src/route/fib.cpp +++ b/src/route/fib.cpp @@ -35,9 +35,6 @@ INIT_LOGGER("Fib"); const uint64_t Fib::GRACE_PERIOD = 10; -using namespace std; -using namespace ndn; - void Fib::remove(const ndn::Name& name) { diff --git a/src/route/map.cpp b/src/route/map.cpp index 544976e..5596a05 100644 --- a/src/route/map.cpp +++ b/src/route/map.cpp @@ -23,7 +23,6 @@ #include "adjacent.hpp" #include "lsa.hpp" #include "lsdb.hpp" - #include "logger.hpp" #include @@ -33,8 +32,6 @@ namespace nlsr { INIT_LOGGER("Map"); -using namespace std; - static bool mapEntryCompareByRouter(MapEntry& mpe1, const ndn::Name& rtrName) { diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp index c2e5fa6..97a89b0 100644 --- a/src/route/nexthop-list.cpp +++ b/src/route/nexthop-list.cpp @@ -18,9 +18,8 @@ * You should have received a copy of the GNU General Public License along with * NLSR, e.g., in COPYING.md file. If not, see . **/ - -#include "common.hpp" #include "nexthop-list.hpp" +#include "common.hpp" #include "nexthop.hpp" #include "logger.hpp" @@ -28,8 +27,6 @@ namespace nlsr { INIT_LOGGER("NexthopList"); -using namespace std; - static bool nexthopAddCompare(const NextHop& nh1, const NextHop& nh2) { diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp index 7aa6f48..f4442f5 100644 --- a/src/route/routing-table-calculator.cpp +++ b/src/route/routing-table-calculator.cpp @@ -18,23 +18,21 @@ * You should have received a copy of the GNU General Public License along with * NLSR, e.g., in COPYING.md file. If not, see . **/ - -#include -#include -#include "lsdb.hpp" #include "routing-table-calculator.hpp" +#include "lsdb.hpp" #include "map.hpp" #include "lsa.hpp" #include "nexthop.hpp" #include "nlsr.hpp" #include "logger.hpp" +#include #include +#include namespace nlsr { INIT_LOGGER("RoutingTableCalculator"); -using namespace std; void RoutingTableCalculator::allocateAdjMatrix() @@ -120,7 +118,7 @@ void RoutingTableCalculator::writeAdjMatrixLog() { for (size_t i = 0; i < m_nRouters; i++) { - string line=""; + std::string line=""; for (size_t j = 0; j < m_nRouters; j++) { line += boost::lexical_cast(adjMatrix[i][j]); line += " "; @@ -252,7 +250,7 @@ LinkStateRoutingTableCalculator::doDijkstraPathCalculation(int sourceRouter) int v, u; int* Q = new int[m_nRouters]; // Each cell represents the router with that mapping no. int head = 0; - // Initiate the Parent + // Initiate the parent for (i = 0 ; i < static_cast(m_nRouters); i++) { m_parent[i] = EMPTY_PARENT; // Array where the ith element is the distance to the router with mapping no i. diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp index 708e3dd..238852a 100644 --- a/src/route/routing-table.cpp +++ b/src/route/routing-table.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License along with * NLSR, e.g., in COPYING.md file. If not, see . **/ - #include "routing-table.hpp" #include "nlsr.hpp" #include "map.hpp" @@ -28,15 +27,13 @@ #include "logger.hpp" #include -#include #include +#include namespace nlsr { INIT_LOGGER("RoutingTable"); -using namespace std; - void RoutingTable::calculate(Nlsr& pnlsr) { diff --git a/src/sequencing-manager.cpp b/src/sequencing-manager.cpp index 6eaab5d..810be68 100644 --- a/src/sequencing-manager.cpp +++ b/src/sequencing-manager.cpp @@ -19,6 +19,9 @@ * NLSR, e.g., in COPYING.md file. If not, see . **/ +#include "sequencing-manager.hpp" +#include "logger.hpp" + #include #include #include @@ -27,15 +30,10 @@ #include #include -#include "sequencing-manager.hpp" -#include "logger.hpp" - namespace nlsr { INIT_LOGGER("SequencingManager"); -using namespace std; - void SequencingManager::writeSeqNoToFile() const { @@ -112,12 +110,12 @@ SequencingManager::initiateSeqNoFromFile(int hypState) } void -SequencingManager::setSeqFileDirectory(string filePath) +SequencingManager::setSeqFileDirectory(std::string filePath) { m_seqFileNameWithPath = filePath; if (m_seqFileNameWithPath.empty()) { - string homeDirPath(getpwuid(getuid())->pw_dir); + std::string homeDirPath(getpwuid(getuid())->pw_dir); if (homeDirPath.empty()) { homeDirPath = getenv("HOME"); } diff --git a/tests/test-adjacency-list.cpp b/tests/test-adjacency-list.cpp index 9a46a1c..465fd9a 100644 --- a/tests/test-adjacency-list.cpp +++ b/tests/test-adjacency-list.cpp @@ -19,8 +19,9 @@ * NLSR, e.g., in COPYING.md file. If not, see . **/ -#include "adjacency-list.hpp" +#include "common.hpp" +#include "adjacency-list.hpp" #include "adjacent.hpp" #include "conf-parameter.hpp" diff --git a/tests/test-lsdb.cpp b/tests/test-lsdb.cpp index 2dd6f3e..49501bf 100644 --- a/tests/test-lsdb.cpp +++ b/tests/test-lsdb.cpp @@ -123,8 +123,8 @@ BOOST_AUTO_TEST_CASE(LsdbSync) BOOST_CHECK_EQUAL(it->getName(), oldInterestName); interests.clear(); - steady_clock::TimePoint deadline = steady_clock::now() + - ndn::time::seconds(LSA_REFRESH_TIME_MAX); + ndn::time::steady_clock::TimePoint deadline = ndn::time::steady_clock::now() + + ndn::time::seconds(LSA_REFRESH_TIME_MAX); // Simulate an LSA interest timeout lsdb.onFetchLsaError(ndn::util::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT, "Timeout", diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp index 32cacb5..42d9fa0 100644 --- a/tests/update/test-prefix-update-processor.cpp +++ b/tests/update/test-prefix-update-processor.cpp @@ -169,7 +169,7 @@ public: lsaInterestName.append(sessionTime); lsaInterestName.appendNumber(nlsr.getLsdb().getSequencingManager().getNameLsaSeq()); - shared_ptr lsaInterest = make_shared(lsaInterestName); + std::shared_ptr lsaInterest = std::make_shared(lsaInterestName); face.receive(*lsaInterest); this->advanceClocks(ndn::time::milliseconds(10));