You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by cm...@apache.org on 2023/02/16 16:45:32 UTC

[trafficserver] branch master updated: Remove UDP_stubs.h (#9413)

This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 2402444b58 Remove UDP_stubs.h (#9413)
2402444b58 is described below

commit 2402444b5864411f2415ae142ba81d7637656531
Author: Chris McFarlen <ch...@mcfarlen.us>
AuthorDate: Thu Feb 16 10:45:25 2023 -0600

    Remove UDP_stubs.h (#9413)
    
    Remove UDP_stubs.h
---
 include/tscore/UDP_stubs.h                         |  36 ------
 iocore/aio/test_AIO.cc                             |   3 -
 iocore/net/I_UDPPacket.h                           |  62 +++------
 iocore/net/P_UDPNet.h                              |   1 -
 iocore/net/P_UDPPacket.h                           | 143 ---------------------
 iocore/net/QUICPacketHandler.cc                    |   2 +-
 iocore/net/QUICPacketHandler_quiche.cc             |   2 +-
 iocore/net/UnixUDPNet.cc                           | 141 +++++++++++++++++++-
 iocore/net/quic/test/test_QUICAddrVerifyState.cc   |   2 -
 iocore/net/quic/test/test_QUICFlowController.cc    |   2 -
 iocore/net/quic/test/test_QUICFrame.cc             |   2 -
 iocore/net/quic/test/test_QUICFrameDispatcher.cc   |   2 -
 iocore/net/quic/test/test_QUICHandshakeProtocol.cc |   2 -
 iocore/net/quic/test/test_QUICLossDetector.cc      |   2 -
 iocore/net/quic/test/test_QUICPacketFactory.cc     |   2 -
 .../quic/test/test_QUICPacketHeaderProtector.cc    |   2 -
 iocore/net/quic/test/test_QUICPathValidator.cc     |   2 -
 iocore/net/quic/test/test_QUICStream.cc            |   2 -
 iocore/net/quic/test/test_QUICStreamManager.cc     |   2 -
 iocore/net/quic/test/test_QUICStreamState.cc       |   2 -
 iocore/net/quic/test/test_QUICVersionNegotiator.cc |   2 -
 proxy/http/remap/unit-tests/nexthop_test_stubs.cc  |   3 -
 proxy/http/unit_tests/unit_test_main.cc            |   3 -
 proxy/http3/test/main_qpack.cc                     |   3 -
 proxy/logging/LogStandalone.cc                     |   2 +-
 src/traffic_logcat/logcat.cc                       |   3 -
 src/traffic_logstats/logstats.cc                   |   3 -
 src/traffic_server/InkIOCoreAPI.cc                 |   4 +-
 28 files changed, 166 insertions(+), 271 deletions(-)

diff --git a/include/tscore/UDP_stubs.h b/include/tscore/UDP_stubs.h
deleted file mode 100644
index 353a837fbc..0000000000
--- a/include/tscore/UDP_stubs.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- *
- *  A brief file description
- *
- *  @section license License
- *
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-// This is needed to avoid library dependency ugliness.
-// ToDo: This would be good to eliminate in the libraries...
-#include "I_NetVConnection.h"
-#include "P_UDPConnection.h"
-#include "P_UDPPacket.h"
-
-void
-UDPConnection::Release()
-{
-}
-
-ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");
-int fds_limit = 8000;
diff --git a/iocore/aio/test_AIO.cc b/iocore/aio/test_AIO.cc
index 5b450f1167..22ac40f461 100644
--- a/iocore/aio/test_AIO.cc
+++ b/iocore/aio/test_AIO.cc
@@ -33,9 +33,6 @@
 using std::cout;
 using std::endl;
 
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
-
 // Necessary for AIO
 int net_config_poll_timeout = 10;
 
diff --git a/iocore/net/I_UDPPacket.h b/iocore/net/I_UDPPacket.h
index 56e5a37e23..59c7aa28c2 100644
--- a/iocore/net/I_UDPPacket.h
+++ b/iocore/net/I_UDPPacket.h
@@ -53,7 +53,6 @@ public:
   /**
      Add IOBufferBlock (chain) to end of packet.
      @param block block chain to add.
-
    */
   void append_block(IOBufferBlock *block);
 
@@ -63,48 +62,29 @@ public:
   int from_size;
 
   LINK(UDPPacket, link);
-};
 
-/**
-   Create a new packet to be sent over UDPConnection. This actually
-   copies data from a buffer.
+  // Factory (static) methods
 
+  /**
+     Create a new packet to be sent over UDPConnection.  Packet has no
+     destination or data.
+  */
+  static UDPPacket *new_UDPPacket();
 
-   @param to  address of where to send packet
-   @param when ink_hrtime relative to ink_get_hrtime_internal()
-   @param buf if !nullptr, then len bytes copied from buf and made into packet.
-   @param len # of bytes to copy from buf
- */
-extern UDPPacket *new_UDPPacket(struct sockaddr const *to, ink_hrtime when = 0, char *buf = nullptr, int len = 0);
-/**
-   Create a new packet to be sent over UDPConnection. This clones and
-   makes a reference to an existing IOBufferBlock chain.
-
-
-   @param to  address of where to send packet
-   @param when ink_hrtime relative to ink_get_hrtime_internal()
-   @param block if !nullptr, then the IOBufferBlock chain of data to use
-   for packet
-   @param len # of bytes to reference from block
- */
-
-TS_INLINE UDPPacket *new_UDPPacket(struct sockaddr const *to, ink_hrtime when = 0, IOBufferBlock *block = nullptr, int len = 0);
-/**
-   Create a new packet to be sent over UDPConnection.  Packet has no
-   destination or data.
-*/
-extern UDPPacket *new_UDPPacket();
-
-/**
-   Create a new packet to be delivered to application.
-   Internal function only
-*/
-extern UDPPacket *new_incoming_UDPPacket(struct sockaddr *from, char *buf, int len);
+  /**
+     Create a new packet to be sent over UDPConnection. This actually
+     copies data from a buffer.
 
-/**
-   Create a new packet to be delivered to application.
-   Internal function only
-*/
-extern UDPPacket *new_incoming_UDPPacket(struct sockaddr *from, Ptr<IOBufferBlock> &block);
+     @param to  address of where to send packet
+     @param when ink_hrtime relative to ink_get_hrtime_internal()
+     @param buf IOBufferBlock chain of data to use
+     @param segment_size Segment size
+  */
+  static UDPPacket *new_UDPPacket(struct sockaddr const *to, ink_hrtime when, Ptr<IOBufferBlock> &buf, uint16_t segment_size = 0);
 
-//@}
+  /**
+     Create a new packet to be delivered to application.
+     Internal function only
+  */
+  static UDPPacket *new_incoming_UDPPacket(struct sockaddr *from, struct sockaddr *to, Ptr<IOBufferBlock> &block);
+};
diff --git a/iocore/net/P_UDPNet.h b/iocore/net/P_UDPNet.h
index 39837dcfbd..5f82d348f4 100644
--- a/iocore/net/P_UDPNet.h
+++ b/iocore/net/P_UDPNet.h
@@ -32,7 +32,6 @@
 
 #include "tscore/ink_platform.h"
 #include "I_UDPNet.h"
-#include "P_UDPPacket.h"
 
 // added by YTS Team, yamsat
 static inline PollCont *get_UDPPollCont(EThread *);
diff --git a/iocore/net/P_UDPPacket.h b/iocore/net/P_UDPPacket.h
index 6eb7527095..4f4caeee92 100644
--- a/iocore/net/P_UDPPacket.h
+++ b/iocore/net/P_UDPPacket.h
@@ -55,146 +55,3 @@ public:
   int in_the_priority_queue = 0;
   int in_heap               = 0;
 };
