face: remove EndpointId from egress APIs in transport
refs: #4973
Change-Id: I43ca0c0826ec132413c584a1daa2d4687a4965fd
diff --git a/daemon/face/datagram-transport.hpp b/daemon/face/datagram-transport.hpp
index dfe8bee..7798cc8 100644
--- a/daemon/face/datagram-transport.hpp
+++ b/daemon/face/datagram-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -69,7 +69,7 @@
doClose() override;
void
- doSend(const Block& packet, const EndpointId& endpoint) override;
+ doSend(const Block& packet) override;
void
handleSend(const boost::system::error_code& error, size_t nBytesSent);
@@ -157,7 +157,7 @@
template<class T, class U>
void
-DatagramTransport<T, U>::doSend(const Block& packet, const EndpointId&)
+DatagramTransport<T, U>::doSend(const Block& packet)
{
NFD_LOG_FACE_TRACE(__func__);
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index 5a810a3..e98a9a7 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.cpp
@@ -110,7 +110,7 @@
}
void
-EthernetTransport::doSend(const Block& packet, const EndpointId&)
+EthernetTransport::doSend(const Block& packet)
{
NFD_LOG_FACE_TRACE(__func__);
diff --git a/daemon/face/ethernet-transport.hpp b/daemon/face/ethernet-transport.hpp
index a88b95b..8c929d1 100644
--- a/daemon/face/ethernet-transport.hpp
+++ b/daemon/face/ethernet-transport.hpp
@@ -81,7 +81,7 @@
handleNetifStateChange(ndn::net::InterfaceState netifState);
void
- doSend(const Block& packet, const EndpointId& endpoint) final;
+ doSend(const Block& packet) final;
/**
* @brief Sends the specified TLV block on the network wrapped in an Ethernet frame
diff --git a/daemon/face/internal-transport.cpp b/daemon/face/internal-transport.cpp
index e5d598a..a477b14 100644
--- a/daemon/face/internal-transport.cpp
+++ b/daemon/face/internal-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -55,7 +55,7 @@
}
void
-InternalForwarderTransport::doSend(const Block& packet, const EndpointId&)
+InternalForwarderTransport::doSend(const Block& packet)
{
NFD_LOG_FACE_TRACE("Sending to " << m_peer);
diff --git a/daemon/face/internal-transport.hpp b/daemon/face/internal-transport.hpp
index 71ae4d5..fbe4f06 100644
--- a/daemon/face/internal-transport.hpp
+++ b/daemon/face/internal-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -71,7 +71,7 @@
private:
void
- doSend(const Block& packet, const EndpointId& endpoint) final;
+ doSend(const Block& packet) final;
private:
NFD_LOG_MEMBER_DECL();
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index 5017e7d..0ea9687 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -82,7 +82,7 @@
}
void
-MulticastUdpTransport::doSend(const Block& packet, const EndpointId&)
+MulticastUdpTransport::doSend(const Block& packet)
{
NFD_LOG_FACE_TRACE(__func__);
diff --git a/daemon/face/multicast-udp-transport.hpp b/daemon/face/multicast-udp-transport.hpp
index c85df82..3e17dc9 100644
--- a/daemon/face/multicast-udp-transport.hpp
+++ b/daemon/face/multicast-udp-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -84,7 +84,7 @@
private:
void
- doSend(const Block& packet, const EndpointId& endpoint) final;
+ doSend(const Block& packet) final;
void
doClose() final;
diff --git a/daemon/face/null-transport.hpp b/daemon/face/null-transport.hpp
index 303b1e8..dc4f3b8 100644
--- a/daemon/face/null-transport.hpp
+++ b/daemon/face/null-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
private:
void
- doSend(const Block&, const EndpointId&) OVERRIDE_WITH_TESTS_ELSE_FINAL
+ doSend(const Block&) OVERRIDE_WITH_TESTS_ELSE_FINAL
{
}
};
diff --git a/daemon/face/stream-transport.hpp b/daemon/face/stream-transport.hpp
index 04941b5..a6fcb74 100644
--- a/daemon/face/stream-transport.hpp
+++ b/daemon/face/stream-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -63,7 +63,7 @@
deferredClose();
void
- doSend(const Block& packet, const EndpointId& endpoint) override;
+ doSend(const Block& packet) override;
void
sendFromQueue();
@@ -180,7 +180,7 @@
template<class T>
void
-StreamTransport<T>::doSend(const Block& packet, const EndpointId&)
+StreamTransport<T>::doSend(const Block& packet)
{
NFD_LOG_FACE_TRACE(__func__);
diff --git a/daemon/face/transport.cpp b/daemon/face/transport.cpp
index 6b235bc..467843e 100644
--- a/daemon/face/transport.cpp
+++ b/daemon/face/transport.cpp
@@ -89,7 +89,7 @@
}
void
-Transport::send(const Block& packet, const EndpointId& endpoint)
+Transport::send(const Block& packet)
{
BOOST_ASSERT(packet.isValid());
BOOST_ASSERT(this->getMtu() == MTU_UNLIMITED ||
@@ -106,7 +106,7 @@
this->nOutBytes += packet.size();
}
- this->doSend(packet, endpoint);
+ this->doSend(packet);
}
void
diff --git a/daemon/face/transport.hpp b/daemon/face/transport.hpp
index d3840bc..9fb9c03 100644
--- a/daemon/face/transport.hpp
+++ b/daemon/face/transport.hpp
@@ -165,12 +165,11 @@
/** \brief Send a link-layer packet
* \param packet the packet to be sent, must be a valid and well-formed TLV block
- * \param endpoint the destination endpoint
* \note This operation has no effect if getState() is neither UP nor DOWN
* \warning Behavior is undefined if packet size exceeds the MTU limit
*/
void
- send(const Block& packet, const EndpointId& endpoint = 0);
+ send(const Block& packet);
public: // static properties
/** \return a FaceUri representing local endpoint
@@ -333,11 +332,10 @@
private: // to be overridden by subclass
/** \brief performs Transport specific operations to send a packet
* \param packet the packet to be sent, can be assumed to be valid and well-formed
- * \param endpoint the destination endpoint
* \pre transport state is either UP or DOWN
*/
virtual void
- doSend(const Block& packet, const EndpointId& endpoint) = 0;
+ doSend(const Block& packet) = 0;
private:
Face* m_face;
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index bd45711..3ac0023 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -78,7 +78,7 @@
}
void
-WebSocketTransport::doSend(const Block& packet, const EndpointId&)
+WebSocketTransport::doSend(const Block& packet)
{
NFD_LOG_FACE_TRACE(__func__);
diff --git a/daemon/face/websocket-transport.hpp b/daemon/face/websocket-transport.hpp
index 10f4b2a..b71206a 100644
--- a/daemon/face/websocket-transport.hpp
+++ b/daemon/face/websocket-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -83,7 +83,7 @@
private:
void
- doSend(const Block& packet, const EndpointId& endpoint) final;
+ doSend(const Block& packet) final;
void
schedulePing();
diff --git a/tests/daemon/face/dummy-transport.hpp b/tests/daemon/face/dummy-transport.hpp
index 3f3141e..8ebb582 100644
--- a/tests/daemon/face/dummy-transport.hpp
+++ b/tests/daemon/face/dummy-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,12 +34,6 @@
namespace face {
namespace tests {
-struct TxPacket
-{
- Block packet;
- EndpointId endpoint;
-};
-
/** \brief Dummy Transport type used in unit tests.
*
* All packets sent through this transport are stored in `sentPackets`.
@@ -101,14 +95,14 @@
private:
void
- doSend(const Block& packet, const EndpointId& endpoint) override
+ doSend(const Block& packet) override
{
- sentPackets.push_back({packet, endpoint});
+ sentPackets.push_back(packet);
}
public:
std::vector<ndn::nfd::FacePersistency> persistencyHistory;
- std::vector<TxPacket> sentPackets;
+ std::vector<Block> sentPackets;
private:
ssize_t m_sendQueueLength = 0;
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index b78ada6..568dafc 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -110,7 +110,7 @@
BOOST_CHECK_EQUAL(service->getCounters().nOutInterests, 1);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet interest1pkt(transport->sentPackets.back().packet);
+ lp::Packet interest1pkt(transport->sentPackets.back());
BOOST_CHECK(interest1pkt.has<lp::FragmentField>());
BOOST_CHECK(!interest1pkt.has<lp::SequenceField>());
}
@@ -127,7 +127,7 @@
BOOST_CHECK_EQUAL(service->getCounters().nOutData, 1);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet data1pkt(transport->sentPackets.back().packet);
+ lp::Packet data1pkt(transport->sentPackets.back());
BOOST_CHECK(data1pkt.has<lp::FragmentField>());
BOOST_CHECK(!data1pkt.has<lp::SequenceField>());
}
@@ -200,7 +200,7 @@
BOOST_CHECK_EQUAL(service->getCounters().nOutNacks, 1);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet nack1pkt(transport->sentPackets.back().packet);
+ lp::Packet nack1pkt(transport->sentPackets.back());
BOOST_CHECK(nack1pkt.has<lp::NackField>());
BOOST_CHECK(nack1pkt.has<lp::FragmentField>());
BOOST_CHECK(!nack1pkt.has<lp::SequenceField>());
@@ -508,7 +508,7 @@
BOOST_CHECK_EQUAL(service->getCounters().nOutInterests, 1);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet interest1pkt(transport->sentPackets.back().packet);
+ lp::Packet interest1pkt(transport->sentPackets.back());
BOOST_CHECK(interest1pkt.has<lp::FragmentField>());
BOOST_CHECK(interest1pkt.has<lp::TxSequenceField>());
}
@@ -526,7 +526,7 @@
BOOST_CHECK_EQUAL(service->getCounters().nOutData, 1);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet data1pkt(transport->sentPackets.back().packet);
+ lp::Packet data1pkt(transport->sentPackets.back());
BOOST_CHECK(data1pkt.has<lp::FragmentField>());
BOOST_CHECK(data1pkt.has<lp::TxSequenceField>());
}
@@ -545,7 +545,7 @@
BOOST_CHECK_EQUAL(service->getCounters().nOutNacks, 1);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet nack1pkt(transport->sentPackets.back().packet);
+ lp::Packet nack1pkt(transport->sentPackets.back());
BOOST_CHECK(nack1pkt.has<lp::NackField>());
BOOST_CHECK(nack1pkt.has<lp::FragmentField>());
BOOST_CHECK(nack1pkt.has<lp::TxSequenceField>());
@@ -601,7 +601,7 @@
transport->setSendQueueLength(0);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet pkt1(transport->sentPackets.back().packet);
+ lp::Packet pkt1(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt1.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -611,7 +611,7 @@
transport->setSendQueueLength(32768);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 2);
- lp::Packet pkt2(transport->sentPackets.back().packet);
+ lp::Packet pkt2(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -634,7 +634,7 @@
transport->setSendQueueLength(65537);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet pkt0(transport->sentPackets.back().packet);
+ lp::Packet pkt0(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt0.count<lp::CongestionMarkField>(), 0);
time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
@@ -645,7 +645,7 @@
advanceClocks(markingInterval + 1_ms);
face->sendInterest(*interest);
- lp::Packet pkt1(transport->sentPackets.back().packet);
+ lp::Packet pkt1(transport->sentPackets.back());
// First congestion mark appears after one interval (100 ms)
BOOST_REQUIRE_EQUAL(pkt1.count<lp::CongestionMarkField>(), 1);
@@ -660,7 +660,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 3);
- lp::Packet pkt2(transport->sentPackets.back().packet);
+ lp::Packet pkt2(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
markingInterval = time::nanoseconds(
@@ -679,7 +679,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 4);
- lp::Packet pkt3(transport->sentPackets.back().packet);
+ lp::Packet pkt3(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt3.count<lp::CongestionMarkField>(), 1);
BOOST_CHECK_EQUAL(pkt3.get<lp::CongestionMarkField>(), 1);
markingInterval = time::nanoseconds(
@@ -697,7 +697,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 5);
- lp::Packet pkt4(transport->sentPackets.back().packet);
+ lp::Packet pkt4(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt4.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 2);
@@ -710,7 +710,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 6);
- lp::Packet pkt5(transport->sentPackets.back().packet);
+ lp::Packet pkt5(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt5.count<lp::CongestionMarkField>(), 1);
BOOST_CHECK_EQUAL(pkt5.get<lp::CongestionMarkField>(), 1);
markingInterval = time::nanoseconds(
@@ -727,7 +727,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 7);
- lp::Packet pkt6(transport->sentPackets.back().packet);
+ lp::Packet pkt6(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt6.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 3);
@@ -739,7 +739,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 8);
- lp::Packet pkt7(transport->sentPackets.back().packet);
+ lp::Packet pkt7(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt7.count<lp::CongestionMarkField>(), 1);
BOOST_CHECK_EQUAL(pkt7.get<lp::CongestionMarkField>(), 1);
markingInterval = time::nanoseconds(
@@ -754,7 +754,7 @@
transport->setSendQueueLength(30000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 9);
- lp::Packet pkt8(transport->sentPackets.back().packet);
+ lp::Packet pkt8(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt8.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -766,7 +766,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 10);
- lp::Packet pkt9(transport->sentPackets.back().packet);
+ lp::Packet pkt9(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt9.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
markingInterval = time::nanoseconds(
@@ -784,7 +784,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 11);
- lp::Packet pkt10(transport->sentPackets.back().packet);
+ lp::Packet pkt10(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt10.count<lp::CongestionMarkField>(), 1);
BOOST_CHECK_EQUAL(pkt10.get<lp::CongestionMarkField>(), 1);
markingInterval = time::nanoseconds(
@@ -802,7 +802,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 12);
- lp::Packet pkt11(transport->sentPackets.back().packet);
+ lp::Packet pkt11(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt11.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 1);
@@ -815,7 +815,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 13);
- lp::Packet pkt12(transport->sentPackets.back().packet);
+ lp::Packet pkt12(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt12.count<lp::CongestionMarkField>(), 1);
BOOST_CHECK_EQUAL(pkt12.get<lp::CongestionMarkField>(), 1);
markingInterval = time::nanoseconds(
@@ -830,7 +830,7 @@
transport->setSendQueueLength(10000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 14);
- lp::Packet pkt13(transport->sentPackets.back().packet);
+ lp::Packet pkt13(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt13.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -843,7 +843,7 @@
transport->setSendQueueLength(66000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 15);
- lp::Packet pkt14(transport->sentPackets.back().packet);
+ lp::Packet pkt14(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt14.count<lp::CongestionMarkField>(), 0);
nextMarkTime = time::steady_clock::now() + 100_ms;
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
@@ -854,7 +854,7 @@
transport->setSendQueueLength(5000);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 16);
- lp::Packet pkt15(transport->sentPackets.back().packet);
+ lp::Packet pkt15(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt15.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -880,7 +880,7 @@
transport->setSendQueueLength(0);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet pkt1(transport->sentPackets.back().packet);
+ lp::Packet pkt1(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt1.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -890,7 +890,7 @@
transport->setSendQueueLength(65536);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 2);
- lp::Packet pkt2(transport->sentPackets.back().packet);
+ lp::Packet pkt2(transport->sentPackets.back());
BOOST_CHECK_EQUAL(pkt2.count<lp::CongestionMarkField>(), 0);
BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -900,7 +900,7 @@
transport->setSendQueueLength(65537);
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 3);
- lp::Packet pkt3(transport->sentPackets.back().packet);
+ lp::Packet pkt3(transport->sentPackets.back());
BOOST_REQUIRE_EQUAL(pkt3.count<lp::CongestionMarkField>(), 0);
time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
@@ -1059,7 +1059,7 @@
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_REQUIRE(sent.has<lp::IncomingFaceIdField>());
BOOST_CHECK_EQUAL(sent.get<lp::IncomingFaceIdField>(), 1000);
}
@@ -1077,7 +1077,7 @@
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_CHECK(!sent.has<lp::IncomingFaceIdField>());
}
@@ -1145,7 +1145,7 @@
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_REQUIRE(sent.has<lp::CongestionMarkField>());
BOOST_CHECK_EQUAL(sent.get<lp::CongestionMarkField>(), 1);
}
@@ -1158,7 +1158,7 @@
face->sendData(*data);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_REQUIRE(sent.has<lp::CongestionMarkField>());
BOOST_CHECK_EQUAL(sent.get<lp::CongestionMarkField>(), 0);
}
@@ -1172,7 +1172,7 @@
face->sendNack(nack);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_REQUIRE(sent.has<lp::CongestionMarkField>());
BOOST_CHECK_EQUAL(sent.get<lp::CongestionMarkField>(), std::numeric_limits<uint64_t>::max());
}
@@ -1235,7 +1235,7 @@
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_CHECK(sent.has<lp::NonDiscoveryField>());
}
@@ -1251,7 +1251,7 @@
face->sendInterest(*interest);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_CHECK(!sent.has<lp::NonDiscoveryField>());
}
@@ -1339,7 +1339,7 @@
face->sendData(*data);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_CHECK(sent.has<lp::PrefixAnnouncementField>());
}
@@ -1356,7 +1356,7 @@
face->sendData(*data);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sent(transport->sentPackets.back().packet);
+ lp::Packet sent(transport->sentPackets.back());
BOOST_CHECK(!sent.has<lp::PrefixAnnouncementField>());
}
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index b45ae98..ff1acc3 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -181,7 +181,7 @@
linkService->sendLpPackets({pkt1});
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet cached1(transport->sentPackets.front().packet);
+ lp::Packet cached1(transport->sentPackets.front());
BOOST_REQUIRE(cached1.has<lp::TxSequenceField>());
BOOST_CHECK(cached1.has<lp::SequenceField>());
lp::Sequence firstTxSeq = cached1.get<lp::TxSequenceField>();
@@ -311,17 +311,17 @@
linkService->sendLpPackets({pkt1, pkt2, pkt3});
BOOST_CHECK_EQUAL(transport->sentPackets.size(), 3);
- lp::Packet cached1(transport->sentPackets.at(0).packet);
+ lp::Packet cached1(transport->sentPackets.at(0));
BOOST_REQUIRE(cached1.has<lp::TxSequenceField>());
BOOST_CHECK_EQUAL(cached1.get<lp::TxSequenceField>(), 2);
BOOST_CHECK(cached1.has<lp::SequenceField>());
BOOST_CHECK_EQUAL(getPktNum(cached1), 2048);
- lp::Packet cached2(transport->sentPackets.at(1).packet);
+ lp::Packet cached2(transport->sentPackets.at(1));
BOOST_REQUIRE(cached2.has<lp::TxSequenceField>());
BOOST_CHECK_EQUAL(cached2.get<lp::TxSequenceField>(), 3);
BOOST_CHECK(cached2.has<lp::SequenceField>());
BOOST_CHECK_EQUAL(getPktNum(cached2), 2049);
- lp::Packet cached3(transport->sentPackets.at(2).packet);
+ lp::Packet cached3(transport->sentPackets.at(2));
BOOST_REQUIRE(cached3.has<lp::TxSequenceField>());
BOOST_CHECK_EQUAL(cached3.get<lp::TxSequenceField>(), 4);
BOOST_CHECK(cached3.has<lp::SequenceField>());
@@ -615,7 +615,7 @@
BOOST_CHECK_EQUAL(reliability->m_unackedFrags.at(4).nGreaterSeqAcks, 0);
BOOST_CHECK_EQUAL(reliability->m_firstUnackedFrag->first, 3);
BOOST_CHECK_EQUAL(transport->sentPackets.size(), 6);
- lp::Packet sentRetxPkt(transport->sentPackets.back().packet);
+ lp::Packet sentRetxPkt(transport->sentPackets.back());
BOOST_REQUIRE(sentRetxPkt.has<lp::TxSequenceField>());
BOOST_CHECK_EQUAL(sentRetxPkt.get<lp::TxSequenceField>(), 4);
BOOST_CHECK_EQUAL(getPktNum(sentRetxPkt), 1);
@@ -756,7 +756,7 @@
linkService->sendLpPackets({pkt});
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sentPkt(transport->sentPackets.front().packet);
+ lp::Packet sentPkt(transport->sentPackets.front());
BOOST_REQUIRE_EQUAL(sentPkt.count<lp::AckField>(), 3);
BOOST_CHECK_EQUAL(sentPkt.get<lp::AckField>(0), 256);
@@ -786,7 +786,7 @@
linkService->sendLpPackets({pkt});
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), i);
- lp::Packet sentPkt(transport->sentPackets.back().packet);
+ lp::Packet sentPkt(transport->sentPackets.back());
BOOST_CHECK_EQUAL(getPktNum(sentPkt), i);
BOOST_CHECK(sentPkt.has<lp::AckField>());
@@ -815,7 +815,7 @@
linkService->sendLpPackets({pkt});
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sentPkt(transport->sentPackets.back().packet);
+ lp::Packet sentPkt(transport->sentPackets.back());
BOOST_CHECK_EQUAL(getPktNum(sentPkt), 1);
BOOST_CHECK(!sentPkt.has<lp::AckField>());
@@ -887,7 +887,7 @@
BOOST_CHECK_EQUAL(reliability->m_ackQueue.size(), 0);
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
- lp::Packet sentPkt(transport->sentPackets.back().packet);
+ lp::Packet sentPkt(transport->sentPackets.back());
BOOST_CHECK(!sentPkt.has<lp::TxSequenceField>());
for (lp::Sequence ack : sentPkt.list<lp::AckField>()) {
BOOST_CHECK_EQUAL(expectedAcks.erase(ack), 1);
@@ -926,7 +926,7 @@
// 124 Acks per LpPacket, and it takes 5 LpPackets to carry 500 Acks.
BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 5);
for (size_t i = 0; i < 5; i++) {
- lp::Packet sentPkt(transport->sentPackets[i].packet);
+ lp::Packet sentPkt(transport->sentPackets[i]);
BOOST_CHECK(!sentPkt.has<lp::TxSequenceField>());
BOOST_CHECK_EQUAL(sentPkt.count<lp::AckField>(), i == 4 ? 4 : 124);
for (lp::Sequence ack : sentPkt.list<lp::AckField>()) {
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index 6bb5896..7e650dd 100644
--- a/tests/daemon/face/transport.t.cpp
+++ b/tests/daemon/face/transport.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -193,7 +193,7 @@
protected:
unique_ptr<nfd::Face> face;
DummyTransport* transport = nullptr;
- const std::vector<TxPacket>* sentPackets = nullptr;
+ const std::vector<Block>* sentPackets = nullptr;
const std::vector<RxPacket>* receivedPackets = nullptr;
};
@@ -218,9 +218,9 @@
BOOST_CHECK_EQUAL(transport->getCounters().nOutPackets, 2);
BOOST_CHECK_EQUAL(transport->getCounters().nOutBytes, pkt1.size() + pkt2.size());
BOOST_REQUIRE_EQUAL(sentPackets->size(), 3);
- BOOST_CHECK(sentPackets->at(0).packet == pkt1);
- BOOST_CHECK(sentPackets->at(1).packet == pkt2);
- BOOST_CHECK(sentPackets->at(2).packet == pkt3);
+ BOOST_CHECK(sentPackets->at(0) == pkt1);
+ BOOST_CHECK(sentPackets->at(1) == pkt2);
+ BOOST_CHECK(sentPackets->at(2) == pkt3);
}
BOOST_FIXTURE_TEST_CASE(Receive, DummyTransportFixture)