You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "JosiahWI (via GitHub)" <gi...@apache.org> on 2023/06/14 20:43:26 UTC

[GitHub] [trafficserver] JosiahWI commented on a diff in pull request #9833: cmake builds with quiche/quic support

JosiahWI commented on code in PR #9833:
URL: https://github.com/apache/trafficserver/pull/9833#discussion_r1230142035


##########
cmake/FindQUICHE.cmake:
##########
@@ -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)

Review Comment:
   ```suggestion
   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)
   



##########
CMakeLists.txt:
##########
@@ -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)

Review Comment:
   ```suggestion
   CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
   CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
   ```



##########
cmake/FindQUICHE.cmake:
##########
@@ -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)
+
+INCLUDE(FindPackageHandleStandardArgs)

Review Comment:
   ```suggestion
   include(FindPackageHandleStandardArgs)
   ```



##########
proxy/http3/CMakeLists.txt:
##########
@@ -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

Review Comment:
   ```suggestion
     "${CMAKE_SOURCE_DIR}/iocore/net"
     "${CMAKE_SOURCE_DIR}/iocore/net/quic"
     "${CMAKE_SOURCE_DIR}/iocore/eventsystem"
     "${CMAKE_SOURCE_DIR}/mgmt"
   ```



##########
iocore/net/quic/CMakeLists.txt:
##########
@@ -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

Review Comment:
   ```suggestion
     "${CMAKE_SOURCE_DIR}/iocore/net"
     "${CMAKE_SOURCE_DIR}/iocore/net/quic"
     "${CMAKE_SOURCE_DIR}/iocore/eventsystem"
   ```



##########
cmake/FindQUICHE.cmake:
##########
@@ -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)
+
+INCLUDE(FindPackageHandleStandardArgs)
+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)

Review Comment:
   ```suggestion
     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")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org