Change namespace of DummyClientFace, Signal, Segmenter, SegmentFetcher
refs #3940 Change-Id: Ia3c9b4adcca9ff79a14be705ca9da525914f3dff
This commit is contained in:
1 parent
ecb0b7180e
commit
43f37a08fc
35 files changed
+106
-109
No files matched your search
@@ -83,7 +83,7 @@ public:
|
||||
void
|
||||
processInterest(const ndn::Name& name, const ndn::Interest& interest);
|
||||
|
||||
ndn::util::Signal<HelloProtocol, Statistics::PacketType> hpIncrementSignal;
|
||||
ndn::signal::Signal<HelloProtocol, Statistics::PacketType> hpIncrementSignal;
|
||||
|
||||
private:
|
||||
/*! \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 NLSR_COMPONENT{"nlsr"};
|
||||
|
||||
ndn::util::Signal<HelloProtocol, const ndn::Name&> onInitialHelloDataValidated;
|
||||
ndn::signal::Signal<HelloProtocol, const ndn::Name&> onInitialHelloDataValidated;
|
||||
|
||||
private:
|
||||
ndn::Face& m_face;
|
||||
|
||||
+3
-4
@@ -438,13 +438,12 @@ Lsdb::expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, uint
|
||||
if (incomingFaceId != 0) {
|
||||
interest.setTag(std::make_shared<ndn::lp::NextHopFaceIdTag>(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,
|
||||
|
||||
+6
-6
@@ -321,9 +321,9 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::Signal<Lsdb, Statistics::PacketType> lsaIncrementSignal;
|
||||
ndn::util::Signal<Lsdb, ndn::Data> afterSegmentValidatedSignal;
|
||||
using AfterLsdbModified = ndn::util::Signal<Lsdb, std::shared_ptr<Lsa>, LsdbUpdate,
|
||||
ndn::signal::Signal<Lsdb, Statistics::PacketType> lsaIncrementSignal;
|
||||
ndn::signal::Signal<Lsdb, ndn::Data> afterSegmentValidatedSignal;
|
||||
using AfterLsdbModified = ndn::signal::Signal<Lsdb, std::shared_ptr<Lsa>, LsdbUpdate,
|
||||
std::list<ndn::Name>, std::list<ndn::Name>>;
|
||||
AfterLsdbModified onLsdbModified;
|
||||
|
||||
@@ -346,10 +346,10 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
|
||||
|
||||
SequencingManager m_sequencingManager;
|
||||
|
||||
ndn::util::signal::ScopedConnection m_onNewLsaConnection;
|
||||
ndn::signal::ScopedConnection m_onNewLsaConnection;
|
||||
|
||||
std::set<std::shared_ptr<ndn::util::SegmentFetcher>> m_fetchers;
|
||||
ndn::util::Segmenter m_segmenter;
|
||||
std::set<std::shared_ptr<ndn::SegmentFetcher>> m_fetchers;
|
||||
ndn::Segmenter m_segmenter;
|
||||
ndn::InMemoryStorageFifo m_segmentFifo;
|
||||
|
||||
bool m_isBuildAdjLsaScheduled;
|
||||
|
||||
+3
-3
@@ -176,9 +176,9 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
|
||||
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;
|
||||
|
||||
+2
-2
@@ -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 @@ public:
|
||||
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<Fib, ndn::Name> onPrefixRegistrationSuccess;
|
||||
ndn::signal::Signal<Fib, ndn::Name> onPrefixRegistrationSuccess;
|
||||
|
||||
private:
|
||||
ndn::Scheduler& m_scheduler;
|
||||
|
||||
@@ -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 @@ private:
|
||||
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
|
||||
|
||||
@@ -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 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -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 @@ private:
|
||||
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
|
||||
|
||||
+3
-3
@@ -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<RoutingTable, std::list<RoutingTableEntry>>;
|
||||
using OnNewLsa = ndn::util::Signal<SyncLogicHandler, ndn::Name, uint64_t, ndn::Name, uint64_t>;
|
||||
using AfterRoutingChange = ndn::signal::Signal<RoutingTable, std::list<RoutingTableEntry>>;
|
||||
using OnNewLsa = ndn::signal::Signal<SyncLogicHandler, ndn::Name, uint64_t, ndn::Name, uint64_t>;
|
||||
|
||||
} // namespace nlsr
|
||||
|
||||
|
||||
@@ -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 @@ private:
|
||||
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
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
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<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) {
|
||||
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<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) {
|
||||
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<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) {
|
||||
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<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) {
|
||||
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<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) {
|
||||
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!");
|
||||
});
|
||||
|
||||
@@ -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 @@ public:
|
||||
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 @@ public:
|
||||
addNodes()
|
||||
{
|
||||
for (int i = 0; i < 2; i++) {
|
||||
faces[i] = std::make_shared<util::DummyClientFace>(m_io,
|
||||
util::DummyClientFace::Options{true, true});
|
||||
faces[i] = std::make_shared<ndn::DummyClientFace>(m_io, ndn::DummyClientFace::Options{true, true});
|
||||
userPrefixes[i] = Name(nameLsaUserPrefix).appendNumber(i);
|
||||
nodes[i] = std::make_shared<SyncProtocolAdapter>(*faces[i], m_keyChain, SyncProtocol::PSYNC,
|
||||
syncPrefix, userPrefixes[i],
|
||||
nodes[i] = std::make_shared<SyncProtocolAdapter>(
|
||||
*faces[i], m_keyChain, SyncProtocol::PSYNC, syncPrefix, userPrefixes[i],
|
||||
syncInterestLifetime,
|
||||
[i, this] (const ndn::Name& updateName,
|
||||
uint64_t highSeq, uint64_t incomingFaceId) {
|
||||
[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<ndn::util::DummyClientFace> faces[2];
|
||||
ndn::time::milliseconds syncInterestLifetime;
|
||||
std::shared_ptr<ndn::DummyClientFace> faces[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)
|
||||
@@ -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());
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
DummyConfFileProcessor confProcessor;
|
||||
Nlsr nlsr;
|
||||
|
||||
@@ -71,8 +71,8 @@ private:
|
||||
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;
|
||||
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
Nlsr nlsr;
|
||||
Map map;
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
DummyConfFileProcessor confProcessor;
|
||||
Nlsr nlsr;
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
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};
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
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};
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
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());
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<ndn::Data> data)
|
||||
}
|
||||
|
||||
void
|
||||
checkPrefixRegistered(const ndn::util::DummyClientFace& face, const ndn::Name& prefix);
|
||||
checkPrefixRegistered(const ndn::DummyClientFace& face, const ndn::Name& prefix);
|
||||
|
||||
class DummyConfFileProcessor
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
DummyConfFileProcessor confProcessor;
|
||||
AdjacencyList& adjList;
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
|
||||
ndn::Name rootIdName, siteIdentityName, opIdentityName, routerIdName;
|
||||
ndn::security::pib::Identity rootId, siteIdentity, opIdentity, routerId;
|
||||
|
||||
@@ -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 @@ public:
|
||||
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 @@ 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};
|
||||
DummyConfFileProcessor confProcessor{conf};
|
||||
Nlsr nlsr{face, m_keyChain, conf};
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
ndn::InMemoryStorageFifo ims{100};
|
||||
|
||||
int numValidationSignal = 0;
|
||||
ndn::util::signal::ScopedConnection afterSegmentValidatedConn;
|
||||
ndn::signal::ScopedConnection afterSegmentValidatedConn;
|
||||
};
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(TestLsaSegmentStorage, LsaSegmentStorageFixture)
|
||||
|
||||
+6
-6
@@ -110,7 +110,7 @@ public:
|
||||
}
|
||||
|
||||
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,10 +256,10 @@ 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),
|
||||
auto fetcher = ndn::SegmentFetcher::start(face2, ndn::Interest(interestName),
|
||||
ndn::security::getAcceptAllValidator());
|
||||
fetcher->onComplete.connect([&expectedDataContent] (ndn::ConstBufferPtr bufferPtr) {
|
||||
ndn::Block block(bufferPtr);
|
||||
|
||||
+2
-2
@@ -99,7 +99,7 @@ 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
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
AdjacencyList& neighbors;
|
||||
uint32_t nSuccessCallbacks;
|
||||
uint32_t nFailureCallbacks;
|
||||
ndn::util::signal::ScopedConnection connection;
|
||||
ndn::signal::ScopedConnection connection;
|
||||
};
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(TestNlsr, NlsrFixture)
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
DummyConfFileProcessor confProcessor;
|
||||
Nlsr nlsr;
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
DummyConfFileProcessor confProcessor;
|
||||
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ConfParameter conf;
|
||||
DummyConfFileProcessor confProcessor;
|
||||
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
|
||||
ndn::Name siteIdentityName;
|
||||
ndn::security::pib::Identity siteIdentity;
|
||||
|
||||
@@ -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 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
ndn::util::DummyClientFace face;
|
||||
ndn::DummyClientFace face;
|
||||
ndn::Name siteIdentityName, routerIdName;
|
||||
ndn::security::pib::Identity siteIdentity, routerId;
|
||||
|
||||
|
||||
+2
-2
@@ -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<T>, this, _1, recordLsa));
|
||||
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);
|
||||
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->onError.connect(std::bind(&Nlsrc::onTimeout, this, _1, _2));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user