diff --git a/include/tscore/UDP_stubs.h b/include/tscore/UDP_stubs.h new file mode 100644 index 00000000000..353a837fbc6 --- /dev/null +++ b/include/tscore/UDP_stubs.h @@ -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 udpPacketAllocator("udpPacketAllocator"); +int fds_limit = 8000; diff --git a/iocore/aio/Makefile.am b/iocore/aio/Makefile.am index af610f2e41c..9e54824442a 100644 --- a/iocore/aio/Makefile.am +++ b/iocore/aio/Makefile.am @@ -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 diff --git a/iocore/aio/test_AIO.cc b/iocore/aio/test_AIO.cc index 22ac40f4614..5b450f1167a 100644 --- a/iocore/aio/test_AIO.cc +++ b/iocore/aio/test_AIO.cc @@ -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; diff --git a/iocore/eventsystem/Makefile.am b/iocore/eventsystem/Makefile.am index 0bd1e21035f..a18ee043f20 100644 --- a/iocore/eventsystem/Makefile.am +++ b/iocore/eventsystem/Makefile.am @@ -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 diff --git a/iocore/hostdb/Makefile.am b/iocore/hostdb/Makefile.am index 6be2cfa4137..fcde4788baf 100644 --- a/iocore/hostdb/Makefile.am +++ b/iocore/hostdb/Makefile.am @@ -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) diff --git a/iocore/net/quic/Makefile.am b/iocore/net/quic/Makefile.am index f1866e88cb8..ed35743d315 100644 --- a/iocore/net/quic/Makefile.am +++ b/iocore/net/quic/Makefile.am @@ -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 \ diff --git a/iocore/net/quic/test/test_QUICAddrVerifyState.cc b/iocore/net/quic/test/test_QUICAddrVerifyState.cc index a90135c0bd6..db913275906 100644 --- a/iocore/net/quic/test/test_QUICAddrVerifyState.cc +++ b/iocore/net/quic/test/test_QUICAddrVerifyState.cc @@ -26,6 +26,8 @@ #include "P_QUICNetVConnection.h" #include +#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 a4958f22db0..c7f17e74c00 100644 --- a/iocore/net/quic/test/test_QUICFlowController.cc +++ b/iocore/net/quic/test/test_QUICFlowController.cc @@ -27,6 +27,8 @@ #include "quic/Mock.h" #include +#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 2eb0c5ea1d5..f8b5c149e0a 100644 --- a/iocore/net/quic/test/test_QUICFrame.cc +++ b/iocore/net/quic/test/test_QUICFrame.cc @@ -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; diff --git a/iocore/net/quic/test/test_QUICFrameDispatcher.cc b/iocore/net/quic/test/test_QUICFrameDispatcher.cc index 10e2d318804..b5c98731e24 100644 --- a/iocore/net/quic/test/test_QUICFrameDispatcher.cc +++ b/iocore/net/quic/test/test_QUICFrameDispatcher.cc @@ -27,6 +27,8 @@ #include "quic/Mock.h" #include +#include "tscore/UDP_stubs.h" + TEST_CASE("QUICFrameHandler", "[quic]") { Ptr block = make_ptr(new_IOBufferBlock()); diff --git a/iocore/net/quic/test/test_QUICHandshakeProtocol.cc b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc index ec84f0ee112..9005b501d9f 100644 --- a/iocore/net/quic/test/test_QUICHandshakeProtocol.cc +++ b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc @@ -27,6 +27,8 @@ #include #include +#include "tscore/UDP_stubs.h" + #ifdef OPENSSL_IS_BORINGSSL #include #endif diff --git a/iocore/net/quic/test/test_QUICLossDetector.cc b/iocore/net/quic/test/test_QUICLossDetector.cc index 96e663a8585..db9758540bb 100644 --- a/iocore/net/quic/test/test_QUICLossDetector.cc +++ b/iocore/net/quic/test/test_QUICLossDetector.cc @@ -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; diff --git a/iocore/net/quic/test/test_QUICPacketFactory.cc b/iocore/net/quic/test/test_QUICPacketFactory.cc index 348ec348d1c..fc0e4774159 100644 --- a/iocore/net/quic/test/test_QUICPacketFactory.cc +++ b/iocore/net/quic/test/test_QUICPacketFactory.cc @@ -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; diff --git a/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc b/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc index 2919c4184b4..64d445e1aa5 100644 --- a/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc +++ b/iocore/net/quic/test/test_QUICPacketHeaderProtector.cc @@ -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" diff --git a/iocore/net/quic/test/test_QUICPathValidator.cc b/iocore/net/quic/test/test_QUICPathValidator.cc index 57fe773f4b5..9383f4c2ad2 100644 --- a/iocore/net/quic/test/test_QUICPathValidator.cc +++ b/iocore/net/quic/test/test_QUICPathValidator.cc @@ -28,6 +28,8 @@ #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 8f9019d205b..0e1cf8e4a77 100644 --- a/iocore/net/quic/test/test_QUICStream.cc +++ b/iocore/net/quic/test/test_QUICStream.cc @@ -28,6 +28,8 @@ #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 9849af3b7ea..4ad42f0699c 100644 --- a/iocore/net/quic/test/test_QUICStreamManager.cc +++ b/iocore/net/quic/test/test_QUICStreamManager.cc @@ -30,6 +30,8 @@ #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 e6f9989fbc3..3e4d5367046 100644 --- a/iocore/net/quic/test/test_QUICStreamState.cc +++ b/iocore/net/quic/test/test_QUICStreamState.cc @@ -29,6 +29,8 @@ #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 35397459c86..c17160b922a 100644 --- a/iocore/net/quic/test/test_QUICVersionNegotiator.cc +++ b/iocore/net/quic/test/test_QUICVersionNegotiator.cc @@ -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; diff --git a/mgmt/rpc/Makefile.am b/mgmt/rpc/Makefile.am index 56099602b27..415ad089c12 100644 --- a/mgmt/rpc/Makefile.am +++ b/mgmt/rpc/Makefile.am @@ -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@ @@ -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@ diff --git a/proxy/hdrs/Makefile.am b/proxy/hdrs/Makefile.am index 3de4cf11d77..b52058628ed 100644 --- a/proxy/hdrs/Makefile.am +++ b/proxy/hdrs/Makefile.am @@ -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@ @@ -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@ diff --git a/proxy/http/Makefile.am b/proxy/http/Makefile.am index 048f0a9eb00..df6d8468a8d 100644 --- a/proxy/http/Makefile.am +++ b/proxy/http/Makefile.am @@ -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@ diff --git a/proxy/http/remap/Makefile.am b/proxy/http/remap/Makefile.am index 84ae96f7492..7aab0d71877 100644 --- a/proxy/http/remap/Makefile.am +++ b/proxy/http/remap/Makefile.am @@ -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) diff --git a/proxy/http/remap/unit-tests/nexthop_test_stubs.cc b/proxy/http/remap/unit-tests/nexthop_test_stubs.cc index af54522eae3..cbfef29ee8f 100644 --- a/proxy/http/remap/unit-tests/nexthop_test_stubs.cc +++ b/proxy/http/remap/unit-tests/nexthop_test_stubs.cc @@ -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() @@ -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 udpPacketAllocator("udpPacketAllocator"); -// for UDPPacketInternal::free() diff --git a/proxy/http/unit_tests/unit_test_main.cc b/proxy/http/unit_tests/unit_test_main.cc index 6217bdafd22..7611238e31a 100644 --- a/proxy/http/unit_tests/unit_test_main.cc +++ b/proxy/http/unit_tests/unit_test_main.cc @@ -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" diff --git a/proxy/http2/Makefile.am b/proxy/http2/Makefile.am index 9d39fad6aaa..544dfcc4d8f 100644 --- a/proxy/http2/Makefile.am +++ b/proxy/http2/Makefile.am @@ -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 @@ -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 = \ diff --git a/proxy/http3/Makefile.am b/proxy/http3/Makefile.am index 8a00a6450fa..79661228014 100644 --- a/proxy/http3/Makefile.am +++ b/proxy/http3/Makefile.am @@ -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@ diff --git a/proxy/http3/test/main_qpack.cc b/proxy/http3/test/main_qpack.cc index b6e1d594f5c..e3341ae873b 100644 --- a/proxy/http3/test/main_qpack.cc +++ b/proxy/http3/test/main_qpack.cc @@ -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"; diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc index 3bb9c1d8c87..c8d8ef7ca2a 100644 --- a/proxy/logging/LogStandalone.cc +++ b/proxy/logging/LogStandalone.cc @@ -39,6 +39,7 @@ #include "MgmtUtils.h" // Needs LibRecordsConfigInit() #include "records/I_RecordsConfig.h" +#include "I_Machine.h" #define LOG_FILENAME_SIZE 255 @@ -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 -------------------------------------------------------------------------*/ @@ -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); diff --git a/proxy/logging/unit-tests/benchmark_LogObject.cc b/proxy/logging/unit-tests/benchmark_LogObject.cc index 1b54e369b24..6a6bf6f6c98 100644 --- a/proxy/logging/unit-tests/benchmark_LogObject.cc +++ b/proxy/logging/unit-tests/benchmark_LogObject.cc @@ -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@ diff --git a/proxy/shared/CMakeLists.txt b/proxy/shared/CMakeLists.txt index f7b58d4ba62..7594b1dad65 100644 --- a/proxy/shared/CMakeLists.txt +++ b/proxy/shared/CMakeLists.txt @@ -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} -) diff --git a/proxy/shared/Makefile.am b/proxy/shared/Makefile.am index 2e5d7f45fe4..6393cdae556 100644 --- a/proxy/shared/Makefile.am +++ b/proxy/shared/Makefile.am @@ -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) \ @@ -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) diff --git a/proxy/shared/UglyLogStubs.cc b/proxy/shared/UglyLogStubs.cc deleted file mode 100644 index 89fc0eb6e14..00000000000 --- a/proxy/shared/UglyLogStubs.cc +++ /dev/null @@ -1,191 +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 total BS, because our libraries are riddled with cross dependencies. -// TODO: Clean up the dependency mess, and get rid of this. - -#include "tscore/ink_platform.h" -#include "tscore/ink_uuid.h" -#include "LogObject.h" - -#include "P_Net.h" - -int fds_limit = 8000; - -class FakeUDPNetProcessor : public UDPNetProcessor -{ - EventType - register_event_type() override - { - return 999; - } - - int - start(int, size_t) override - { - ink_release_assert(false); - return 0; - }; -} fakeUDPNet; - -UDPNetProcessor &udpNet = fakeUDPNet; - -ClassAllocator udpPacketAllocator("udpPacketAllocator"); - -void -UDPConnection::Release() -{ - ink_release_assert(false); -} - -#include "InkAPIInternal.h" -ConfigUpdateCbTable *global_config_cbs = nullptr; - -void -ConfigUpdateCbTable::invoke(const char * /* name ATS_UNUSED */) -{ - ink_release_assert(false); -} - -struct Machine { - IpEndpoint ip; - IpEndpoint ip4; - IpEndpoint ip6; - - std::string host_name{"test.host.com"}; - std::string ip_hex_string; - ATSUuid uuid; - - static Machine *instance(); -}; - -Machine * -Machine::instance() -{ - static Machine _instance; - return &_instance; -} - -NetAccept * -UnixNetProcessor::createNetAccept(const NetProcessor::AcceptOptions &opt) -{ - ink_release_assert(false); - return nullptr; -} - -void -UnixNetProcessor::init() -{ - ink_release_assert(false); -} - -void -UnixNetProcessor::init_socks() -{ - ink_release_assert(false); -} - -// TODO: The following was necessary only for Solaris, should examine more. -NetVCOptions const Connection::DEFAULT_OPTIONS; -NetProcessor::AcceptOptions const NetProcessor::DEFAULT_ACCEPT_OPTIONS; -DNSConnection::Options const DNSConnection::DEFAULT_OPTIONS; - -// TODO: This is even uglier, this actually gets called here when "defined". -NetProcessor::AcceptOptions & -NetProcessor::AcceptOptions::reset() -{ - local_port = 0; - accept_threads = 0; - ip_family = AF_INET; - etype = ET_NET; - recv_bufsize = 0; - send_bufsize = 0; - sockopt_flags = 0; - packet_mark = 0; - packet_tos = 0; - packet_notsent_lowat = 0; - f_inbound_transparent = false; - return *this; -} - -// These are for clang / llvm -int -CacheVC::handleWrite(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */) -{ - return 0; - ink_release_assert(false); -} - -UnixNetProcessor unix_netProcessor; -NetProcessor &netProcessor = unix_netProcessor; - -Action * -NetProcessor::accept(Continuation * /* cont ATS_UNUSED */, AcceptOptions const & /* opt ATS_UNUSED */) -{ - ink_release_assert(false); - return nullptr; -} - -Action * -NetProcessor::main_accept(Continuation * /* cont ATS_UNUSED */, SOCKET /* fd ATS_UNUSED */, - AcceptOptions const & /* opt ATS_UNUSED */) -{ - ink_release_assert(false); - return nullptr; -} - -void -NetProcessor::stop_accept() -{ - ink_release_assert(false); -} - -Action * -UnixNetProcessor::accept_internal(Continuation * /* cont ATS_UNUSED */, int /* fd ATS_UNUSED */, - AcceptOptions const & /* opt ATS_UNUSED */) -{ - ink_release_assert(false); - return nullptr; -} - -NetVConnection * -UnixNetProcessor::allocate_vc(EThread *) -{ - ink_release_assert(false); - return nullptr; -} - -// For Intel ICC -int cache_config_mutex_retry_delay = 2; - -#include "I_SplitDNSProcessor.h" -void -SplitDNSConfig::reconfigure() -{ -} - -ClassAllocator cacheRemoveContAllocator("cacheRemoveCont"); - -CacheHostTable::CacheHostTable(Cache * /* c ATS_UNUSED */, CacheType /* typ ATS_UNUSED */) {} - -CacheHostTable::~CacheHostTable() {} diff --git a/src/records/Makefile.am b/src/records/Makefile.am index 9df41864229..46b612dfc00 100644 --- a/src/records/Makefile.am +++ b/src/records/Makefile.am @@ -77,7 +77,6 @@ test_librecords_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 \ @SWOC_LIBS@ @HWLOC_LIBS@ @LIBCAP@ @YAMLCPP_LIBS@ test_librecords_on_eventsystem_CPPFLAGS = $(AM_CPPFLAGS)\ @@ -92,7 +91,6 @@ test_librecords_on_eventsystem_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 \ @HWLOC_LIBS@ @LIBCAP@ @YAMLCPP_LIBS@ @SWOC_LIBS@ clang-tidy-local: $(sort $(DIST_SOURCES)) diff --git a/src/traffic_crashlog/Makefile.inc b/src/traffic_crashlog/Makefile.inc index 5e0c49f0c24..1d88fe10ca7 100644 --- a/src/traffic_crashlog/Makefile.inc +++ b/src/traffic_crashlog/Makefile.inc @@ -39,7 +39,6 @@ traffic_crashlog_traffic_crashlog_SOURCES = \ traffic_crashlog_traffic_crashlog_LDADD = \ $(top_builddir)/src/records/librecords_p.a \ - $(top_builddir)/proxy/shared/libUglyLogStubs.a \ $(top_builddir)/iocore/eventsystem/libinkevent.a \ $(top_builddir)/iocore/net/libinknet.a \ $(top_builddir)/src/tscore/libtscore.la \ diff --git a/src/traffic_layout/Makefile.inc b/src/traffic_layout/Makefile.inc index cc1fd4dca95..ccc10d033a8 100644 --- a/src/traffic_layout/Makefile.inc +++ b/src/traffic_layout/Makefile.inc @@ -43,7 +43,6 @@ traffic_layout_traffic_layout_SOURCES = \ traffic_layout_traffic_layout_LDADD = \ $(top_builddir)/src/records/librecords_p.a \ - $(top_builddir)/proxy/shared/libUglyLogStubs.a \ $(top_builddir)/iocore/eventsystem/libinkevent.a \ $(top_builddir)/src/tscore/libtscore.la \ $(top_builddir)/src/tscpp/util/libtscpputil.la \ diff --git a/src/traffic_logcat/Makefile.inc b/src/traffic_logcat/Makefile.inc index 8d7578a7263..c9c5a09dcae 100644 --- a/src/traffic_logcat/Makefile.inc +++ b/src/traffic_logcat/Makefile.inc @@ -42,9 +42,9 @@ traffic_logcat_traffic_logcat_LDADD = \ $(top_builddir)/proxy/logging/liblogging.a \ $(top_builddir)/proxy/hdrs/libhdrs.a \ $(top_builddir)/proxy/shared/libdiagsconfig.a \ - $(top_builddir)/proxy/shared/libUglyLogStubs.a \ $(top_builddir)/src/records/librecords_p.a \ $(top_builddir)/iocore/eventsystem/libinkevent.a \ + $(top_builddir)/iocore/utils/libinkutils.a \ $(top_builddir)/src/tscore/libtscore.la \ $(top_builddir)/src/tscpp/util/libtscpputil.la \ $(top_builddir)/mgmt/utils/libutils_p.la diff --git a/src/traffic_logcat/logcat.cc b/src/traffic_logcat/logcat.cc index c1b337e6389..ff297cde324 100644 --- a/src/traffic_logcat/logcat.cc +++ b/src/traffic_logcat/logcat.cc @@ -44,6 +44,9 @@ #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/Makefile.inc b/src/traffic_logstats/Makefile.inc index 140947bcfe7..7a2ac7f0d13 100644 --- a/src/traffic_logstats/Makefile.inc +++ b/src/traffic_logstats/Makefile.inc @@ -47,9 +47,9 @@ traffic_logstats_traffic_logstats_LDADD = \ $(top_builddir)/proxy/logging/liblogging.a \ $(top_builddir)/proxy/hdrs/libhdrs.a \ $(top_builddir)/proxy/shared/libdiagsconfig.a \ - $(top_builddir)/proxy/shared/libUglyLogStubs.a \ $(top_builddir)/src/records/librecords_p.a \ $(top_builddir)/iocore/eventsystem/libinkevent.a \ + $(top_builddir)/iocore/utils/libinkutils.a \ $(top_builddir)/src/tscore/libtscore.la \ $(top_builddir)/src/tscpp/util/libtscpputil.la \ $(top_builddir)/mgmt/utils/libutils_p.la diff --git a/src/traffic_logstats/logstats.cc b/src/traffic_logstats/logstats.cc index ff6c64c235a..19f5c314c3b 100644 --- a/src/traffic_logstats/logstats.cc +++ b/src/traffic_logstats/logstats.cc @@ -59,6 +59,9 @@ 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/Makefile.inc b/src/traffic_server/Makefile.inc index ff58fd556bf..39fd9ac9c44 100644 --- a/src/traffic_server/Makefile.inc +++ b/src/traffic_server/Makefile.inc @@ -34,7 +34,7 @@ traffic_server_traffic_server_CPPFLAGS = \ -I$(abs_top_srcdir)/proxy/shared \ -I$(abs_top_srcdir)/mgmt \ -I$(abs_top_srcdir)/mgmt/utils \ - @SWOC_INCLUDES@ \ + @SWOC_INCLUDES@ \ $(TS_INCLUDES) \ @OPENSSL_INCLUDES@ \ @BORINGOCSP_INCLUDES@ \ @@ -71,7 +71,7 @@ traffic_server_traffic_server_LDADD = \ $(top_builddir)/proxy/http/libhttp.a \ $(top_builddir)/proxy/http/remap/libhttp_remap.a \ $(top_builddir)/proxy/http2/libhttp2.a \ - $(top_builddir)/proxy/logging/liblogging.a \ + $(top_builddir)/proxy/logging/liblogging.a \ $(top_builddir)/proxy/hdrs/libhdrs.a \ $(top_builddir)/proxy/shared/libdiagsconfig.a \ $(top_builddir)/iocore/utils/libinkutils.a \ @@ -91,14 +91,14 @@ traffic_server_traffic_server_LDADD = \ $(top_builddir)/mgmt/rpc/libjsonrpc_protocol.la \ $(top_builddir)/mgmt/config/libconfigmanager.la \ $(top_builddir)/mgmt/rpc/librpcpublichandlers.la \ - $(top_builddir)/mgmt/utils/libutils_p.la \ + $(top_builddir)/mgmt/utils/libutils_p.la \ @HWLOC_LIBS@ \ @LIBPCRE@ \ @LIBRESOLV@ \ @LIBZ@ \ @LIBLZMA@ \ @LIBPROFILER@ \ - @SWOC_LIBS@ \ + @SWOC_LIBS@ \ @OPENSSL_LIBS@ \ @YAMLCPP_LIBS@ \ @BORINGOCSP_LIBS@ \