diff --git a/src/hello-protocol.hpp b/src/hello-protocol.hpp index a50c2b5..9ff1335 100644 --- a/src/hello-protocol.hpp +++ b/src/hello-protocol.hpp @@ -83,7 +83,7 @@ class HelloProtocol void processInterest(const ndn::Name& name, const ndn::Interest& interest); - ndn::util::Signal hpIncrementSignal; + ndn::signal::Signal hpIncrementSignal; private: /*! \brief Try to contact a neighbor via Hello protocol again @@ -126,7 +126,7 @@ class HelloProtocol static inline const std::string INFO_COMPONENT{"INFO"}; static inline const std::string NLSR_COMPONENT{"nlsr"}; - ndn::util::Signal onInitialHelloDataValidated; + ndn::signal::Signal onInitialHelloDataValidated; private: ndn::Face& m_face; diff --git a/src/lsdb.cpp b/src/lsdb.cpp index 9467870..876fa57 100644 --- a/src/lsdb.cpp +++ b/src/lsdb.cpp @@ -438,13 +438,12 @@ Lsdb::expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, uint if (incomingFaceId != 0) { interest.setTag(std::make_shared(incomingFaceId)); } - ndn::util::SegmentFetcher::Options options; + ndn::SegmentFetcher::Options options; options.interestLifetime = m_confParam.getLsaInterestLifetime(); options.maxTimeout = m_confParam.getLsaInterestLifetime(); NLSR_LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo); - auto fetcher = ndn::util::SegmentFetcher::start(m_face, interest, - m_confParam.getValidator(), options); + auto fetcher = ndn::SegmentFetcher::start(m_face, interest, m_confParam.getValidator(), options); auto it = m_fetchers.insert(fetcher).first; @@ -493,7 +492,7 @@ Lsdb::onFetchLsaError(uint32_t errorCode, const std::string& msg, const ndn::Nam // the potential for constant Interest flooding. ndn::time::seconds delay = m_confParam.getLsaInterestLifetime(); - if (errorCode == ndn::util::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT) { + if (errorCode == ndn::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT) { delay = ndn::time::seconds(0); } m_scheduler.schedule(delay, std::bind(&Lsdb::expressInterest, this, diff --git a/src/lsdb.hpp b/src/lsdb.hpp index 634b793..2c9008d 100644 --- a/src/lsdb.hpp +++ b/src/lsdb.hpp @@ -321,10 +321,10 @@ class Lsdb } public: - ndn::util::Signal lsaIncrementSignal; - ndn::util::Signal afterSegmentValidatedSignal; - using AfterLsdbModified = ndn::util::Signal, LsdbUpdate, - std::list, std::list>; + ndn::signal::Signal lsaIncrementSignal; + ndn::signal::Signal afterSegmentValidatedSignal; + using AfterLsdbModified = ndn::signal::Signal, LsdbUpdate, + std::list, std::list>; AfterLsdbModified onLsdbModified; PUBLIC_WITH_TESTS_ELSE_PRIVATE: @@ -346,10 +346,10 @@ class Lsdb SequencingManager m_sequencingManager; - ndn::util::signal::ScopedConnection m_onNewLsaConnection; + ndn::signal::ScopedConnection m_onNewLsaConnection; - std::set> m_fetchers; - ndn::util::Segmenter m_segmenter; + std::set> m_fetchers; + ndn::Segmenter m_segmenter; ndn::InMemoryStorageFifo m_segmentFifo; bool m_isBuildAdjLsaScheduled; diff --git a/src/nlsr.hpp b/src/nlsr.hpp index e435593..f562bc9 100644 --- a/src/nlsr.hpp +++ b/src/nlsr.hpp @@ -176,9 +176,9 @@ class Nlsr HelloProtocol m_helloProtocol; private: - ndn::util::signal::ScopedConnection m_onNewLsaConnection; - ndn::util::signal::ScopedConnection m_onPrefixRegistrationSuccess; - ndn::util::signal::ScopedConnection m_onInitialHelloDataValidated; + ndn::signal::ScopedConnection m_onNewLsaConnection; + ndn::signal::ScopedConnection m_onPrefixRegistrationSuccess; + ndn::signal::ScopedConnection m_onInitialHelloDataValidated; PUBLIC_WITH_TESTS_ELSE_PRIVATE: ndn::mgmt::Dispatcher m_dispatcher; diff --git a/src/route/fib.hpp b/src/route/fib.hpp index e24c61b..1a9b75f 100644 --- a/src/route/fib.hpp +++ b/src/route/fib.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -222,7 +222,7 @@ class Fib static inline const ndn::Name MULTICAST_STRATEGY{"/localhost/nfd/strategy/multicast"}; static inline const ndn::Name BEST_ROUTE_STRATEGY{"/localhost/nfd/strategy/best-route"}; - ndn::util::Signal onPrefixRegistrationSuccess; + ndn::signal::Signal onPrefixRegistrationSuccess; private: ndn::Scheduler& m_scheduler; diff --git a/src/route/name-prefix-table.hpp b/src/route/name-prefix-table.hpp index 449b928..5ac8345 100644 --- a/src/route/name-prefix-table.hpp +++ b/src/route/name-prefix-table.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2021, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -141,8 +141,8 @@ class NamePrefixTable const ndn::Name& m_ownRouterName; Fib& m_fib; RoutingTable& m_routingTable; - ndn::util::signal::Connection m_afterRoutingChangeConnection; - ndn::util::signal::Connection m_afterLsdbModified; + ndn::signal::Connection m_afterRoutingChangeConnection; + ndn::signal::Connection m_afterLsdbModified; }; inline NamePrefixTable::const_iterator diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp index f7e0525..c49eaec 100644 --- a/src/route/routing-table.hpp +++ b/src/route/routing-table.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2021, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California * * This file is part of NLSR (Named-data Link State Routing). @@ -155,7 +155,7 @@ class RoutingTable : public RoutingTableStatus bool m_isRouteCalculationScheduled; ConfParameter& m_confParam; - ndn::util::signal::Connection m_afterLsdbModified; + ndn::signal::Connection m_afterLsdbModified; int32_t m_hyperbolicState; bool m_ownAdjLsaExist = false; }; diff --git a/src/security/certificate-store.hpp b/src/security/certificate-store.hpp index 2a47caa..0c01bf0 100644 --- a/src/security/certificate-store.hpp +++ b/src/security/certificate-store.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -104,7 +104,7 @@ class CertificateStore ndn::Face& m_face; ConfParameter& m_confParam; ndn::security::ValidatorConfig& m_validator; - ndn::util::signal::ScopedConnection m_afterSegmentValidatedConnection; + ndn::signal::ScopedConnection m_afterSegmentValidatedConnection; }; } // namespace security diff --git a/src/signals.hpp b/src/signals.hpp index b7b2b33..7cccac7 100644 --- a/src/signals.hpp +++ b/src/signals.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -32,8 +32,8 @@ class RoutingTable; class RoutingTableEntry; class SyncLogicHandler; -using AfterRoutingChange = ndn::util::Signal>; -using OnNewLsa = ndn::util::Signal; +using AfterRoutingChange = ndn::signal::Signal>; +using OnNewLsa = ndn::signal::Signal; } // namespace nlsr diff --git a/src/stats-collector.hpp b/src/stats-collector.hpp index a2be959..802769d 100644 --- a/src/stats-collector.hpp +++ b/src/stats-collector.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/** - * Copyright (c) 2014-2017, The University of Memphis, +/* + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California * * This file is part of NLSR (Named-data Link State Routing). @@ -28,8 +28,9 @@ namespace nlsr { -// brief: a class designed to handle statistical signals in nlsr - +/** + * \brief a class designed to handle statistical signals in nlsr + */ class StatsCollector { public: @@ -63,8 +64,8 @@ class StatsCollector HelloProtocol& m_hp; Statistics m_stats; - ndn::util::signal::ScopedConnection m_lsaIncrementConn; - ndn::util::signal::ScopedConnection m_helloIncrementConn; + ndn::signal::ScopedConnection m_lsaIncrementConn; + ndn::signal::ScopedConnection m_helloIncrementConn; }; } // namespace nlsr diff --git a/tests/communication/test-sync-logic-handler.cpp b/tests/communication/test-sync-logic-handler.cpp index 8c0cc3d..c259bfc 100644 --- a/tests/communication/test-sync-logic-handler.cpp +++ b/tests/communication/test-sync-logic-handler.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -30,8 +30,6 @@ namespace nlsr { namespace test { -using std::shared_ptr; - class SyncLogicFixture : public IoKeyChainFixture { public: @@ -58,7 +56,7 @@ class SyncLogicFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face{m_io, m_keyChain}; + ndn::DummyClientFace face{m_io, m_keyChain}; ConfParameter conf{face, m_keyChain}; DummyConfFileProcessor confProcessor{conf, SyncProtocol::PSYNC}; SyncLogicHandler::IsLsaNew testIsLsaNew; @@ -84,7 +82,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherLS) for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::ADJACENCY}) { std::string updateName = this->updateNamePrefix + boost::lexical_cast(lsaType); - ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa.connect( + ndn::signal::ScopedConnection connection = this->sync.onNewLsa.connect( [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); @@ -111,7 +109,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherHR) for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::COORDINATE}) { std::string updateName = this->updateNamePrefix + boost::lexical_cast(lsaType); - ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa.connect( + ndn::signal::ScopedConnection connection = this->sync.onNewLsa.connect( [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); @@ -138,7 +136,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry) for (auto lsaType : this->lsaTypes) { std::string updateName = this->updateNamePrefix + boost::lexical_cast(lsaType); - ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa.connect( + ndn::signal::ScopedConnection connection = this->sync.onNewLsa.connect( [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); @@ -167,7 +165,7 @@ BOOST_AUTO_TEST_CASE(NoUpdateForSelf) .append(this->conf.getRouterName()) .append(boost::lexical_cast(lsaType)); - ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa.connect( + ndn::signal::ScopedConnection connection = this->sync.onNewLsa.connect( [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { BOOST_FAIL("Updates for self should not be emitted!"); }); @@ -191,7 +189,7 @@ BOOST_AUTO_TEST_CASE(MalformedUpdate) ndn::Name updateName{this->conf.getSiteName()}; updateName.append(this->conf.getRouterName()).append(boost::lexical_cast(lsaType)); - ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa.connect( + ndn::signal::ScopedConnection connection = this->sync.onNewLsa.connect( [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { BOOST_FAIL("Malformed updates should not be emitted!"); }); @@ -216,7 +214,7 @@ BOOST_AUTO_TEST_CASE(LsaNotNew) const uint64_t sequenceNumber = 1; SyncLogicHandler sync{this->face, this->m_keyChain, testLsaAlwaysFalse, this->conf}; - ndn::util::signal::ScopedConnection connection = sync.onNewLsa.connect( + ndn::signal::ScopedConnection connection = sync.onNewLsa.connect( [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) { BOOST_FAIL("An update for an LSA with non-new sequence number should not emit!"); }); diff --git a/tests/communication/test-sync-protocol-adapter.cpp b/tests/communication/test-sync-protocol-adapter.cpp index 721b2f7..1b80a82 100644 --- a/tests/communication/test-sync-protocol-adapter.cpp +++ b/tests/communication/test-sync-protocol-adapter.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -29,7 +29,7 @@ namespace nlsr { namespace test { -using namespace ndn; +using ndn::Name; class SyncProtocolAdapterFixture : public IoKeyChainFixture { @@ -37,7 +37,7 @@ class SyncProtocolAdapterFixture : public IoKeyChainFixture SyncProtocolAdapterFixture() : syncPrefix("/localhop/ndn/nlsr/sync") , nameLsaUserPrefix("/localhop/ndn/nlsr/LSA/NAME") - , syncInterestLifetime(time::seconds(60)) + , syncInterestLifetime(60_s) { syncPrefix.appendVersion(4); } @@ -46,29 +46,28 @@ class SyncProtocolAdapterFixture : public IoKeyChainFixture addNodes() { for (int i = 0; i < 2; i++) { - faces[i] = std::make_shared(m_io, - util::DummyClientFace::Options{true, true}); + faces[i] = std::make_shared(m_io, ndn::DummyClientFace::Options{true, true}); userPrefixes[i] = Name(nameLsaUserPrefix).appendNumber(i); - nodes[i] = std::make_shared(*faces[i], m_keyChain, SyncProtocol::PSYNC, - syncPrefix, userPrefixes[i], - syncInterestLifetime, - [i, this] (const ndn::Name& updateName, - uint64_t highSeq, uint64_t incomingFaceId) { - prefixToSeq[i].emplace(updateName, highSeq); - }); + nodes[i] = std::make_shared( + *faces[i], m_keyChain, SyncProtocol::PSYNC, syncPrefix, userPrefixes[i], + syncInterestLifetime, + [i, this] (const Name& updateName, uint64_t highSeq, uint64_t incomingFaceId) { + prefixToSeq[i].emplace(updateName, highSeq); + }); } faces[0]->linkTo(*faces[1]); - advanceClocks(ndn::time::milliseconds(10), 10); + advanceClocks(10_ms, 10); } public: - Name syncPrefix, nameLsaUserPrefix; + Name syncPrefix; + Name nameLsaUserPrefix; Name userPrefixes[2]; - time::milliseconds syncInterestLifetime; - std::shared_ptr faces[2]; + ndn::time::milliseconds syncInterestLifetime; + std::shared_ptr faces[2]; std::shared_ptr nodes[2]; - std::map prefixToSeq[2]; + std::map prefixToSeq[2]; }; BOOST_AUTO_TEST_SUITE(TestSyncProtocolAdapter) @@ -78,7 +77,7 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture) addNodes(); nodes[0]->publishUpdate(userPrefixes[0], 10); - advanceClocks(ndn::time::milliseconds(1000), 100); + advanceClocks(1_s, 100); auto it = prefixToSeq[1].find(userPrefixes[0]); BOOST_CHECK(it != prefixToSeq[1].end()); @@ -86,7 +85,7 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture) BOOST_CHECK_EQUAL(it->second, 10); nodes[1]->publishUpdate(userPrefixes[1], 100); - advanceClocks(ndn::time::milliseconds(1000), 100); + advanceClocks(1_s, 100); it = prefixToSeq[0].find(userPrefixes[1]); BOOST_CHECK(it != prefixToSeq[0].end()); @@ -95,9 +94,9 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture) Name adjLsaUserPrefix("/localhop/ndn/nlsr/LSA/ADJACENCY"); nodes[0]->addUserNode(adjLsaUserPrefix); - advanceClocks(ndn::time::milliseconds(1000), 100); + advanceClocks(1_s, 100); nodes[0]->publishUpdate(adjLsaUserPrefix, 10); - advanceClocks(ndn::time::milliseconds(1000), 100); + advanceClocks(1_s, 100); it = prefixToSeq[1].find(adjLsaUserPrefix); BOOST_CHECK(it != prefixToSeq[1].end()); diff --git a/tests/publisher/publisher-fixture.hpp b/tests/publisher/publisher-fixture.hpp index ffc7016..b187ffb 100644 --- a/tests/publisher/publisher-fixture.hpp +++ b/tests/publisher/publisher-fixture.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -81,7 +81,7 @@ class PublisherFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; Nlsr nlsr; diff --git a/tests/route/test-fib.cpp b/tests/route/test-fib.cpp index 932b63a..7bbfccb 100644 --- a/tests/route/test-fib.cpp +++ b/tests/route/test-fib.cpp @@ -71,8 +71,8 @@ class FibFixture : public IoKeyChainFixture ndn::Scheduler m_scheduler{m_io}; public: - ndn::util::DummyClientFace face{m_io, m_keyChain, [] { - ndn::util::DummyClientFace::Options opts; + ndn::DummyClientFace face{m_io, m_keyChain, [] { + ndn::DummyClientFace::Options opts; opts.enableRegistrationReply = true; opts.registrationReplyFaceId = 128; return opts; diff --git a/tests/route/test-hyperbolic-calculator.cpp b/tests/route/test-hyperbolic-calculator.cpp index 18a7d21..10a401e 100644 --- a/tests/route/test-hyperbolic-calculator.cpp +++ b/tests/route/test-hyperbolic-calculator.cpp @@ -145,7 +145,7 @@ class HyperbolicCalculatorFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; Nlsr nlsr; Map map; diff --git a/tests/route/test-link-state-calculator.cpp b/tests/route/test-link-state-calculator.cpp index 397f779..0a4c522 100644 --- a/tests/route/test-link-state-calculator.cpp +++ b/tests/route/test-link-state-calculator.cpp @@ -95,7 +95,7 @@ class LinkStateCalculatorFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; Nlsr nlsr; diff --git a/tests/route/test-name-prefix-table.cpp b/tests/route/test-name-prefix-table.cpp index 1425603..839c874 100644 --- a/tests/route/test-name-prefix-table.cpp +++ b/tests/route/test-name-prefix-table.cpp @@ -53,7 +53,7 @@ class NamePrefixTableFixture : public IoKeyChainFixture ndn::Scheduler m_scheduler{m_io}; public: - ndn::util::DummyClientFace face{m_io, m_keyChain}; + ndn::DummyClientFace face{m_io, m_keyChain}; ConfParameter conf{face, m_keyChain}; DummyConfFileProcessor confProcessor{conf}; diff --git a/tests/route/test-routing-table.cpp b/tests/route/test-routing-table.cpp index 1e689a7..b777a04 100644 --- a/tests/route/test-routing-table.cpp +++ b/tests/route/test-routing-table.cpp @@ -35,7 +35,7 @@ class RoutingTableFixture : public IoKeyChainFixture ndn::Scheduler m_scheduler{m_io}; public: - ndn::util::DummyClientFace face{m_io, m_keyChain, {true, true}}; + ndn::DummyClientFace face{m_io, m_keyChain, {true, true}}; ConfParameter conf{face, m_keyChain}; DummyConfFileProcessor confProcessor{conf}; diff --git a/tests/security/test-certificate-store.cpp b/tests/security/test-certificate-store.cpp index efd7ace..18be8fe 100644 --- a/tests/security/test-certificate-store.cpp +++ b/tests/security/test-certificate-store.cpp @@ -102,7 +102,7 @@ class CertificateStoreFixture : public IoKeyChainFixture BOOST_CHECK(didFindInterest); } - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; @@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE(Basic) BOOST_AUTO_TEST_CASE(RetrieveCert) { - ndn::util::DummyClientFace consumer(m_io); + ndn::DummyClientFace consumer(m_io); consumer.linkTo(face); auto checkRetrieve = [&] (const ndn::Name& interestName, bool canBePrefix, const ndn::Name& dataName) { @@ -245,7 +245,7 @@ BOOST_AUTO_TEST_CASE(SegmentValidatedSignal) BOOST_CHECK(certStore.find(keyName) != nullptr); // testing a callback after segment validation signal from lsdb - ndn::util::signal::ScopedConnection connection = lsdb.afterSegmentValidatedSignal.connect( + ndn::signal::ScopedConnection connection = lsdb.afterSegmentValidatedSignal.connect( [&] (const ndn::Data& lsaSegment) { BOOST_CHECK_EQUAL(lsaSegment.getName(), data.getName()); }); diff --git a/tests/test-adjacency-list.cpp b/tests/test-adjacency-list.cpp index 565052c..1a2ca87 100644 --- a/tests/test-adjacency-list.cpp +++ b/tests/test-adjacency-list.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(AdjLsaIsBuildableWithOneNodeActive) adjacencies.insert(adjacencyA); adjacencies.insert(adjacencyB); - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::KeyChain keyChain; ConfParameter conf(face, keyChain); BOOST_CHECK(adjacencies.isAdjLsaBuildable(conf.getInterestRetryNumber())); @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(AdjLsaIsBuildableWithAllNodesTimedOut) adjacencies.insert(adjacencyA); adjacencies.insert(adjacencyB); - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::KeyChain keyChain; ConfParameter conf(face, keyChain); conf.setInterestRetryNumber(HELLO_RETRIES_DEFAULT); @@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(AdjLsaIsNotBuildable) adjacencies.insert(adjacencyA); adjacencies.insert(adjacencyB); - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::KeyChain keyChain; ConfParameter conf(face, keyChain); conf.setInterestRetryNumber(HELLO_RETRIES_DEFAULT); diff --git a/tests/test-common.cpp b/tests/test-common.cpp index 388cb23..953d9ec 100644 --- a/tests/test-common.cpp +++ b/tests/test-common.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California * * This file is part of NLSR (Named-data Link State Routing). @@ -41,7 +41,7 @@ signData(ndn::Data& data) } void -checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix) +checkPrefixRegistered(const ndn::DummyClientFace& face, const ndn::Name& prefix) { bool registerCommandEmitted = false; for (const auto& interest : face.sentInterests) { diff --git a/tests/test-common.hpp b/tests/test-common.hpp index 3498f81..2bee4fc 100644 --- a/tests/test-common.hpp +++ b/tests/test-common.hpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -56,7 +56,7 @@ signData(std::shared_ptr data) } void -checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix); +checkPrefixRegistered(const ndn::DummyClientFace& face, const ndn::Name& prefix); class DummyConfFileProcessor { diff --git a/tests/test-conf-file-processor.cpp b/tests/test-conf-file-processor.cpp index 249dab4..bf7ddb3 100644 --- a/tests/test-conf-file-processor.cpp +++ b/tests/test-conf-file-processor.cpp @@ -164,7 +164,7 @@ class ConfFileProcessorFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; }; diff --git a/tests/test-conf-parameter.cpp b/tests/test-conf-parameter.cpp index 4d16ba5..02fe05b 100644 --- a/tests/test-conf-parameter.cpp +++ b/tests/test-conf-parameter.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California * * This file is part of NLSR (Named-data Link State Routing). @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_SUITE(TestConfParameter) BOOST_AUTO_TEST_CASE(ConfParameterSettersAndGetters) { - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::KeyChain keyChain; ConfParameter cp1(face, keyChain); diff --git a/tests/test-hello-protocol.cpp b/tests/test-hello-protocol.cpp index 6ea3449..a825321 100644 --- a/tests/test-hello-protocol.cpp +++ b/tests/test-hello-protocol.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -88,7 +88,7 @@ class HelloProtocolFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; AdjacencyList& adjList; diff --git a/tests/test-lsa-rule.cpp b/tests/test-lsa-rule.cpp index cf9c699..eaebf12 100644 --- a/tests/test-lsa-rule.cpp +++ b/tests/test-lsa-rule.cpp @@ -85,7 +85,7 @@ class LsaRuleFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::Name rootIdName, siteIdentityName, opIdentityName, routerIdName; ndn::security::pib::Identity rootId, siteIdentity, opIdentity, routerId; diff --git a/tests/test-lsa-segment-storage.cpp b/tests/test-lsa-segment-storage.cpp index 0bed79d..922e78c 100644 --- a/tests/test-lsa-segment-storage.cpp +++ b/tests/test-lsa-segment-storage.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -64,7 +64,7 @@ class LsaSegmentStorageFixture : public IoKeyChainFixture ndn::time::system_clock::now() + refreshTime, npl1); interestName.appendVersion(); - ndn::util::Segmenter segmenter(m_keyChain, ndn::security::SigningInfo()); + ndn::Segmenter segmenter(m_keyChain, ndn::security::SigningInfo()); auto segments = segmenter.segment(nameLsa.wireEncode(), interestName, ndn::MAX_NDN_PACKET_SIZE / 2, refreshTime); for (const auto& seg : segments) { @@ -84,7 +84,7 @@ class LsaSegmentStorageFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face{m_io, m_keyChain, {true, true}}; + ndn::DummyClientFace face{m_io, m_keyChain, {true, true}}; ConfParameter conf{face, m_keyChain}; DummyConfFileProcessor confProcessor{conf}; Nlsr nlsr{face, m_keyChain, conf}; @@ -92,7 +92,7 @@ class LsaSegmentStorageFixture : public IoKeyChainFixture ndn::InMemoryStorageFifo ims{100}; int numValidationSignal = 0; - ndn::util::signal::ScopedConnection afterSegmentValidatedConn; + ndn::signal::ScopedConnection afterSegmentValidatedConn; }; BOOST_FIXTURE_TEST_SUITE(TestLsaSegmentStorage, LsaSegmentStorageFixture) diff --git a/tests/test-lsdb.cpp b/tests/test-lsdb.cpp index bec64cb..f6e078b 100644 --- a/tests/test-lsdb.cpp +++ b/tests/test-lsdb.cpp @@ -110,7 +110,7 @@ class LsdbFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; Lsdb lsdb; @@ -150,7 +150,7 @@ BOOST_AUTO_TEST_CASE(LsdbSync) auto 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", + lsdb.onFetchLsaError(ndn::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT, "Timeout", oldInterestName, 0, deadline, interestName, oldSeqNo); advanceClocks(10_ms); @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(LsdbSync) interests.clear(); // Simulate an LSA interest timeout where the sequence number is outdated - lsdb.onFetchLsaError(ndn::util::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT, "Timeout", + lsdb.onFetchLsaError(ndn::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT, "Timeout", oldInterestName, 0, deadline, interestName, oldSeqNo); advanceClocks(10_ms); @@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(LsdbSegmentedData) lsdb.installLsa(nameLsa); // Create another Lsdb and expressInterest - ndn::util::DummyClientFace face2(m_io, m_keyChain, {true, true}); + ndn::DummyClientFace face2(m_io, m_keyChain, {true, true}); face.linkTo(face2); ConfParameter conf2(face2, m_keyChain); @@ -256,11 +256,11 @@ BOOST_AUTO_TEST_CASE(SegmentLsaData) ndn::Name interestName("/localhop/ndn/nlsr/LSA/site/%C1.Router/this-router/NAME/"); interestName.appendNumber(seqNo); - ndn::util::DummyClientFace face2(m_io, m_keyChain, {true, true}); + ndn::DummyClientFace face2(m_io, m_keyChain, {true, true}); face.linkTo(face2); - auto fetcher = ndn::util::SegmentFetcher::start(face2, ndn::Interest(interestName), - ndn::security::getAcceptAllValidator()); + auto fetcher = ndn::SegmentFetcher::start(face2, ndn::Interest(interestName), + ndn::security::getAcceptAllValidator()); fetcher->onComplete.connect([&expectedDataContent] (ndn::ConstBufferPtr bufferPtr) { ndn::Block block(bufferPtr); BOOST_CHECK_EQUAL(expectedDataContent, block); diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp index b4f979c..ed8ce66 100644 --- a/tests/test-nlsr.cpp +++ b/tests/test-nlsr.cpp @@ -99,7 +99,7 @@ class MockNfdMgmtFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace m_face{m_io, m_keyChain, {true, true}}; + ndn::DummyClientFace m_face{m_io, m_keyChain, {true, true}}; }; class NlsrFixture : public MockNfdMgmtFixture @@ -138,7 +138,7 @@ class NlsrFixture : public MockNfdMgmtFixture AdjacencyList& neighbors; uint32_t nSuccessCallbacks; uint32_t nFailureCallbacks; - ndn::util::signal::ScopedConnection connection; + ndn::signal::ScopedConnection connection; }; BOOST_FIXTURE_TEST_SUITE(TestNlsr, NlsrFixture) diff --git a/tests/test-statistics.cpp b/tests/test-statistics.cpp index 5aa9855..641d55b 100644 --- a/tests/test-statistics.cpp +++ b/tests/test-statistics.cpp @@ -111,7 +111,7 @@ class StatisticsFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; Nlsr nlsr; diff --git a/tests/update/test-advertise-crash.cpp b/tests/update/test-advertise-crash.cpp index e2ded04..23f6e61 100644 --- a/tests/update/test-advertise-crash.cpp +++ b/tests/update/test-advertise-crash.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -63,7 +63,7 @@ class AdvertiseCrashFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; diff --git a/tests/update/test-nfd-rib-command-processor.cpp b/tests/update/test-nfd-rib-command-processor.cpp index 9385790..5105f9c 100644 --- a/tests/update/test-nfd-rib-command-processor.cpp +++ b/tests/update/test-nfd-rib-command-processor.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -87,7 +87,7 @@ class NfdRibCommandProcessorFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ConfParameter conf; DummyConfFileProcessor confProcessor; diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp index 52fb7b1..79e2d90 100644 --- a/tests/update/test-prefix-update-processor.cpp +++ b/tests/update/test-prefix-update-processor.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -125,7 +125,7 @@ class PrefixUpdateFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::Name siteIdentityName; ndn::security::pib::Identity siteIdentity; diff --git a/tests/update/test-save-delete-prefix.cpp b/tests/update/test-save-delete-prefix.cpp index 84612e4..3e8ef3b 100644 --- a/tests/update/test-save-delete-prefix.cpp +++ b/tests/update/test-save-delete-prefix.cpp @@ -1,6 +1,6 @@ /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* - * Copyright (c) 2014-2022, The University of Memphis, + * Copyright (c) 2014-2023, The University of Memphis, * Regents of the University of California, * Arizona Board of Regents. * @@ -154,7 +154,7 @@ class PrefixSaveDeleteFixture : public IoKeyChainFixture } public: - ndn::util::DummyClientFace face; + ndn::DummyClientFace face; ndn::Name siteIdentityName, routerIdName; ndn::security::pib::Identity siteIdentity, routerId; diff --git a/tools/nlsrc.cpp b/tools/nlsrc.cpp index 16807a7..4b16aaa 100644 --- a/tools/nlsrc.cpp +++ b/tools/nlsrc.cpp @@ -334,7 +334,7 @@ Nlsrc::fetchFromLsdb(const ndn::Name::Component& datasetType, name.append(datasetType); ndn::Interest interest(name); - auto fetcher = ndn::util::SegmentFetcher::start(m_face, interest, *m_validator); + auto fetcher = ndn::SegmentFetcher::start(m_face, interest, *m_validator); fetcher->onComplete.connect(std::bind(&Nlsrc::onFetchSuccess, this, _1, recordLsa)); fetcher->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2)); } @@ -363,7 +363,7 @@ Nlsrc::fetchFromRt(const std::function& recordDataset) name.append(RT_SUFFIX); ndn::Interest interest(name); - auto fetcher = ndn::util::SegmentFetcher::start(m_face, interest, *m_validator); + auto fetcher = ndn::SegmentFetcher::start(m_face, interest, *m_validator); fetcher->onComplete.connect(std::bind(&Nlsrc::onFetchSuccess, this, _1, recordDataset)); fetcher->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2)); }