face: remove EndpointId from egress APIs
This commit partially reverts 075bb7dac4bf72cbfcff5e3c2da25c6476090787
refs: #4843, #4973
Change-Id: Iab92addff2bd0fa1e24100d43f9f7076ee84a3f8
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 1bb474e..8228885 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -75,20 +75,20 @@
close();
public: // upper interface connected to forwarding
- /** \brief send Interest to \p endpointId
+ /** \brief send Interest
*/
void
- sendInterest(const Interest& interest, const EndpointId& endpointId);
+ sendInterest(const Interest& interest);
- /** \brief send Data to \p endpointId
+ /** \brief send Data
*/
void
- sendData(const Data& data, const EndpointId& endpointId);
+ sendData(const Data& data);
- /** \brief send Nack to \p endpointId
+ /** \brief send Nack
*/
void
- sendNack(const lp::Nack& nack, const EndpointId& endpointId);
+ sendNack(const lp::Nack& nack);
/** \brief signals on Interest received
*/
@@ -218,21 +218,21 @@
}
inline void
-Face::sendInterest(const Interest& interest, const EndpointId& endpointId)
+Face::sendInterest(const Interest& interest)
{
- m_service->sendInterest(interest, endpointId);
+ m_service->sendInterest(interest);
}
inline void
-Face::sendData(const Data& data, const EndpointId& endpointId)
+Face::sendData(const Data& data)
{
- m_service->sendData(data, endpointId);
+ m_service->sendData(data);
}
inline void
-Face::sendNack(const lp::Nack& nack, const EndpointId& endpointId)
+Face::sendNack(const lp::Nack& nack)
{
- m_service->sendNack(nack, endpointId);
+ m_service->sendNack(nack);
}
inline FaceId
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index af03ffd..819a91a 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -82,16 +82,16 @@
}
void
-GenericLinkService::requestIdlePacket(const EndpointId& endpointId)
+GenericLinkService::requestIdlePacket()
{
// No need to request Acks to attach to this packet from LpReliability, as they are already
// attached in sendLpPacket
NFD_LOG_FACE_TRACE("IDLE packet requested");
- this->sendLpPacket({}, endpointId);
+ this->sendLpPacket({});
}
void
-GenericLinkService::sendLpPacket(lp::Packet&& pkt, const EndpointId& endpointId)
+GenericLinkService::sendLpPacket(lp::Packet&& pkt)
{
const ssize_t mtu = getEffectiveMtu();
@@ -109,38 +109,38 @@
NFD_LOG_FACE_WARN("attempted to send packet over MTU limit");
return;
}
- this->sendPacket(block, endpointId);
+ this->sendPacket(block);
}
void
-GenericLinkService::doSendInterest(const Interest& interest, const EndpointId& endpointId)
+GenericLinkService::doSendInterest(const Interest& interest)
{
lp::Packet lpPacket(interest.wireEncode());
encodeLpFields(interest, lpPacket);
- this->sendNetPacket(std::move(lpPacket), endpointId, true);
+ this->sendNetPacket(std::move(lpPacket), true);
}
void
-GenericLinkService::doSendData(const Data& data, const EndpointId& endpointId)
+GenericLinkService::doSendData(const Data& data)
{
lp::Packet lpPacket(data.wireEncode());
encodeLpFields(data, lpPacket);
- this->sendNetPacket(std::move(lpPacket), endpointId, false);
+ this->sendNetPacket(std::move(lpPacket), false);
}
void
-GenericLinkService::doSendNack(const lp::Nack& nack, const EndpointId& endpointId)
+GenericLinkService::doSendNack(const lp::Nack& nack)
{
lp::Packet lpPacket(nack.getInterest().wireEncode());
lpPacket.add<lp::NackField>(nack.getHeader());
encodeLpFields(nack, lpPacket);
- this->sendNetPacket(std::move(lpPacket), endpointId, false);
+ this->sendNetPacket(std::move(lpPacket), false);
}
void
@@ -185,7 +185,7 @@
}
void
-GenericLinkService::sendNetPacket(lp::Packet&& pkt, const EndpointId& endpointId, bool isInterest)
+GenericLinkService::sendNetPacket(lp::Packet&& pkt, bool isInterest)
{
std::vector<lp::Packet> frags;
ssize_t mtu = getEffectiveMtu();
@@ -238,7 +238,7 @@
}
for (lp::Packet& frag : frags) {
- this->sendLpPacket(std::move(frag), endpointId);
+ this->sendLpPacket(std::move(frag));
}
}
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 38473f5..7a1dd4f 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -200,27 +200,21 @@
/** \brief request an IDLE packet to transmit pending service fields
*/
void
- requestIdlePacket(const EndpointId& endpointId);
+ requestIdlePacket();
- /** \brief send an LpPacket to \p endpointId
+ /** \brief send an LpPacket
*/
void
- sendLpPacket(lp::Packet&& pkt, const EndpointId& endpointId);
+ sendLpPacket(lp::Packet&& pkt);
- /** \brief send Interest
- */
void
- doSendInterest(const Interest& interest, const EndpointId& endpointId) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doSendInterest(const Interest& interest) OVERRIDE_WITH_TESTS_ELSE_FINAL;
- /** \brief send Data
- */
void
- doSendData(const Data& data, const EndpointId& endpointId) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doSendData(const Data& data) OVERRIDE_WITH_TESTS_ELSE_FINAL;
- /** \brief send Nack
- */
void
- doSendNack(const ndn::lp::Nack& nack, const EndpointId& endpointId) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doSendNack(const ndn::lp::Nack& nack) OVERRIDE_WITH_TESTS_ELSE_FINAL;
/** \brief assign consecutive sequence numbers to LpPackets
*/
@@ -237,11 +231,10 @@
/** \brief send a complete network layer packet
* \param pkt LpPacket containing a complete network layer packet
- * \param endpointId destination endpoint to which LpPacket will be sent
* \param isInterest whether the network layer packet is an Interest
*/
void
- sendNetPacket(lp::Packet&& pkt, const EndpointId& endpointId, bool isInterest);
+ sendNetPacket(lp::Packet&& pkt, bool isInterest);
/** \brief if the send queue is found to be congested, add a congestion mark to the packet
* according to CoDel
@@ -251,8 +244,6 @@
checkCongestionLevel(lp::Packet& pkt);
private: // receive path
- /** \brief receive Packet from Transport
- */
void
doReceivePacket(const Block& packet, const EndpointId& endpoint) OVERRIDE_WITH_TESTS_ELSE_FINAL;
diff --git a/daemon/face/link-service.cpp b/daemon/face/link-service.cpp
index df0fe9c..6527dbd 100644
--- a/daemon/face/link-service.cpp
+++ b/daemon/face/link-service.cpp
@@ -52,36 +52,36 @@
}
void
-LinkService::sendInterest(const Interest& interest, const EndpointId& endpoint)
+LinkService::sendInterest(const Interest& interest)
{
BOOST_ASSERT(m_transport != nullptr);
NFD_LOG_FACE_TRACE(__func__);
++this->nOutInterests;
- doSendInterest(interest, endpoint);
+ doSendInterest(interest);
}
void
-LinkService::sendData(const Data& data, const EndpointId& endpoint)
+LinkService::sendData(const Data& data)
{
BOOST_ASSERT(m_transport != nullptr);
NFD_LOG_FACE_TRACE(__func__);
++this->nOutData;
- doSendData(data, endpoint);
+ doSendData(data);
}
void
-LinkService::sendNack(const ndn::lp::Nack& nack, const EndpointId& endpoint)
+LinkService::sendNack(const ndn::lp::Nack& nack)
{
BOOST_ASSERT(m_transport != nullptr);
NFD_LOG_FACE_TRACE(__func__);
++this->nOutNacks;
- doSendNack(nack, endpoint);
+ doSendNack(nack);
}
void
diff --git a/daemon/face/link-service.hpp b/daemon/face/link-service.hpp
index c239cf2..c623622 100644
--- a/daemon/face/link-service.hpp
+++ b/daemon/face/link-service.hpp
@@ -113,23 +113,23 @@
getEffectiveMtu() const;
public: // upper interface to be used by forwarding
- /** \brief Send Interest to \p endpoint
+ /** \brief Send Interest
* \pre setTransport has been called
*/
void
- sendInterest(const Interest& interest, const EndpointId& endpoint);
+ sendInterest(const Interest& interest);
- /** \brief Send Data to \p endpoint
+ /** \brief Send Data
* \pre setTransport has been called
*/
void
- sendData(const Data& data, const EndpointId& endpoint);
+ sendData(const Data& data);
- /** \brief Send Nack to \p endpoint
+ /** \brief Send Nack
* \pre setTransport has been called
*/
void
- sendNack(const ndn::lp::Nack& nack, const EndpointId& endpoint);
+ sendNack(const ndn::lp::Nack& nack);
/** \brief signals on Interest received
*/
@@ -170,30 +170,30 @@
receiveNack(const lp::Nack& nack, const EndpointId& endpoint);
protected: // lower interface to be invoked in subclass (send path termination)
- /** \brief send a lower-layer packet via Transport to \p endpoint
+ /** \brief send a lower-layer packet via Transport
*/
void
- sendPacket(const Block& packet, const EndpointId& endpoint);
+ sendPacket(const Block& packet);
protected:
void
notifyDroppedInterest(const Interest& packet);
private: // upper interface to be overridden in subclass (send path entrypoint)
- /** \brief performs LinkService specific operations to send an Interest to \p endpoint
+ /** \brief performs LinkService specific operations to send an Interest
*/
virtual void
- doSendInterest(const Interest& interest, const EndpointId& endpoint) = 0;
+ doSendInterest(const Interest& interest) = 0;
- /** \brief performs LinkService specific operations to send a Data to \p endpoint
+ /** \brief performs LinkService specific operations to send a Data
*/
virtual void
- doSendData(const Data& data, const EndpointId& endpoint) = 0;
+ doSendData(const Data& data) = 0;
- /** \brief performs LinkService specific operations to send a Nack to \p endpoint
+ /** \brief performs LinkService specific operations to send a Nack
*/
virtual void
- doSendNack(const lp::Nack& nack, const EndpointId& endpoint) = 0;
+ doSendNack(const lp::Nack& nack) = 0;
private: // lower interface to be overridden in subclass
virtual void
@@ -241,9 +241,9 @@
}
inline void
-LinkService::sendPacket(const Block& packet, const EndpointId& endpoint)
+LinkService::sendPacket(const Block& packet)
{
- m_transport->send(packet, endpoint);
+ m_transport->send(packet);
}
std::ostream&
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index 21189be..f387add 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -242,7 +242,7 @@
m_idleAckTimer = getScheduler().schedule(m_options.idleAckTimerPeriod, [this] {
while (!m_ackQueue.empty()) {
- m_linkService->requestIdlePacket(0);
+ m_linkService->requestIdlePacket();
}
});
}
@@ -346,7 +346,7 @@
deleteUnackedFrag(txSeqIt);
// Retransmit fragment
- m_linkService->sendLpPacket(lp::Packet(newTxFrag.pkt), 0);
+ m_linkService->sendLpPacket(lp::Packet(newTxFrag.pkt));
auto rto = m_rttEst.getEstimatedRto();
NFD_LOG_FACE_TRACE("retransmitting seq=" << seq << ", txseq=" << newTxSeq << ", retx=" <<
diff --git a/daemon/face/null-link-service.hpp b/daemon/face/null-link-service.hpp
index 3823d9a..2ae26ab 100644
--- a/daemon/face/null-link-service.hpp
+++ b/daemon/face/null-link-service.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,
@@ -37,17 +37,17 @@
{
private:
void
- doSendInterest(const Interest&, const EndpointId&) final
+ doSendInterest(const Interest&) final
{
}
void
- doSendData(const Data&, const EndpointId&) final
+ doSendData(const Data&) final
{
}
void
- doSendNack(const lp::Nack&, const EndpointId&) final
+ doSendNack(const lp::Nack&) final
{
}
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index adfa3e1..1bc0acc 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -175,7 +175,7 @@
// note: Don't enter outgoing Nack pipeline because it needs an in-record.
lp::Nack nack(interest);
nack.setReason(lp::NackReason::DUPLICATE);
- ingress.face.sendNack(nack, ingress.endpoint);
+ ingress.face.sendNack(nack);
}
void
@@ -258,7 +258,7 @@
pitEntry->insertOrUpdateOutRecord(egress.face, interest);
// send Interest
- egress.face.sendInterest(interest, egress.endpoint);
+ egress.face.sendInterest(interest);
++m_counters.nOutInterests;
}
@@ -417,7 +417,7 @@
// TODO traffic manager
// send Data
- egress.face.sendData(data, egress.endpoint);
+ egress.face.sendData(data);
++m_counters.nOutData;
}
@@ -519,7 +519,7 @@
pitEntry->deleteInRecord(egress.face);
// send Nack on face
- egress.face.sendNack(nackPkt, egress.endpoint);
+ egress.face.sendNack(nackPkt);
++m_counters.nOutNacks;
}