Change namespace of DummyClientFace, Signal, Segmenter, SegmentFetcher

refs #3940

Change-Id: Ia3c9b4adcca9ff79a14be705ca9da525914f3dff
This commit is contained in:
Junxiao Shi committed 2023-08-20 02:23:22 +00:00
1 parent ecb0b7180e
commit 43f37a08fc
35 files changed
+111 -114

No files matched your search

+2 -2
View File
@@ -83,7 +83,7 @@ public:
void void
processInterest(const ndn::Name& name, const ndn::Interest& interest); processInterest(const ndn::Name& name, const ndn::Interest& interest);
ndn::util::Signal<HelloProtocol, Statistics::PacketType> hpIncrementSignal; ndn::signal::Signal<HelloProtocol, Statistics::PacketType> hpIncrementSignal;
private: private:
/*! \brief Try to contact a neighbor via Hello protocol again /*! \brief Try to contact a neighbor via Hello protocol again
@@ -126,7 +126,7 @@ public:
static inline const std::string INFO_COMPONENT{"INFO"}; static inline const std::string INFO_COMPONENT{"INFO"};
static inline const std::string NLSR_COMPONENT{"nlsr"}; static inline const std::string NLSR_COMPONENT{"nlsr"};
ndn::util::Signal<HelloProtocol, const ndn::Name&> onInitialHelloDataValidated; ndn::signal::Signal<HelloProtocol, const ndn::Name&> onInitialHelloDataValidated;
private: private:
ndn::Face& m_face; ndn::Face& m_face;
+3 -4
View File
@@ -438,13 +438,12 @@ Lsdb::expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, uint
if (incomingFaceId != 0) { if (incomingFaceId != 0) {
interest.setTag(std::make_shared<ndn::lp::NextHopFaceIdTag>(incomingFaceId)); interest.setTag(std::make_shared<ndn::lp::NextHopFaceIdTag>(incomingFaceId));
} }
ndn::util::SegmentFetcher::Options options; ndn::SegmentFetcher::Options options;
options.interestLifetime = m_confParam.getLsaInterestLifetime(); options.interestLifetime = m_confParam.getLsaInterestLifetime();
options.maxTimeout = m_confParam.getLsaInterestLifetime(); options.maxTimeout = m_confParam.getLsaInterestLifetime();
NLSR_LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo); NLSR_LOG_DEBUG("Fetching Data for LSA: " << interestName << " Seq number: " << seqNo);
auto fetcher = ndn::util::SegmentFetcher::start(m_face, interest, auto fetcher = ndn::SegmentFetcher::start(m_face, interest, m_confParam.getValidator(), options);
m_confParam.getValidator(), options);
auto it = m_fetchers.insert(fetcher).first; 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. // the potential for constant Interest flooding.
ndn::time::seconds delay = m_confParam.getLsaInterestLifetime(); 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); delay = ndn::time::seconds(0);
} }
m_scheduler.schedule(delay, std::bind(&Lsdb::expressInterest, this, m_scheduler.schedule(delay, std::bind(&Lsdb::expressInterest, this,
+7 -7
View File
@@ -321,10 +321,10 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
} }
public: public:
ndn::util::Signal<Lsdb, Statistics::PacketType> lsaIncrementSignal; ndn::signal::Signal<Lsdb, Statistics::PacketType> lsaIncrementSignal;
ndn::util::Signal<Lsdb, ndn::Data> afterSegmentValidatedSignal; ndn::signal::Signal<Lsdb, ndn::Data> afterSegmentValidatedSignal;
using AfterLsdbModified = ndn::util::Signal<Lsdb, std::shared_ptr<Lsa>, LsdbUpdate, using AfterLsdbModified = ndn::signal::Signal<Lsdb, std::shared_ptr<Lsa>, LsdbUpdate,
std::list<ndn::Name>, std::list<ndn::Name>>; std::list<ndn::Name>, std::list<ndn::Name>>;
AfterLsdbModified onLsdbModified; AfterLsdbModified onLsdbModified;
PUBLIC_WITH_TESTS_ELSE_PRIVATE: PUBLIC_WITH_TESTS_ELSE_PRIVATE:
@@ -346,10 +346,10 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
SequencingManager m_sequencingManager; SequencingManager m_sequencingManager;
ndn::util::signal::ScopedConnection m_onNewLsaConnection; ndn::signal::ScopedConnection m_onNewLsaConnection;
std::set<std::shared_ptr<ndn::util::SegmentFetcher>> m_fetchers; std::set<std::shared_ptr<ndn::SegmentFetcher>> m_fetchers;
ndn::util::Segmenter m_segmenter; ndn::Segmenter m_segmenter;
ndn::InMemoryStorageFifo m_segmentFifo; ndn::InMemoryStorageFifo m_segmentFifo;
bool m_isBuildAdjLsaScheduled; bool m_isBuildAdjLsaScheduled;
+3 -3
View File
@@ -176,9 +176,9 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
HelloProtocol m_helloProtocol; HelloProtocol m_helloProtocol;
private: private:
ndn::util::signal::ScopedConnection m_onNewLsaConnection; ndn::signal::ScopedConnection m_onNewLsaConnection;
ndn::util::signal::ScopedConnection m_onPrefixRegistrationSuccess; ndn::signal::ScopedConnection m_onPrefixRegistrationSuccess;
ndn::util::signal::ScopedConnection m_onInitialHelloDataValidated; ndn::signal::ScopedConnection m_onInitialHelloDataValidated;
PUBLIC_WITH_TESTS_ELSE_PRIVATE: PUBLIC_WITH_TESTS_ELSE_PRIVATE:
ndn::mgmt::Dispatcher m_dispatcher; ndn::mgmt::Dispatcher m_dispatcher;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -222,7 +222,7 @@ public:
static inline const ndn::Name MULTICAST_STRATEGY{"/localhost/nfd/strategy/multicast"}; static inline const ndn::Name MULTICAST_STRATEGY{"/localhost/nfd/strategy/multicast"};
static inline const ndn::Name BEST_ROUTE_STRATEGY{"/localhost/nfd/strategy/best-route"}; static inline const ndn::Name BEST_ROUTE_STRATEGY{"/localhost/nfd/strategy/best-route"};
ndn::util::Signal<Fib, ndn::Name> onPrefixRegistrationSuccess; ndn::signal::Signal<Fib, ndn::Name> onPrefixRegistrationSuccess;
private: private:
ndn::Scheduler& m_scheduler; ndn::Scheduler& m_scheduler;
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -141,8 +141,8 @@ private:
const ndn::Name& m_ownRouterName; const ndn::Name& m_ownRouterName;
Fib& m_fib; Fib& m_fib;
RoutingTable& m_routingTable; RoutingTable& m_routingTable;
ndn::util::signal::Connection m_afterRoutingChangeConnection; ndn::signal::Connection m_afterRoutingChangeConnection;
ndn::util::signal::Connection m_afterLsdbModified; ndn::signal::Connection m_afterLsdbModified;
}; };
inline NamePrefixTable::const_iterator inline NamePrefixTable::const_iterator
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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 * Regents of the University of California
* *
* This file is part of NLSR (Named-data Link State Routing). * This file is part of NLSR (Named-data Link State Routing).
@@ -155,7 +155,7 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
bool m_isRouteCalculationScheduled; bool m_isRouteCalculationScheduled;
ConfParameter& m_confParam; ConfParameter& m_confParam;
ndn::util::signal::Connection m_afterLsdbModified; ndn::signal::Connection m_afterLsdbModified;
int32_t m_hyperbolicState; int32_t m_hyperbolicState;
bool m_ownAdjLsaExist = false; bool m_ownAdjLsaExist = false;
}; };
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -104,7 +104,7 @@ private:
ndn::Face& m_face; ndn::Face& m_face;
ConfParameter& m_confParam; ConfParameter& m_confParam;
ndn::security::ValidatorConfig& m_validator; ndn::security::ValidatorConfig& m_validator;
ndn::util::signal::ScopedConnection m_afterSegmentValidatedConnection; ndn::signal::ScopedConnection m_afterSegmentValidatedConnection;
}; };
} // namespace security } // namespace security
+3 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -32,8 +32,8 @@ class RoutingTable;
class RoutingTableEntry; class RoutingTableEntry;
class SyncLogicHandler; class SyncLogicHandler;
using AfterRoutingChange = ndn::util::Signal<RoutingTable, std::list<RoutingTableEntry>>; using AfterRoutingChange = ndn::signal::Signal<RoutingTable, std::list<RoutingTableEntry>>;
using OnNewLsa = ndn::util::Signal<SyncLogicHandler, ndn::Name, uint64_t, ndn::Name, uint64_t>; using OnNewLsa = ndn::signal::Signal<SyncLogicHandler, ndn::Name, uint64_t, ndn::Name, uint64_t>;
} // namespace nlsr } // namespace nlsr
+7 -6
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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 * Regents of the University of California
* *
* This file is part of NLSR (Named-data Link State Routing). * This file is part of NLSR (Named-data Link State Routing).
@@ -28,8 +28,9 @@
namespace nlsr { namespace nlsr {
// brief: a class designed to handle statistical signals in nlsr /**
* \brief a class designed to handle statistical signals in nlsr
*/
class StatsCollector class StatsCollector
{ {
public: public:
@@ -63,8 +64,8 @@ private:
HelloProtocol& m_hp; HelloProtocol& m_hp;
Statistics m_stats; Statistics m_stats;
ndn::util::signal::ScopedConnection m_lsaIncrementConn; ndn::signal::ScopedConnection m_lsaIncrementConn;
ndn::util::signal::ScopedConnection m_helloIncrementConn; ndn::signal::ScopedConnection m_helloIncrementConn;
}; };
} // namespace nlsr } // namespace nlsr
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -30,8 +30,6 @@
namespace nlsr { namespace nlsr {
namespace test { namespace test {
using std::shared_ptr;
class SyncLogicFixture : public IoKeyChainFixture class SyncLogicFixture : public IoKeyChainFixture
{ {
public: public:
@@ -58,7 +56,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face{m_io, m_keyChain}; ndn::DummyClientFace face{m_io, m_keyChain};
ConfParameter conf{face, m_keyChain}; ConfParameter conf{face, m_keyChain};
DummyConfFileProcessor confProcessor{conf, SyncProtocol::PSYNC}; DummyConfFileProcessor confProcessor{conf, SyncProtocol::PSYNC};
SyncLogicHandler::IsLsaNew testIsLsaNew; SyncLogicHandler::IsLsaNew testIsLsaNew;
@@ -84,7 +82,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherLS)
for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::ADJACENCY}) { for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::ADJACENCY}) {
std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(lsaType); std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(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) { [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) {
BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName);
BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
@@ -111,7 +109,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherHR)
for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::COORDINATE}) { for (auto lsaType : {Lsa::Type::NAME, Lsa::Type::COORDINATE}) {
std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(lsaType); std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(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) { [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) {
BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName);
BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
@@ -138,7 +136,7 @@ BOOST_AUTO_TEST_CASE(UpdateForOtherHRDry)
for (auto lsaType : this->lsaTypes) { for (auto lsaType : this->lsaTypes) {
std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(lsaType); std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(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) { [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) {
BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName); BOOST_CHECK_EQUAL(ndn::Name{updateName}, routerName);
BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo); BOOST_CHECK_EQUAL(sequenceNumber, syncSeqNo);
@@ -167,7 +165,7 @@ BOOST_AUTO_TEST_CASE(NoUpdateForSelf)
.append(this->conf.getRouterName()) .append(this->conf.getRouterName())
.append(boost::lexical_cast<std::string>(lsaType)); .append(boost::lexical_cast<std::string>(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) { [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) {
BOOST_FAIL("Updates for self should not be emitted!"); BOOST_FAIL("Updates for self should not be emitted!");
}); });
@@ -191,7 +189,7 @@ BOOST_AUTO_TEST_CASE(MalformedUpdate)
ndn::Name updateName{this->conf.getSiteName()}; ndn::Name updateName{this->conf.getSiteName()};
updateName.append(this->conf.getRouterName()).append(boost::lexical_cast<std::string>(lsaType)); updateName.append(this->conf.getRouterName()).append(boost::lexical_cast<std::string>(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) { [&] (const auto& routerName, uint64_t sequenceNumber, const auto& originRouter, uint64_t incomingFaceId) {
BOOST_FAIL("Malformed updates should not be emitted!"); BOOST_FAIL("Malformed updates should not be emitted!");
}); });
@@ -216,7 +214,7 @@ BOOST_AUTO_TEST_CASE(LsaNotNew)
const uint64_t sequenceNumber = 1; const uint64_t sequenceNumber = 1;
SyncLogicHandler sync{this->face, this->m_keyChain, testLsaAlwaysFalse, this->conf}; 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) { [&] (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!"); BOOST_FAIL("An update for an LSA with non-new sequence number should not emit!");
}); });
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -29,7 +29,7 @@
namespace nlsr { namespace nlsr {
namespace test { namespace test {
using namespace ndn; using ndn::Name;
class SyncProtocolAdapterFixture : public IoKeyChainFixture class SyncProtocolAdapterFixture : public IoKeyChainFixture
{ {
@@ -37,7 +37,7 @@ public:
SyncProtocolAdapterFixture() SyncProtocolAdapterFixture()
: syncPrefix("/localhop/ndn/nlsr/sync") : syncPrefix("/localhop/ndn/nlsr/sync")
, nameLsaUserPrefix("/localhop/ndn/nlsr/LSA/NAME") , nameLsaUserPrefix("/localhop/ndn/nlsr/LSA/NAME")
, syncInterestLifetime(time::seconds(60)) , syncInterestLifetime(60_s)
{ {
syncPrefix.appendVersion(4); syncPrefix.appendVersion(4);
} }
@@ -46,29 +46,28 @@ public:
addNodes() addNodes()
{ {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
faces[i] = std::make_shared<util::DummyClientFace>(m_io, faces[i] = std::make_shared<ndn::DummyClientFace>(m_io, ndn::DummyClientFace::Options{true, true});
util::DummyClientFace::Options{true, true});
userPrefixes[i] = Name(nameLsaUserPrefix).appendNumber(i); userPrefixes[i] = Name(nameLsaUserPrefix).appendNumber(i);
nodes[i] = std::make_shared<SyncProtocolAdapter>(*faces[i], m_keyChain, SyncProtocol::PSYNC, nodes[i] = std::make_shared<SyncProtocolAdapter>(
syncPrefix, userPrefixes[i], *faces[i], m_keyChain, SyncProtocol::PSYNC, syncPrefix, userPrefixes[i],
syncInterestLifetime, syncInterestLifetime,
[i, this] (const ndn::Name& updateName, [i, this] (const Name& updateName, uint64_t highSeq, uint64_t incomingFaceId) {
uint64_t highSeq, uint64_t incomingFaceId) { prefixToSeq[i].emplace(updateName, highSeq);
prefixToSeq[i].emplace(updateName, highSeq); });
});
} }
faces[0]->linkTo(*faces[1]); faces[0]->linkTo(*faces[1]);
advanceClocks(ndn::time::milliseconds(10), 10); advanceClocks(10_ms, 10);
} }
public: public:
Name syncPrefix, nameLsaUserPrefix; Name syncPrefix;
Name nameLsaUserPrefix;
Name userPrefixes[2]; Name userPrefixes[2];
time::milliseconds syncInterestLifetime; ndn::time::milliseconds syncInterestLifetime;
std::shared_ptr<ndn::util::DummyClientFace> faces[2]; std::shared_ptr<ndn::DummyClientFace> faces[2];
std::shared_ptr<SyncProtocolAdapter> nodes[2]; std::shared_ptr<SyncProtocolAdapter> nodes[2];
std::map<ndn::Name, uint64_t> prefixToSeq[2]; std::map<Name, uint64_t> prefixToSeq[2];
}; };
BOOST_AUTO_TEST_SUITE(TestSyncProtocolAdapter) BOOST_AUTO_TEST_SUITE(TestSyncProtocolAdapter)
@@ -78,7 +77,7 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture)
addNodes(); addNodes();
nodes[0]->publishUpdate(userPrefixes[0], 10); nodes[0]->publishUpdate(userPrefixes[0], 10);
advanceClocks(ndn::time::milliseconds(1000), 100); advanceClocks(1_s, 100);
auto it = prefixToSeq[1].find(userPrefixes[0]); auto it = prefixToSeq[1].find(userPrefixes[0]);
BOOST_CHECK(it != prefixToSeq[1].end()); BOOST_CHECK(it != prefixToSeq[1].end());
@@ -86,7 +85,7 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture)
BOOST_CHECK_EQUAL(it->second, 10); BOOST_CHECK_EQUAL(it->second, 10);
nodes[1]->publishUpdate(userPrefixes[1], 100); nodes[1]->publishUpdate(userPrefixes[1], 100);
advanceClocks(ndn::time::milliseconds(1000), 100); advanceClocks(1_s, 100);
it = prefixToSeq[0].find(userPrefixes[1]); it = prefixToSeq[0].find(userPrefixes[1]);
BOOST_CHECK(it != prefixToSeq[0].end()); BOOST_CHECK(it != prefixToSeq[0].end());
@@ -95,9 +94,9 @@ BOOST_FIXTURE_TEST_CASE(Basic, SyncProtocolAdapterFixture)
Name adjLsaUserPrefix("/localhop/ndn/nlsr/LSA/ADJACENCY"); Name adjLsaUserPrefix("/localhop/ndn/nlsr/LSA/ADJACENCY");
nodes[0]->addUserNode(adjLsaUserPrefix); nodes[0]->addUserNode(adjLsaUserPrefix);
advanceClocks(ndn::time::milliseconds(1000), 100); advanceClocks(1_s, 100);
nodes[0]->publishUpdate(adjLsaUserPrefix, 10); nodes[0]->publishUpdate(adjLsaUserPrefix, 10);
advanceClocks(ndn::time::milliseconds(1000), 100); advanceClocks(1_s, 100);
it = prefixToSeq[1].find(adjLsaUserPrefix); it = prefixToSeq[1].find(adjLsaUserPrefix);
BOOST_CHECK(it != prefixToSeq[1].end()); BOOST_CHECK(it != prefixToSeq[1].end());
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -81,7 +81,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
Nlsr nlsr; Nlsr nlsr;
+2 -2
View File
@@ -71,8 +71,8 @@ private:
ndn::Scheduler m_scheduler{m_io}; ndn::Scheduler m_scheduler{m_io};
public: public:
ndn::util::DummyClientFace face{m_io, m_keyChain, [] { ndn::DummyClientFace face{m_io, m_keyChain, [] {
ndn::util::DummyClientFace::Options opts; ndn::DummyClientFace::Options opts;
opts.enableRegistrationReply = true; opts.enableRegistrationReply = true;
opts.registrationReplyFaceId = 128; opts.registrationReplyFaceId = 128;
return opts; return opts;
+1 -1
View File
@@ -145,7 +145,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
Nlsr nlsr; Nlsr nlsr;
Map map; Map map;
+1 -1
View File
@@ -95,7 +95,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
Nlsr nlsr; Nlsr nlsr;
+1 -1
View File
@@ -53,7 +53,7 @@ private:
ndn::Scheduler m_scheduler{m_io}; ndn::Scheduler m_scheduler{m_io};
public: public:
ndn::util::DummyClientFace face{m_io, m_keyChain}; ndn::DummyClientFace face{m_io, m_keyChain};
ConfParameter conf{face, m_keyChain}; ConfParameter conf{face, m_keyChain};
DummyConfFileProcessor confProcessor{conf}; DummyConfFileProcessor confProcessor{conf};
+1 -1
View File
@@ -35,7 +35,7 @@ private:
ndn::Scheduler m_scheduler{m_io}; ndn::Scheduler m_scheduler{m_io};
public: 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}; ConfParameter conf{face, m_keyChain};
DummyConfFileProcessor confProcessor{conf}; DummyConfFileProcessor confProcessor{conf};
+3 -3
View File
@@ -102,7 +102,7 @@ public:
BOOST_CHECK(didFindInterest); BOOST_CHECK(didFindInterest);
} }
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE(Basic)
BOOST_AUTO_TEST_CASE(RetrieveCert) BOOST_AUTO_TEST_CASE(RetrieveCert)
{ {
ndn::util::DummyClientFace consumer(m_io); ndn::DummyClientFace consumer(m_io);
consumer.linkTo(face); consumer.linkTo(face);
auto checkRetrieve = [&] (const ndn::Name& interestName, bool canBePrefix, const ndn::Name& dataName) { 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); BOOST_CHECK(certStore.find(keyName) != nullptr);
// testing a callback after segment validation signal from lsdb // 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) { [&] (const ndn::Data& lsaSegment) {
BOOST_CHECK_EQUAL(lsaSegment.getName(), data.getName()); BOOST_CHECK_EQUAL(lsaSegment.getName(), data.getName());
}); });
+4 -4
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(AdjLsaIsBuildableWithOneNodeActive)
adjacencies.insert(adjacencyA); adjacencies.insert(adjacencyA);
adjacencies.insert(adjacencyB); adjacencies.insert(adjacencyB);
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::KeyChain keyChain; ndn::KeyChain keyChain;
ConfParameter conf(face, keyChain); ConfParameter conf(face, keyChain);
BOOST_CHECK(adjacencies.isAdjLsaBuildable(conf.getInterestRetryNumber())); BOOST_CHECK(adjacencies.isAdjLsaBuildable(conf.getInterestRetryNumber()));
@@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(AdjLsaIsBuildableWithAllNodesTimedOut)
adjacencies.insert(adjacencyA); adjacencies.insert(adjacencyA);
adjacencies.insert(adjacencyB); adjacencies.insert(adjacencyB);
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::KeyChain keyChain; ndn::KeyChain keyChain;
ConfParameter conf(face, keyChain); ConfParameter conf(face, keyChain);
conf.setInterestRetryNumber(HELLO_RETRIES_DEFAULT); conf.setInterestRetryNumber(HELLO_RETRIES_DEFAULT);
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(AdjLsaIsNotBuildable)
adjacencies.insert(adjacencyA); adjacencies.insert(adjacencyA);
adjacencies.insert(adjacencyB); adjacencies.insert(adjacencyB);
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::KeyChain keyChain; ndn::KeyChain keyChain;
ConfParameter conf(face, keyChain); ConfParameter conf(face, keyChain);
conf.setInterestRetryNumber(HELLO_RETRIES_DEFAULT); conf.setInterestRetryNumber(HELLO_RETRIES_DEFAULT);
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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 * Regents of the University of California
* *
* This file is part of NLSR (Named-data Link State Routing). * This file is part of NLSR (Named-data Link State Routing).
@@ -41,7 +41,7 @@ signData(ndn::Data& data)
} }
void void
checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix) checkPrefixRegistered(const ndn::DummyClientFace& face, const ndn::Name& prefix)
{ {
bool registerCommandEmitted = false; bool registerCommandEmitted = false;
for (const auto& interest : face.sentInterests) { for (const auto& interest : face.sentInterests) {
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -56,7 +56,7 @@ signData(std::shared_ptr<ndn::Data> data)
} }
void void
checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix); checkPrefixRegistered(const ndn::DummyClientFace& face, const ndn::Name& prefix);
class DummyConfFileProcessor class DummyConfFileProcessor
{ {
+1 -1
View File
@@ -164,7 +164,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
}; };
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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 * Regents of the University of California
* *
* This file is part of NLSR (Named-data Link State Routing). * 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) BOOST_AUTO_TEST_CASE(ConfParameterSettersAndGetters)
{ {
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::KeyChain keyChain; ndn::KeyChain keyChain;
ConfParameter cp1(face, keyChain); ConfParameter cp1(face, keyChain);
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -88,7 +88,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
AdjacencyList& adjList; AdjacencyList& adjList;
+1 -1
View File
@@ -85,7 +85,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::Name rootIdName, siteIdentityName, opIdentityName, routerIdName; ndn::Name rootIdName, siteIdentityName, opIdentityName, routerIdName;
ndn::security::pib::Identity rootId, siteIdentity, opIdentity, routerId; ndn::security::pib::Identity rootId, siteIdentity, opIdentity, routerId;
+4 -4
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -64,7 +64,7 @@ public:
ndn::time::system_clock::now() + refreshTime, npl1); ndn::time::system_clock::now() + refreshTime, npl1);
interestName.appendVersion(); 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, auto segments = segmenter.segment(nameLsa.wireEncode(), interestName,
ndn::MAX_NDN_PACKET_SIZE / 2, refreshTime); ndn::MAX_NDN_PACKET_SIZE / 2, refreshTime);
for (const auto& seg : segments) { for (const auto& seg : segments) {
@@ -84,7 +84,7 @@ public:
} }
public: 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}; ConfParameter conf{face, m_keyChain};
DummyConfFileProcessor confProcessor{conf}; DummyConfFileProcessor confProcessor{conf};
Nlsr nlsr{face, m_keyChain, conf}; Nlsr nlsr{face, m_keyChain, conf};
@@ -92,7 +92,7 @@ public:
ndn::InMemoryStorageFifo ims{100}; ndn::InMemoryStorageFifo ims{100};
int numValidationSignal = 0; int numValidationSignal = 0;
ndn::util::signal::ScopedConnection afterSegmentValidatedConn; ndn::signal::ScopedConnection afterSegmentValidatedConn;
}; };
BOOST_FIXTURE_TEST_SUITE(TestLsaSegmentStorage, LsaSegmentStorageFixture) BOOST_FIXTURE_TEST_SUITE(TestLsaSegmentStorage, LsaSegmentStorageFixture)
+7 -7
View File
@@ -110,7 +110,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
Lsdb lsdb; 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); auto deadline = ndn::time::steady_clock::now() + ndn::time::seconds(LSA_REFRESH_TIME_MAX);
// Simulate an LSA interest timeout // 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); oldInterestName, 0, deadline, interestName, oldSeqNo);
advanceClocks(10_ms); advanceClocks(10_ms);
@@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(LsdbSync)
interests.clear(); interests.clear();
// Simulate an LSA interest timeout where the sequence number is outdated // 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); oldInterestName, 0, deadline, interestName, oldSeqNo);
advanceClocks(10_ms); advanceClocks(10_ms);
@@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(LsdbSegmentedData)
lsdb.installLsa(nameLsa); lsdb.installLsa(nameLsa);
// Create another Lsdb and expressInterest // 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); face.linkTo(face2);
ConfParameter conf2(face2, m_keyChain); 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/"); ndn::Name interestName("/localhop/ndn/nlsr/LSA/site/%C1.Router/this-router/NAME/");
interestName.appendNumber(seqNo); 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); face.linkTo(face2);
auto fetcher = ndn::util::SegmentFetcher::start(face2, ndn::Interest(interestName), auto fetcher = ndn::SegmentFetcher::start(face2, ndn::Interest(interestName),
ndn::security::getAcceptAllValidator()); ndn::security::getAcceptAllValidator());
fetcher->onComplete.connect([&expectedDataContent] (ndn::ConstBufferPtr bufferPtr) { fetcher->onComplete.connect([&expectedDataContent] (ndn::ConstBufferPtr bufferPtr) {
ndn::Block block(bufferPtr); ndn::Block block(bufferPtr);
BOOST_CHECK_EQUAL(expectedDataContent, block); BOOST_CHECK_EQUAL(expectedDataContent, block);
+2 -2
View File
@@ -99,7 +99,7 @@ public:
} }
public: 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 class NlsrFixture : public MockNfdMgmtFixture
@@ -138,7 +138,7 @@ public:
AdjacencyList& neighbors; AdjacencyList& neighbors;
uint32_t nSuccessCallbacks; uint32_t nSuccessCallbacks;
uint32_t nFailureCallbacks; uint32_t nFailureCallbacks;
ndn::util::signal::ScopedConnection connection; ndn::signal::ScopedConnection connection;
}; };
BOOST_FIXTURE_TEST_SUITE(TestNlsr, NlsrFixture) BOOST_FIXTURE_TEST_SUITE(TestNlsr, NlsrFixture)
+1 -1
View File
@@ -111,7 +111,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
Nlsr nlsr; Nlsr nlsr;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -63,7 +63,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -87,7 +87,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ConfParameter conf; ConfParameter conf;
DummyConfFileProcessor confProcessor; DummyConfFileProcessor confProcessor;
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -125,7 +125,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::Name siteIdentityName; ndn::Name siteIdentityName;
ndn::security::pib::Identity siteIdentity; ndn::security::pib::Identity siteIdentity;
+2 -2
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* -*- 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, * Regents of the University of California,
* Arizona Board of Regents. * Arizona Board of Regents.
* *
@@ -154,7 +154,7 @@ public:
} }
public: public:
ndn::util::DummyClientFace face; ndn::DummyClientFace face;
ndn::Name siteIdentityName, routerIdName; ndn::Name siteIdentityName, routerIdName;
ndn::security::pib::Identity siteIdentity, routerId; ndn::security::pib::Identity siteIdentity, routerId;
+2 -2
View File
@@ -334,7 +334,7 @@ Nlsrc::fetchFromLsdb(const ndn::Name::Component& datasetType,
name.append(datasetType); name.append(datasetType);
ndn::Interest interest(name); 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<T>, this, _1, recordLsa)); fetcher->onComplete.connect(std::bind(&Nlsrc::onFetchSuccess<T>, this, _1, recordLsa));
fetcher->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2)); fetcher->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2));
} }
@@ -363,7 +363,7 @@ Nlsrc::fetchFromRt(const std::function<void(const T&)>& recordDataset)
name.append(RT_SUFFIX); name.append(RT_SUFFIX);
ndn::Interest interest(name); 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<T>, this, _1, recordDataset)); fetcher->onComplete.connect(std::bind(&Nlsrc::onFetchSuccess<T>, this, _1, recordDataset));
fetcher->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2)); fetcher->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2));
} }