Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions include/tscore/UDP_stubs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/** @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;
1 change: 0 additions & 1 deletion iocore/aio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ test_AIO_LDADD = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@ @YAMLCPP_LIBS@

include $(top_srcdir)/build/tidy.mk
Expand Down
3 changes: 3 additions & 0 deletions iocore/aio/test_AIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
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;

Expand Down
1 change: 0 additions & 1 deletion iocore/eventsystem/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ test_LD_ADD = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@HWLOC_LIBS@ @SWOC_LIBS@ @YAMLCPP_LIBS@

test_EventSystem_SOURCES = unit_tests/test_EventSystem.cc
Expand Down
1 change: 0 additions & 1 deletion iocore/hostdb/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ test_LD_ADD = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@ @YAMLCPP_LIBS@

test_RefCountCache_CPPFLAGS = $(test_CPP_FLAGS)
Expand Down
1 change: 0 additions & 1 deletion iocore/net/quic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ test_LDADD = \
libquic.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/ParentSelectionStrategy.o \
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICAddrVerifyState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "P_QUICNetVConnection.h"
#include <memory>

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICAddrVerifyState", "[quic]")
{
QUICAddrVerifyState state;
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICFlowController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "quic/Mock.h"
#include <memory>

#include "tscore/UDP_stubs.h"

static constexpr int DEFAULT_RTT = 1 * HRTIME_SECOND;

class MockRTTProvider : public QUICRTTProvider
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICFrame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#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;

Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICFrameDispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "quic/Mock.h"
#include <memory>

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICFrameHandler", "[quic]")
{
Ptr<IOBufferBlock> block = make_ptr<IOBufferBlock>(new_IOBufferBlock());
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICHandshakeProtocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <fstream>
#include <iomanip>

#include "tscore/UDP_stubs.h"

#ifdef OPENSSL_IS_BORINGSSL
#include <openssl/base.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICLossDetector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include "Mock.h"
#include "tscore/ink_hrtime.h"

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICLossDetector_Loss", "[quic]")
{
MockQUICPacketProtectionKeyInfo pp_key_info;
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICPacketFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "quic/QUICPacketFactory.h"
#include "quic/Mock.h"

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICPacketFactory_Create_VersionNegotiationPacket", "[quic]")
{
MockQUICPacketProtectionKeyInfo pp_key_info;
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICPacketHeaderProtector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "QUICGlobals.h"
#include "Mock.h"

#include "tscore/UDP_stubs.h"

struct PollCont;
#include "P_UDPConnection.h"
#include "P_UnixNet.h"
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICPathValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "stdio.h"
#include "stdlib.h"

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICPathValidator", "[quic]")
{
MockQUICConnectionInfoProvider cinfo_provider;
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "quic/QUICStreamVCAdapter.h"
#include "quic/Mock.h"

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICBidiStream", "[quic]")
{
// Test Data
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICStreamManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "quic/QUICFrame.h"
#include "quic/Mock.h"

#include "tscore/UDP_stubs.h"

MockQUICContext context;

TEST_CASE("QUICStreamManager_NewStream", "[quic]")
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICStreamState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "quic/QUICStreamState.h"
#include "quic/Mock.h"

#include "tscore/UDP_stubs.h"

// Unidirectional (sending)
TEST_CASE("QUICSendStreamState", "[quic]")
{
Expand Down
2 changes: 2 additions & 0 deletions iocore/net/quic/test/test_QUICVersionNegotiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "quic/QUICPacketFactory.h"
#include "quic/Mock.h"

#include "tscore/UDP_stubs.h"

TEST_CASE("QUICVersionNegotiator - Server Side", "[quic]")
{
MockQUICPacketProtectionKeyInfo pp_key_info;
Expand Down
2 changes: 0 additions & 2 deletions mgmt/rpc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ test_jsonrpc_LDADD = \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
$(top_builddir)/mgmt/utils/libutils_p.la \
@YAMLCPP_LIBS@ @HWLOC_LIBS@

Expand Down Expand Up @@ -117,7 +116,6 @@ test_jsonrpcserver_LDADD = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
$(top_builddir)/mgmt/utils/libutils_p.la \
@YAMLCPP_LIBS@ @HWLOC_LIBS@ @SWOC_LIBS@ @YAMLCPP_LIBS@

Expand Down
2 changes: 0 additions & 2 deletions proxy/hdrs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ test_proxy_hdrs_LDADD = \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@ \
@LIBCAP@

Expand All @@ -106,7 +105,6 @@ test_hdr_heap_LDADD = -L. -lhdrs \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@ \
@LIBCAP@

Expand Down
1 change: 0 additions & 1 deletion proxy/http/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ test_proxy_http_LDADD = \
$(top_builddir)/proxy/logging/liblogging.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
$(top_builddir)/iocore/utils/libinkutils.a \
@SWOC_LIBS@ @HWLOC_LIBS@ \
@LIBCAP@
Expand Down
1 change: 0 additions & 1 deletion proxy/http/remap/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ COMMON_PLUGINDSO_LDADDS = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@

clang-tidy-local: $(libhttp_remap_a_SOURCES)
Expand Down
14 changes: 3 additions & 11 deletions proxy/http/remap/unit-tests/nexthop_test_stubs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#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()
Expand Down Expand Up @@ -214,14 +217,3 @@ HostStatus::setHostStatus(const std::string_view host, TSHostStatus status, unsi
this->hosts_statuses[std::string(host)]->local_down_time = down_time;
NH_Debug("next_hop", "setting host status for '%.*s' to %s", host.size(), host.data(), HostStatusNames[status]);
}

#include "I_UDPConnection.h"

void
UDPConnection::Release()
{
}

#include "P_UDPPacket.h"
ClassAllocator<UDPPacketInternal> udpPacketAllocator("udpPacketAllocator");
// for UDPPacketInternal::free()
3 changes: 3 additions & 0 deletions proxy/http/unit_tests/unit_test_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
#include "tscore/I_Version.h"

AppVersionInfo appVersionInfo;

// ToDo: It would be nice to decouple these UDP dependencies ...
#include "tscore/UDP_stubs.h"
2 changes: 0 additions & 2 deletions proxy/http2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ test_libhttp2_LDADD = \
$(top_builddir)/proxy/hdrs/libhdrs.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@

if OS_LINUX
Expand Down Expand Up @@ -129,7 +128,6 @@ test_HPACK_LDADD = \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@SWOC_LIBS@ @HWLOC_LIBS@

test_HPACK_SOURCES = \
Expand Down
1 change: 0 additions & 1 deletion proxy/http3/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ test_LDADD = \
$(top_builddir)/src/tscore/libtscore.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/hdrs/libhdrs.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@LIBPCRE@ \
@OPENSSL_LIBS@ \
@HWLOC_LIBS@ @SWOC_LIBS@
Expand Down
3 changes: 3 additions & 0 deletions proxy/http3/test/main_qpack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
#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";
Expand Down
8 changes: 6 additions & 2 deletions proxy/logging/LogStandalone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "MgmtUtils.h"
// Needs LibRecordsConfigInit()
#include "records/I_RecordsConfig.h"
#include "I_Machine.h"

#define LOG_FILENAME_SIZE 255

Expand Down Expand Up @@ -202,8 +203,7 @@ init_log_standalone(const char *pgm_name, bool one_copy)

1) does not call initialize_process_manager
2) initializes the diags with use_records = false
3) does not call Machine::init()
4) assumes multiple copies of the application can run, so does not
3) assumes multiple copies of the application can run, so does not
do lock checking
-------------------------------------------------------------------------*/