-
-extern ClassAllocator<UDPPacketInternal> udpPacketAllocator;
-
-TS_INLINE
-UDPPacketInternal::UDPPacketInternal()
-
-{
-  memset(&from, '\0', sizeof(from));
-  memset(&to, '\0', sizeof(to));
-}
-
-TS_INLINE
-UDPPacketInternal::~UDPPacketInternal()
-{
-  chain = nullptr;
-}
-
-TS_INLINE void
-UDPPacketInternal::free()
-{
-  chain = nullptr;
-  if (conn)
-    conn->Release();
-  conn = nullptr;
-  udpPacketAllocator.free(this);
-}
-
-TS_INLINE void
-UDPPacket::append_block(IOBufferBlock *block)
-{
-  UDPPacketInternal *p = static_cast<UDPPacketInternal *>(this);
-
-  if (block) {
-    if (p->chain) { // append to end
-      IOBufferBlock *last = p->chain.get();
-      while (last->next) {
-        last = last->next.get();
-      }
-      last->next = block;
-    } else {
-      p->chain = block;
-    }
-  }
-}
-
-TS_INLINE int64_t
-UDPPacket::getPktLength() const
-{
-  UDPPacketInternal *p = const_cast<UDPPacketInternal *>(static_cast<const UDPPacketInternal *>(this));
-  IOBufferBlock *b;
-
-  p->pktLength = 0;
-  b            = p->chain.get();
-  while (b) {
-    p->pktLength += b->read_avail();
-    b            = b->next.get();
-  }
-  return p->pktLength;
-}
-
-TS_INLINE void
-UDPPacket::free()
-{
-  static_cast<UDPPacketInternal *>(this)->free();
-}
-
-TS_INLINE void
-UDPPacket::setContinuation(Continuation *c)
-{
-  static_cast<UDPPacketInternal *>(this)->cont = c;
-}
-
-TS_INLINE void
-UDPPacket::setConnection(UDPConnection *c)
-{
-  /*Code reviewed by Case Larsen.  Previously, we just had
-     ink_assert(!conn).  This prevents tunneling of packets
-     correctly---that is, you get packets from a server on a udp
-     conn. and want to send it to a player on another connection, the
-     assert will prevent that.  The "if" clause enables correct
-     handling of the connection ref. counts in such a scenario. */
-
-  UDPConnectionInternal *&conn = static_cast<UDPPacketInternal *>(this)->conn;
-
-  if (conn) {
-    if (conn == c)
-      return;
-    conn->Release();
-    conn = nullptr;
-  }
-  conn = static_cast<UDPConnectionInternal *>(c);
-  conn->AddRef();
-}
-
-TS_INLINE IOBufferBlock *
-UDPPacket::getIOBlockChain()
-{
-  ink_assert(dynamic_cast<UDPPacketInternal *>(this) != nullptr);
-  return static_cast<UDPPacketInternal *>(this)->chain.get();
-}
-
-TS_INLINE UDPConnection *
-UDPPacket::getConnection()
-{
-  return static_cast<UDPPacketInternal *>(this)->conn;
-}
-
-TS_INLINE UDPPacket *
-new_UDPPacket(struct sockaddr const *to, ink_hrtime when, Ptr<IOBufferBlock> &buf, uint16_t segment_size = 0)
-{
-  UDPPacketInternal *p = udpPacketAllocator.alloc();
-
-  p->in_the_priority_queue = 0;
-  p->in_heap               = 0;
-  p->delivery_time         = when;
-  if (to)
-    ats_ip_copy(&p->to, to);
-  p->chain        = buf;
-  p->segment_size = segment_size;
-  return p;
-}
-
-TS_INLINE UDPPacket *
-new_incoming_UDPPacket(struct sockaddr *from, struct sockaddr *to, Ptr<IOBufferBlock> &block)
-{
-  UDPPacketInternal *p = udpPacketAllocator.alloc();
-
-  p->in_the_priority_queue = 0;
-  p->in_heap               = 0;
-  p->delivery_time         = 0;
-  ats_ip_copy(&p->from, from);
-  ats_ip_copy(&p->to, to);
-  p->chain = block;
-
-  return p;
-}
-
-TS_INLINE UDPPacket *
-new_UDPPacket()
-{
-  UDPPacketInternal *p = udpPacketAllocator.alloc();
-  return p;
-}
diff --git a/iocore/net/QUICPacketHandler.cc b/iocore/net/QUICPacketHandler.cc
index e9f75ce431..e44b388a2e 100644
--- a/iocore/net/QUICPacketHandler.cc
+++ b/iocore/net/QUICPacketHandler.cc
@@ -100,7 +100,7 @@ QUICPacketHandler::_send_packet(const QUICPacket &packet, UDPConnection *udp_con
 void
 QUICPacketHandler::_send_packet(UDPConnection *udp_con, IpEndpoint &addr, Ptr<IOBufferBlock> udp_payload)
 {
-  UDPPacket *udp_packet = new_UDPPacket(addr, 0, udp_payload);
+  UDPPacket *udp_packet = UDPPacket::new_UDPPacket(addr, 0, udp_payload);
 
   if (is_debug_tag_set(v_debug_tag)) {
     ip_port_text_buffer ipb;
diff --git a/iocore/net/QUICPacketHandler_quiche.cc b/iocore/net/QUICPacketHandler_quiche.cc
index 2fc8a043bc..a79c34492b 100644
--- a/iocore/net/QUICPacketHandler_quiche.cc
+++ b/iocore/net/QUICPacketHandler_quiche.cc
@@ -71,7 +71,7 @@ QUICPacketHandler::close_connection(QUICNetVConnection *conn)
 void
 QUICPacketHandler::send_packet(UDPConnection *udp_con, IpEndpoint &addr, Ptr<IOBufferBlock> udp_payload, uint16_t segment_size)
 {
-  UDPPacket *udp_packet = new_UDPPacket(addr, 0, udp_payload, segment_size);
+  UDPPacket *udp_packet = UDPPacket::new_UDPPacket(addr, 0, udp_payload, segment_size);
 
   if (is_debug_tag_set(v_debug_tag)) {
     ip_port_text_buffer ipb;
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index 8f37f21592..8147bb36a7 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -48,6 +48,145 @@ using UDPNetContHandler = int (UDPNetHandler::*)(int, void *);
 ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");
 EventType ET_UDP;
 
+void
+UDPPacketInternal::free()
+{
+  chain = nullptr;
+  if (conn)
+    conn->Release();
+  conn = nullptr;
+  udpPacketAllocator.free(this);
+}
+
+UDPPacket *
+UDPPacket::new_UDPPacket()
+{
+  UDPPacketInternal *p = udpPacketAllocator.alloc();
+  return p;
+}
+
+UDPPacket *
+UDPPacket::new_UDPPacket(struct sockaddr const *to, ink_hrtime when, Ptr<IOBufferBlock> &buf, uint16_t segment_size)
+{
+  UDPPacketInternal *p = udpPacketAllocator.alloc();
+
+  p->in_the_priority_queue = 0;
+  p->in_heap               = 0;
+  p->delivery_time         = when;
+  if (to)
+    ats_ip_copy(&p->to, to);
+  p->chain        = buf;
+  p->segment_size = segment_size;
+  return p;
+}
+
+UDPPacket *
+UDPPacket::new_incoming_UDPPacket(struct sockaddr *from, struct sockaddr *to, Ptr<IOBufferBlock> &block)
+{
+  UDPPacketInternal *p = udpPacketAllocator.alloc();
+
+  p->in_the_priority_queue = 0;
+  p->in_heap               = 0;
+  p->delivery_time         = 0;
+  ats_ip_copy(&p->from, from);
+  ats_ip_copy(&p->to, to);
+  p->chain = block;
+
+  return p;
+}
+
+UDPPacketInternal::UDPPacketInternal()
+
+{
+  memset(&from, '\0', sizeof(from));
+  memset(&to, '\0', sizeof(to));
+}
+
+UDPPacketInternal::~UDPPacketInternal()
+{
+  chain = nullptr;
+}
+
+void
+UDPPacket::append_block(IOBufferBlock *block)
+{
+  UDPPacketInternal *p = static_cast<UDPPacketInternal *>(this);
+
+  if (block) {
+    if (p->chain) { // append to end
+      IOBufferBlock *last = p->chain.get();
+      while (last->next) {
+        last = last->next.get();
+      }
+      last->next = block;
+    } else {
+      p->chain = block;
+    }
+  }
+}
+
+int64_t
+UDPPacket::getPktLength() const
+{
+  UDPPacketInternal *p = const_cast<UDPPacketInternal *>(static_cast<const UDPPacketInternal *>(this));
+  IOBufferBlock *b;
+
+  p->pktLength = 0;
+  b            = p->chain.get();
+  while (b) {
+    p->pktLength += b->read_avail();
+    b            = b->next.get();
+  }
+  return p->pktLength;
+}
+
+void
+UDPPacket::free()
+{
+  static_cast<UDPPacketInternal *>(this)->free();
+}
+
+void
+UDPPacket::setContinuation(Continuation *c)
+{
+  static_cast<UDPPacketInternal *>(this)->cont = c;
+}
+
+void
+UDPPacket::setConnection(UDPConnection *c)
+{
+  /*Code reviewed by Case Larsen.  Previously, we just had
+     ink_assert(!conn).  This prevents tunneling of packets
+     correctly---that is, you get packets from a server on a udp
+     conn. and want to send it to a player on another connection, the
+     assert will prevent that.  The "if" clause enables correct
+     handling of the connection ref. counts in such a scenario. */
+
+  UDPConnectionInternal *&conn = static_cast<UDPPacketInternal *>(this)->conn;
+
+  if (conn) {
+    if (conn == c)
+      return;
+    conn->Release();
+    conn = nullptr;
+  }
+  conn = static_cast<UDPConnectionInternal *>(c);
+  conn->AddRef();
+}
+
+IOBufferBlock *
+UDPPacket::getIOBlockChain()
+{
+  ink_assert(dynamic_cast<UDPPacketInternal *>(this) != nullptr);
+  return static_cast<UDPPacketInternal *>(this)->chain.get();
+}
+
+UDPConnection *
+UDPPacket::getConnection()
+{
+  return static_cast<UDPPacketInternal *>(this)->conn;
+}
+
 //
 // Global Data
 //
@@ -251,7 +390,7 @@ UDPNetProcessorInternal::udp_read_from_net(UDPNetHandler *nh, UDPConnection *xuc
     }
 
     // create packet
-    UDPPacket *p = new_incoming_UDPPacket(ats_ip_sa_cast(&fromaddr), ats_ip_sa_cast(&toaddr), chain);
+    UDPPacket *p = UDPPacket::new_incoming_UDPPacket(ats_ip_sa_cast(&fromaddr), ats_ip_sa_cast(&toaddr), chain);
     p->setConnection(uc);
     // queue onto the UDPConnection
     uc->inQueue.push((UDPPacketInternal *)p);
diff --git a/iocore/net/quic/test/test_QUICAddrVerifyState.cc b/iocore/net/quic/test/test_QUICAddrVerifyState.cc
index db91327590..a90135c0bd 100644
--- a/iocore/net/quic/test/test_QUICAddrVerifyState.cc
+++ b/iocore/net/quic/test/test_QUICAddrVerifyState.cc
@@ -26,8 +26,6 @@
 #include "P_QUICNetVConnection.h"
 #include <memory>
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICAddrVerifyState", "[quic]")
 {
   QUICAddrVerifyState state;
diff --git a/iocore/net/quic/test/test_QUICFlowController.cc b/iocore/net/quic/test/test_QUICFlowController.cc
index c7f17e74c0..a4958f22db 100644
--- a/iocore/net/quic/test/test_QUICFlowController.cc
+++ b/iocore/net/quic/test/test_QUICFlowController.cc
@@ -27,8 +27,6 @@
 #include "quic/Mock.h"
 #include <memory>
 
-#include "tscore/UDP_stubs.h"
-
 static constexpr int DEFAULT_RTT = 1 * HRTIME_SECOND;
 
 class MockRTTProvider : public QUICRTTProvider
diff --git a/iocore/net/quic/test/test_QUICFrame.cc b/iocore/net/quic/test/test_QUICFrame.cc
index f8b5c149e0..2eb0c5ea1d 100644
--- a/iocore/net/quic/test/test_QUICFrame.cc
+++ b/iocore/net/quic/test/test_QUICFrame.cc
@@ -27,8 +27,6 @@
 #include "quic/QUICFrame.h"
 #include "quic/QUICStream.h"
 
-#include "tscore/UDP_stubs.h"
-
 extern const ink_freelist_ops *freelist_global_ops;
 extern const ink_freelist_ops *freelist_class_ops;
 
diff --git a/iocore/net/quic/test/test_QUICFrameDispatcher.cc b/iocore/net/quic/test/test_QUICFrameDispatcher.cc
index b5c98731e2..10e2d31880 100644
--- a/iocore/net/quic/test/test_QUICFrameDispatcher.cc
+++ b/iocore/net/quic/test/test_QUICFrameDispatcher.cc
@@ -27,8 +27,6 @@
 #include "quic/Mock.h"
 #include <memory>
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICFrameHandler", "[quic]")
 {
   Ptr<IOBufferBlock> block = make_ptr<IOBufferBlock>(new_IOBufferBlock());
diff --git a/iocore/net/quic/test/test_QUICHandshakeProtocol.cc b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
index 9005b501d9..ec84f0ee11 100644
--- a/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
+++ b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
@@ -27,8 +27,6 @@
 #include <fstream>
 #include <iomanip>
 
-#include "tscore/UDP_stubs.h"
-
 #ifdef OPENSSL_IS_BORINGSSL
 #include <openssl/base.h>
 #endif
diff --git a/iocore/net/quic/test/test_QUICLossDetector.cc b/iocore/net/quic/test/test_QUICLossDetector.cc
index db9758540b..96e663a858 100644
--- a/iocore/net/quic/test/test_QUICLossDetector.cc
+++ b/iocore/net/quic/test/test_QUICLossDetector.cc
@@ -32,8 +32,6 @@
 #include "Mock.h"
 #include "tscore/ink_hrtime.h"
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICLossDetector_Loss", "[quic]")
 {
   MockQUICPacketProtectionKeyInfo pp_key_info;
diff --git a/iocore/net/quic/test/test_QUICPacketFactory.cc b/iocore/net/quic/test/test_QUICPacketFactory.cc
index fc0e477415..348ec348d1 100644
--- a/iocore/net/quic/test/test_QUICPacketFactory.cc
+++ b/iocore/net/quic/test/test_QUICPacketFactory.cc
@@ -27,8 +27,6 @@
 #include "quic/QUICPacketFactory.h"
 #include "quic/Mock.h"
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICPacketFactory_Create_VersionNegotiationPacket", "[quic]")
 {
   MockQUICPacketProtectionKeyInfo pp_key_info;
diff --git a/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc b/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
index 64d445e1aa..2919c4184b 100644
--- a/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
+++ b/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
@@ -29,8 +29,6 @@
 #include "QUICGlobals.h"
 #include "Mock.h"
 
-#include "tscore/UDP_stubs.h"
-
 struct PollCont;
 #include "P_UDPConnection.h"
 #include "P_UnixNet.h"
diff --git a/iocore/net/quic/test/test_QUICPathValidator.cc b/iocore/net/quic/test/test_QUICPathValidator.cc
index 9383f4c2ad..57fe773f4b 100644
--- a/iocore/net/quic/test/test_QUICPathValidator.cc
+++ b/iocore/net/quic/test/test_QUICPathValidator.cc
@@ -28,8 +28,6 @@
 #include "stdio.h"
 #include "stdlib.h"
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICPathValidator", "[quic]")
 {
   MockQUICConnectionInfoProvider cinfo_provider;
diff --git a/iocore/net/quic/test/test_QUICStream.cc b/iocore/net/quic/test/test_QUICStream.cc
index 0e1cf8e4a7..8f9019d205 100644
--- a/iocore/net/quic/test/test_QUICStream.cc
+++ b/iocore/net/quic/test/test_QUICStream.cc
@@ -28,8 +28,6 @@
 #include "quic/QUICStreamVCAdapter.h"
 #include "quic/Mock.h"
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICBidiStream", "[quic]")
 {
   // Test Data
diff --git a/iocore/net/quic/test/test_QUICStreamManager.cc b/iocore/net/quic/test/test_QUICStreamManager.cc
index 4ad42f0699..9849af3b7e 100644
--- a/iocore/net/quic/test/test_QUICStreamManager.cc
+++ b/iocore/net/quic/test/test_QUICStreamManager.cc
@@ -30,8 +30,6 @@
 #include "quic/QUICFrame.h"
 #include "quic/Mock.h"
 
-#include "tscore/UDP_stubs.h"
-
 MockQUICContext context;
 
 TEST_CASE("QUICStreamManager_NewStream", "[quic]")
diff --git a/iocore/net/quic/test/test_QUICStreamState.cc b/iocore/net/quic/test/test_QUICStreamState.cc
index 3e4d536704..e6f9989fbc 100644
--- a/iocore/net/quic/test/test_QUICStreamState.cc
+++ b/iocore/net/quic/test/test_QUICStreamState.cc
@@ -29,8 +29,6 @@
 #include "quic/QUICStreamState.h"
 #include "quic/Mock.h"
 
-#include "tscore/UDP_stubs.h"
-
 // Unidirectional (sending)
 TEST_CASE("QUICSendStreamState", "[quic]")
 {
diff --git a/iocore/net/quic/test/test_QUICVersionNegotiator.cc b/iocore/net/quic/test/test_QUICVersionNegotiator.cc
index c17160b922..35397459c8 100644
--- a/iocore/net/quic/test/test_QUICVersionNegotiator.cc
+++ b/iocore/net/quic/test/test_QUICVersionNegotiator.cc
@@ -29,8 +29,6 @@
 #include "quic/QUICPacketFactory.h"
 #include "quic/Mock.h"
 
-#include "tscore/UDP_stubs.h"
-
 TEST_CASE("QUICVersionNegotiator - Server Side", "[quic]")
 {
   MockQUICPacketProtectionKeyInfo pp_key_info;
diff --git a/proxy/http/remap/unit-tests/nexthop_test_stubs.cc b/proxy/http/remap/unit-tests/nexthop_test_stubs.cc
index cbfef29ee8..2f080f2909 100644
--- a/proxy/http/remap/unit-tests/nexthop_test_stubs.cc
+++ b/proxy/http/remap/unit-tests/nexthop_test_stubs.cc
@@ -32,9 +32,6 @@
 #include "HttpSM.h"
 #include "nexthop_test_stubs.h"
 
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
-
 HttpSM::HttpSM() : Continuation(nullptr), vc_table(this) {}
 void
 HttpSM::cleanup()
diff --git a/proxy/http/unit_tests/unit_test_main.cc b/proxy/http/unit_tests/unit_test_main.cc
index 7611238e31..6217bdafd2 100644
--- a/proxy/http/unit_tests/unit_test_main.cc
+++ b/proxy/http/unit_tests/unit_test_main.cc
@@ -28,6 +28,3 @@
 #include "tscore/I_Version.h"
 
 AppVersionInfo appVersionInfo;
-
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
diff --git a/proxy/http3/test/main_qpack.cc b/proxy/http3/test/main_qpack.cc
index e3341ae873..b6e1d594f5 100644
--- a/proxy/http3/test/main_qpack.cc
+++ b/proxy/http3/test/main_qpack.cc
@@ -38,9 +38,6 @@
 #include "QPACK.h"
 #include "HTTP.h"
 
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
-
 #define TEST_THREADS 1
 
 char qifdir[256]  = "./qifs/qifs";
diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc
index c8d8ef7ca2..deafb03227 100644
--- a/proxy/logging/LogStandalone.cc
+++ b/proxy/logging/LogStandalone.cc
@@ -46,7 +46,7 @@
 class HttpBodyFactory;
 
 // globals the rest of the system depends on
-extern int fds_limit;
+int fds_limit;
 extern int cluster_port_number;
 
 int command_flag                = 0;
diff --git a/src/traffic_logcat/logcat.cc b/src/traffic_logcat/logcat.cc
index ff297cde32..c1b337e638 100644
--- a/src/traffic_logcat/logcat.cc
+++ b/src/traffic_logcat/logcat.cc
@@ -44,9 +44,6 @@
 #include "LogUtils.h"
 #include "Log.h"
 
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
-
 // logcat-specific command-line flags
 static int squid_flag              = 0;
 static int follow_flag             = 0;
diff --git a/src/traffic_logstats/logstats.cc b/src/traffic_logstats/logstats.cc
index 19f5c314c3..ff6c64c235 100644
--- a/src/traffic_logstats/logstats.cc
+++ b/src/traffic_logstats/logstats.cc
@@ -59,9 +59,6 @@
 
 using namespace std;
 
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
-
 // Constants, please update the VERSION number when you make a new build!!!
 #define PROGRAM_NAME "traffic_logstats"
 
diff --git a/src/traffic_server/InkIOCoreAPI.cc b/src/traffic_server/InkIOCoreAPI.cc
index 534aef94a3..88e0012b39 100644
--- a/src/traffic_server/InkIOCoreAPI.cc
+++ b/src/traffic_server/InkIOCoreAPI.cc
@@ -447,7 +447,7 @@ INKUDPSendTo(TSCont contp, INKUDPConn udp, unsigned int ip, int port, char *data
   sdk_assert(sdk_sanity_check_continuation(contp) == TS_SUCCESS);
 
   FORCE_PLUGIN_SCOPED_MUTEX(contp);
-  UDPPacket *packet   = new_UDPPacket();
+  UDPPacket *packet   = UDPPacket::new_UDPPacket();
   UDPConnection *conn = (UDPConnection *)udp;
 
   ats_ip4_set(&packet->to, ip, htons(port));
@@ -492,7 +492,7 @@ INKUDPConnFdGet(INKUDPConn udp)
 INKUDPPacket
 INKUDPPacketCreate()
 {
-  UDPPacket *packet = new_UDPPacket();
+  UDPPacket *packet = UDPPacket::new_UDPPacket();
   return ((INKUDPPacket)packet);
 }