Skip to content
Closed
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
26 changes: 14 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,24 @@ include(CheckIncludeFiles)
include(CheckIncludeFileCXX)
include(CheckSymbolExists)

CHECK_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILE(arpa/nameser.h HAVE_ARPA_NAMESER_H)
CHECK_INCLUDE_FILE(arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILE(endian.h HAVE_ENDIAN_H)
CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILE(linux/hdreg.h HAVE_LINUX_HDREG_H)
CHECK_INCLUDE_FILE(linux/major.h HAVE_LINUX_MAJOR_H)
CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE(netinet/in_systm.h HAVE_NETINET_IN_SYSTM_H)
CHECK_INCLUDE_FILE(netinet/tcp.h HAVE_NETINET_TCP_H)
CHECK_INCLUDE_FILE(netinet/ip_icmp.h HAVE_NETINET_IP_ICMP_H)
CHECK_INCLUDE_FILE(siginfo.h HAVE_SIGINFO_H)
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
Comment on lines +78 to +79
Copy link
Contributor

@JosiahWI JosiahWI Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdlib.h HAVE_STDLIB_H)

CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILE(sys/disk.h HAVE_SYS_DISK_H)
CHECK_INCLUDE_FILE(sys/disklabel.h HAVE_SYS_DISKLABEL_H)
CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H)
Expand All @@ -80,15 +90,6 @@ CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
CHECK_INCLUDE_FILE(sys/mount.h HAVE_SYS_MOUNT_H)
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE(netinet/in_systm.h HAVE_NETINET_IN_SYSTM_H)
CHECK_INCLUDE_FILE(netinet/tcp.h HAVE_NETINET_TCP_H)
CHECK_INCLUDE_FILE(netinet/ip_icmp.h HAVE_NETINET_IP_ICMP_H)
CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILE(arpa/nameser.h HAVE_ARPA_NAMESER_H)
CHECK_INCLUDE_FILE(arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
CHECK_INCLUDE_FILE(siginfo.h HAVE_SIGINFO_H)

# Find libraries
find_package(TSMallocReplacement QUIET MODULE)
Expand All @@ -111,6 +112,7 @@ find_package(PCRE)
include(FindOpenSSL)
find_package(OpenSSL)
find_package(ZLIB REQUIRED)
find_package(QUICHE)

# Find ccache
include(find_ccache)
Expand Down
35 changes: 35 additions & 0 deletions cmake/FindQUICHE.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#######################
#
# 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.
#
#######################

set(QUICHE_INSTALL_DIR /opt/quiche)

find_path(QUICHE_INCLUDE_DIR NAMES quiche.h HINTS ${QUICHE_INSTALL_DIR} PATH_SUFFIXES include)
find_library(QUICHE_LIBRARY NAMES quiche HINTS ${QUICHE_INSTALL_DIR} PATH_SUFFIXES lib)
Comment on lines +20 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
find_path(QUICHE_INCLUDE_DIR NAMES quiche.h HINTS ${QUICHE_INSTALL_DIR} PATH_SUFFIXES include)
find_library(QUICHE_LIBRARY NAMES quiche HINTS ${QUICHE_INSTALL_DIR} PATH_SUFFIXES lib)
find_path(QUICHE_INCLUDE_DIR NAMES quiche.h PATHS ${QUICHE_INSTALL_DIR} PATH_SUFFIXES include)
find_library(QUICHE_LIBRARY NAMES quiche PATHS ${QUICHE_INSTALL_DIR} PATH_SUFFIXES lib)

Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
(https://cmake.org/cmake/help/latest/command/find_library.html)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need PATH_SUFFIXES here at all. lib/ and include/ are already default search paths.


INCLUDE(FindPackageHandleStandardArgs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INCLUDE(FindPackageHandleStandardArgs)
include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(QUICHE DEFAULT_MSG QUICHE_LIBRARY QUICHE_INCLUDE_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FIND_PACKAGE_HANDLE_STANDARD_ARGS(QUICHE DEFAULT_MSG QUICHE_LIBRARY QUICHE_INCLUDE_DIR)
find_package_handle_standard_args(QUICHE DEFAULT_MSG QUICHE_LIBRARY QUICHE_INCLUDE_DIR)


if(QUICHE_FOUND)
set(QUICHE_LIBRARY_DIR ${QUICHE_INSTALL_DIR}/lib)
set(QUIC_LIBRARY_DIRS ${QUICHE_LIBRARY_DIR})
set(QUIC_LIBRARIES ${QUICHE_LIBRARY} http3 quic)
set(QUIC_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/iocore/net/quic)
Comment on lines +27 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(QUICHE_LIBRARY_DIR ${QUICHE_INSTALL_DIR}/lib)
set(QUIC_LIBRARY_DIRS ${QUICHE_LIBRARY_DIR})
set(QUIC_LIBRARIES ${QUICHE_LIBRARY} http3 quic)
set(QUIC_INCLUDE_DIRS ${QUICHE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/iocore/net/quic)
set(QUICHE_LIBRARY_DIR "${QUICHE_INSTALL_DIR}/lib")
set(QUIC_LIBRARY_DIRS "${QUICHE_LIBRARY_DIR}")
set(QUIC_LIBRARIES "${QUICHE_LIBRARY}" http3 quic)
set(QUIC_INCLUDE_DIRS "${QUICHE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/iocore/net/quic")

set(TS_HAS_QUICHE 1)
set(TS_USE_QUIC 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS_USE_QUIC becomes 1 if the both Quiche and BoringSSL are available.

enable_quic=no
TS_CHECK_QUICHE
if test "${has_quiche}" = "1"; then
if test "$openssl_is_boringssl" = "1" ; then
enable_quic=yes
else
  AC_MSG_ERROR([Use of BoringSSL is required if Quiche is used.])
fi
fi

endif()

unset(QUICHE_INSTALL_DIR)
3 changes: 3 additions & 0 deletions include/tscore/ink_config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#cmakedefine HAVE_BROTLI_ENCODE_H 1
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_ENDIAN_H 1
#cmakedefine HAVE_FLOAT_H 1
#cmakedefine HAVE_LZMA_H 1
#cmakedefine HAVE_STDLIB_H 1
Expand Down Expand Up @@ -117,6 +118,8 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
#cmakedefine01 TS_USE_SET_RBIO
#cmakedefine01 TS_USE_DIAGS
#cmakedefine01 TS_USE_GET_DH_2048_256
#cmakedefine01 TS_USE_QUIC
#cmakedefine01 TS_HAS_QUICHE

#define TS_BUILD_CANONICAL_HOST "@CMAKE_HOST@"

Expand Down
20 changes: 18 additions & 2 deletions iocore/net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
#
#######################

add_subdirectory(quic)

if(TS_HAS_QUICHE)
set(QUIC_SOURCES
QUICClosedConCollector.cc
QUICMultiCertConfigLoader.cc
QUICNet.cc
QUICNetProcessor_quiche.cc
QUICNetVConnection_quiche.cc
QUICNextProtocolAccept_quiche.cc
QUICPacketHandler_quiche.cc
)
endif()

add_library(inknet STATIC
ALPNSupport.cc
Expand Down Expand Up @@ -63,7 +76,9 @@ add_library(inknet STATIC
UnixUDPNet.cc
SSLDynlock.cc
SNIActionPerformer.cc
)
${QUIC_SOURCES}
)

target_link_libraries(inknet inkevent records_p)
target_compile_options(inknet PUBLIC -Wno-deprecated-declarations)
target_include_directories(inknet PRIVATE
Expand All @@ -84,7 +99,8 @@ target_include_directories(inknet PRIVATE
${CMAKE_SOURCE_DIR}/src/traffic_server
${OPENSSL_INCLUDE_DIRS}
${YAML_INCLUDE_DIRS}
)
${QUIC_INCLUDE_DIRS}
)

# Fails to link because of circular dep with proxy (ParentSelection)
# add_executable(test_net unit_tests/test_ProxyProtocol.cc)
Expand Down
40 changes: 40 additions & 0 deletions iocore/net/quic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#######################
#
# 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.
#
#######################

add_library(quic STATIC
QUICApplication.cc
QUICApplicationMap.cc
QUICConfig.cc
QUICContext.cc
QUICConnectionTable.cc
QUICGlobals.cc
QUICTypes.cc
QUICIntUtil.cc
QUICStream.cc
QUICStream_quiche.cc
QUICStreamManager.cc
QUICStreamManager_quiche.cc
QUICStreamAdapter.cc
QUICStreamVCAdapter.cc
)

target_include_directories(quic PRIVATE
${CMAKE_SOURCE_DIR}/iocore/net
${CMAKE_SOURCE_DIR}/iocore/net/quic
${CMAKE_SOURCE_DIR}/iocore/eventsystem
Comment on lines +36 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${CMAKE_SOURCE_DIR}/iocore/net
${CMAKE_SOURCE_DIR}/iocore/net/quic
${CMAKE_SOURCE_DIR}/iocore/eventsystem
"${CMAKE_SOURCE_DIR}/iocore/net"
"${CMAKE_SOURCE_DIR}/iocore/net/quic"
"${CMAKE_SOURCE_DIR}/iocore/eventsystem"

${QUIC_INCLUDE_DIRS}
)
3 changes: 3 additions & 0 deletions proxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ add_subdirectory(shared)
add_subdirectory(http)
add_subdirectory(http2)
add_subdirectory(logging)
if (TS_USE_QUIC)
add_subdirectory(http3)
endif(TS_USE_QUIC)
3 changes: 2 additions & 1 deletion proxy/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ target_include_directories(http PRIVATE
${CMAKE_SOURCE_DIR}/mgmt
${CMAKE_SOURCE_DIR}/mgmt/utils
${YAMLCPP_INCLUDE_DIR}
${QUIC_INCLUDE_DIRS}
)
add_subdirectory(remap)
add_subdirectory(remap)
47 changes: 47 additions & 0 deletions proxy/http3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#######################
#
# 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.
#
#######################


add_library(http3 STATIC
Http09App.cc
Http3.cc
Http3Config.cc
Http3App.cc
Http3Types.cc
Http3SessionAccept.cc
Http3Session.cc
Http3Transaction.cc
Http3DebugNames.cc
Http3Frame.cc
Http3FrameCollector.cc
Http3FrameDispatcher.cc
Http3HeaderFramer.cc
Http3DataFramer.cc
Http3HeaderVIOAdaptor.cc
Http3StreamDataVIOAdaptor.cc
QPACK.cc
)

target_include_directories(http3 PRIVATE
${CMAKE_SOURCE_DIR}/iocore/net
${CMAKE_SOURCE_DIR}/iocore/net/quic
${CMAKE_SOURCE_DIR}/iocore/eventsystem
${CMAKE_SOURCE_DIR}/mgmt
Comment on lines +40 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${CMAKE_SOURCE_DIR}/iocore/net
${CMAKE_SOURCE_DIR}/iocore/net/quic
${CMAKE_SOURCE_DIR}/iocore/eventsystem
${CMAKE_SOURCE_DIR}/mgmt
"${CMAKE_SOURCE_DIR}/iocore/net"
"${CMAKE_SOURCE_DIR}/iocore/net/quic"
"${CMAKE_SOURCE_DIR}/iocore/eventsystem"
"${CMAKE_SOURCE_DIR}/mgmt"

${IOCORE_INCLUDE_DIRS}
${PROXY_INCLUDE_DIRS}
${QUIC_INCLUDE_DIRS}
)
5 changes: 4 additions & 1 deletion src/traffic_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
#######################


add_executable(traffic_server
Crash.cc
EventName.cc
Expand All @@ -32,6 +33,7 @@ target_include_directories(traffic_server PRIVATE
${PROXY_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/mgmt
${CMAKE_SOURCE_DIR}/mgmt/utils
${QUIC_INCLUDE_DIRS}
)
target_link_libraries(traffic_server
http
Expand Down Expand Up @@ -59,7 +61,8 @@ target_link_libraries(traffic_server
jsonrpc_protocol
jsonrpc_server
rpcpublichandlers
)
${QUIC_LIBRARIES}
)

if (TS_USE_LINUX_IO_URING)
target_link_libraries(traffic_server inkuring uring)
Expand Down