Expand All @@ -215,6 +215,10 @@ init_log_standalone_basic(const char *pgm_name)
snprintf(logfile, sizeof(logfile), "%s.log", pgm_name);
openlog(pgm_name, LOG_PID | LOG_NDELAY | LOG_NOWAIT, LOG_DAEMON);

// Makes the logging library happy. ToDo: This should be eliminated when
// the cross dependencies aren't ugly.
Machine::init("localhost", nullptr);

init_system(false);
const bool use_records = false;
diagsConfig = new DiagsConfig(pgm_name, logfile, error_tags, action_tags, use_records);
Expand Down
1 change: 0 additions & 1 deletion proxy/logging/unit-tests/benchmark_LogObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ benchmark_LogObject_LDADD = \
$(top_builddir)/proxy/http/libhttp.a \
$(top_builddir)/proxy/hdrs/libhdrs.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
$(top_builddir)/proxy/shared/libdiagsconfig.a \
@HWLOC_LIBS@

Expand Down
8 changes: 0 additions & 8 deletions proxy/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,3 @@ target_include_directories(diagsconfig PRIVATE
${CMAKE_SOURCE_DIR}/mgmt/utils
${YAMLCPP_INCLUDE_DIR}
)
add_library(UglyLogStubs STATIC UglyLogStubs.cc)
target_include_directories(UglyLogStubs PRIVATE
${IOCORE_INCLUDE_DIRS}
${PROXY_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/mgmt
${CMAKE_SOURCE_DIR}/mgmt/utils
${YAMLCPP_INCLUDE_DIR}
)
8 changes: 2 additions & 6 deletions proxy/shared/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ include $(top_srcdir)/build/tidy.mk

# Note that hdrs is targeted from ../Makefile.am
noinst_LIBRARIES = \
libdiagsconfig.a \
libUglyLogStubs.a
libdiagsconfig.a

AM_CPPFLAGS += \
$(iocore_include_dirs) \
Expand All @@ -41,8 +40,5 @@ AM_CPPFLAGS += \
libdiagsconfig_a_SOURCES = \
DiagsConfig.cc

libUglyLogStubs_a_SOURCES = \
UglyLogStubs.cc

clang-tidy-local: $(libdiagsconfig_a_SOURCES) $(libUglyLogStubs_a_SOURCES)
clang-tidy-local: $(libdiagsconfig_a_SOURCES)
$(CXX_Clang_Tidy)
Loading