protocol-quic 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (343) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/ext/ngtcp2/AUTHORS +44 -0
  4. data/ext/ngtcp2/CMakeLists.txt +431 -0
  5. data/ext/ngtcp2/CMakeOptions.txt +17 -0
  6. data/ext/ngtcp2/COPYING +22 -0
  7. data/ext/ngtcp2/ChangeLog +0 -0
  8. data/ext/ngtcp2/Makefile.am +60 -0
  9. data/ext/ngtcp2/NEWS +0 -0
  10. data/ext/ngtcp2/README +1 -0
  11. data/ext/ngtcp2/README.rst +258 -0
  12. data/ext/ngtcp2/ci/build_boringssl.sh +10 -0
  13. data/ext/ngtcp2/ci/build_nghttp3.sh +9 -0
  14. data/ext/ngtcp2/ci/build_openssl1.sh +8 -0
  15. data/ext/ngtcp2/ci/build_openssl1_cross.sh +9 -0
  16. data/ext/ngtcp2/ci/build_openssl3.sh +8 -0
  17. data/ext/ngtcp2/ci/build_picotls.sh +26 -0
  18. data/ext/ngtcp2/ci/build_wolfssl.sh +9 -0
  19. data/ext/ngtcp2/ci/gen-certificate.sh +8 -0
  20. data/ext/ngtcp2/cmake/ExtractValidFlags.cmake +31 -0
  21. data/ext/ngtcp2/cmake/FindCUnit.cmake +40 -0
  22. data/ext/ngtcp2/cmake/FindJemalloc.cmake +40 -0
  23. data/ext/ngtcp2/cmake/FindLibev.cmake +38 -0
  24. data/ext/ngtcp2/cmake/FindLibnghttp3.cmake +41 -0
  25. data/ext/ngtcp2/cmake/Findwolfssl.cmake +41 -0
  26. data/ext/ngtcp2/cmake/Version.cmake +11 -0
  27. data/ext/ngtcp2/cmakeconfig.h.in +36 -0
  28. data/ext/ngtcp2/configure.ac +755 -0
  29. data/ext/ngtcp2/crypto/CMakeLists.txt +56 -0
  30. data/ext/ngtcp2/crypto/Makefile.am +49 -0
  31. data/ext/ngtcp2/crypto/boringssl/CMakeLists.txt +64 -0
  32. data/ext/ngtcp2/crypto/boringssl/Makefile.am +39 -0
  33. data/ext/ngtcp2/crypto/boringssl/boringssl.c +630 -0
  34. data/ext/ngtcp2/crypto/boringssl/libngtcp2_crypto_boringssl.pc.in +33 -0
  35. data/ext/ngtcp2/crypto/gnutls/CMakeLists.txt +86 -0
  36. data/ext/ngtcp2/crypto/gnutls/Makefile.am +43 -0
  37. data/ext/ngtcp2/crypto/gnutls/gnutls.c +644 -0
  38. data/ext/ngtcp2/crypto/gnutls/libngtcp2_crypto_gnutls.pc.in +33 -0
  39. data/ext/ngtcp2/crypto/includes/CMakeLists.txt +56 -0
  40. data/ext/ngtcp2/crypto/includes/Makefile.am +45 -0
  41. data/ext/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto.h +893 -0
  42. data/ext/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto_boringssl.h +104 -0
  43. data/ext/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto_gnutls.h +107 -0
  44. data/ext/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto_openssl.h +132 -0
  45. data/ext/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto_picotls.h +246 -0
  46. data/ext/ngtcp2/crypto/includes/ngtcp2/ngtcp2_crypto_wolfssl.h +106 -0
  47. data/ext/ngtcp2/crypto/openssl/CMakeLists.txt +86 -0
  48. data/ext/ngtcp2/crypto/openssl/Makefile.am +43 -0
  49. data/ext/ngtcp2/crypto/openssl/libngtcp2_crypto_openssl.pc.in +33 -0
  50. data/ext/ngtcp2/crypto/openssl/openssl.c +807 -0
  51. data/ext/ngtcp2/crypto/picotls/CMakeLists.txt +65 -0
  52. data/ext/ngtcp2/crypto/picotls/Makefile.am +39 -0
  53. data/ext/ngtcp2/crypto/picotls/libngtcp2_crypto_picotls.pc.in +33 -0
  54. data/ext/ngtcp2/crypto/picotls/picotls.c +707 -0
  55. data/ext/ngtcp2/crypto/shared.c +1431 -0
  56. data/ext/ngtcp2/crypto/shared.h +350 -0
  57. data/ext/ngtcp2/crypto/wolfssl/CMakeLists.txt +84 -0
  58. data/ext/ngtcp2/crypto/wolfssl/Makefile.am +43 -0
  59. data/ext/ngtcp2/crypto/wolfssl/libngtcp2_crypto_wolfssl.pc.in +33 -0
  60. data/ext/ngtcp2/crypto/wolfssl/wolfssl.c +534 -0
  61. data/ext/ngtcp2/doc/Makefile.am +65 -0
  62. data/ext/ngtcp2/doc/make.bat +35 -0
  63. data/ext/ngtcp2/doc/mkapiref.py +356 -0
  64. data/ext/ngtcp2/doc/source/conf.py.in +94 -0
  65. data/ext/ngtcp2/doc/source/index.rst +22 -0
  66. data/ext/ngtcp2/doc/source/programmers-guide.rst +476 -0
  67. data/ext/ngtcp2/docker/Dockerfile +39 -0
  68. data/ext/ngtcp2/examples/CMakeLists.txt +361 -0
  69. data/ext/ngtcp2/examples/Makefile.am +228 -0
  70. data/ext/ngtcp2/examples/client.cc +3049 -0
  71. data/ext/ngtcp2/examples/client.h +192 -0
  72. data/ext/ngtcp2/examples/client_base.cc +202 -0
  73. data/ext/ngtcp2/examples/client_base.h +213 -0
  74. data/ext/ngtcp2/examples/debug.cc +298 -0
  75. data/ext/ngtcp2/examples/debug.h +124 -0
  76. data/ext/ngtcp2/examples/examplestest.cc +84 -0
  77. data/ext/ngtcp2/examples/gtlssimpleclient.c +720 -0
  78. data/ext/ngtcp2/examples/h09client.cc +2601 -0
  79. data/ext/ngtcp2/examples/h09client.h +196 -0
  80. data/ext/ngtcp2/examples/h09server.cc +3024 -0
  81. data/ext/ngtcp2/examples/h09server.h +237 -0
  82. data/ext/ngtcp2/examples/http.cc +138 -0
  83. data/ext/ngtcp2/examples/http.h +44 -0
  84. data/ext/ngtcp2/examples/network.h +80 -0
  85. data/ext/ngtcp2/examples/server.cc +3731 -0
  86. data/ext/ngtcp2/examples/server.h +256 -0
  87. data/ext/ngtcp2/examples/server_base.cc +58 -0
  88. data/ext/ngtcp2/examples/server_base.h +195 -0
  89. data/ext/ngtcp2/examples/shared.cc +385 -0
  90. data/ext/ngtcp2/examples/shared.h +96 -0
  91. data/ext/ngtcp2/examples/simpleclient.c +683 -0
  92. data/ext/ngtcp2/examples/template.h +71 -0
  93. data/ext/ngtcp2/examples/tests/README.rst +60 -0
  94. data/ext/ngtcp2/examples/tests/__init__.py +0 -0
  95. data/ext/ngtcp2/examples/tests/config.ini.in +32 -0
  96. data/ext/ngtcp2/examples/tests/conftest.py +28 -0
  97. data/ext/ngtcp2/examples/tests/ngtcp2test/__init__.py +6 -0
  98. data/ext/ngtcp2/examples/tests/ngtcp2test/certs.py +476 -0
  99. data/ext/ngtcp2/examples/tests/ngtcp2test/client.py +187 -0
  100. data/ext/ngtcp2/examples/tests/ngtcp2test/env.py +191 -0
  101. data/ext/ngtcp2/examples/tests/ngtcp2test/log.py +101 -0
  102. data/ext/ngtcp2/examples/tests/ngtcp2test/server.py +137 -0
  103. data/ext/ngtcp2/examples/tests/ngtcp2test/tls.py +983 -0
  104. data/ext/ngtcp2/examples/tests/test_01_handshake.py +30 -0
  105. data/ext/ngtcp2/examples/tests/test_02_resume.py +46 -0
  106. data/ext/ngtcp2/examples/tests/test_03_earlydata.py +56 -0
  107. data/ext/ngtcp2/examples/tests/test_04_clientcert.py +57 -0
  108. data/ext/ngtcp2/examples/tests/test_05_ciphers.py +46 -0
  109. data/ext/ngtcp2/examples/tls_client_context.h +52 -0
  110. data/ext/ngtcp2/examples/tls_client_context_boringssl.cc +126 -0
  111. data/ext/ngtcp2/examples/tls_client_context_boringssl.h +49 -0
  112. data/ext/ngtcp2/examples/tls_client_context_gnutls.cc +74 -0
  113. data/ext/ngtcp2/examples/tls_client_context_gnutls.h +50 -0
  114. data/ext/ngtcp2/examples/tls_client_context_openssl.cc +137 -0
  115. data/ext/ngtcp2/examples/tls_client_context_openssl.h +49 -0
  116. data/ext/ngtcp2/examples/tls_client_context_picotls.cc +158 -0
  117. data/ext/ngtcp2/examples/tls_client_context_picotls.h +53 -0
  118. data/ext/ngtcp2/examples/tls_client_context_wolfssl.cc +177 -0
  119. data/ext/ngtcp2/examples/tls_client_context_wolfssl.h +51 -0
  120. data/ext/ngtcp2/examples/tls_client_session.h +52 -0
  121. data/ext/ngtcp2/examples/tls_client_session_boringssl.cc +110 -0
  122. data/ext/ngtcp2/examples/tls_client_session_boringssl.h +52 -0
  123. data/ext/ngtcp2/examples/tls_client_session_gnutls.cc +190 -0
  124. data/ext/ngtcp2/examples/tls_client_session_gnutls.h +52 -0
  125. data/ext/ngtcp2/examples/tls_client_session_openssl.cc +113 -0
  126. data/ext/ngtcp2/examples/tls_client_session_openssl.h +52 -0
  127. data/ext/ngtcp2/examples/tls_client_session_picotls.cc +147 -0
  128. data/ext/ngtcp2/examples/tls_client_session_picotls.h +52 -0
  129. data/ext/ngtcp2/examples/tls_client_session_wolfssl.cc +160 -0
  130. data/ext/ngtcp2/examples/tls_client_session_wolfssl.h +52 -0
  131. data/ext/ngtcp2/examples/tls_server_context.h +52 -0
  132. data/ext/ngtcp2/examples/tls_server_context_boringssl.cc +257 -0
  133. data/ext/ngtcp2/examples/tls_server_context_boringssl.h +54 -0
  134. data/ext/ngtcp2/examples/tls_server_context_gnutls.cc +99 -0
  135. data/ext/ngtcp2/examples/tls_server_context_gnutls.h +59 -0
  136. data/ext/ngtcp2/examples/tls_server_context_openssl.cc +338 -0
  137. data/ext/ngtcp2/examples/tls_server_context_openssl.h +54 -0
  138. data/ext/ngtcp2/examples/tls_server_context_picotls.cc +321 -0
  139. data/ext/ngtcp2/examples/tls_server_context_picotls.h +58 -0
  140. data/ext/ngtcp2/examples/tls_server_context_wolfssl.cc +284 -0
  141. data/ext/ngtcp2/examples/tls_server_context_wolfssl.h +55 -0
  142. data/ext/ngtcp2/examples/tls_server_session.h +52 -0
  143. data/ext/ngtcp2/examples/tls_server_session_boringssl.cc +84 -0
  144. data/ext/ngtcp2/examples/tls_server_session_boringssl.h +47 -0
  145. data/ext/ngtcp2/examples/tls_server_session_gnutls.cc +155 -0
  146. data/ext/ngtcp2/examples/tls_server_session_gnutls.h +46 -0
  147. data/ext/ngtcp2/examples/tls_server_session_openssl.cc +54 -0
  148. data/ext/ngtcp2/examples/tls_server_session_openssl.h +47 -0
  149. data/ext/ngtcp2/examples/tls_server_session_picotls.cc +70 -0
  150. data/ext/ngtcp2/examples/tls_server_session_picotls.h +47 -0
  151. data/ext/ngtcp2/examples/tls_server_session_wolfssl.cc +55 -0
  152. data/ext/ngtcp2/examples/tls_server_session_wolfssl.h +47 -0
  153. data/ext/ngtcp2/examples/tls_session_base_gnutls.cc +87 -0
  154. data/ext/ngtcp2/examples/tls_session_base_gnutls.h +51 -0
  155. data/ext/ngtcp2/examples/tls_session_base_openssl.cc +54 -0
  156. data/ext/ngtcp2/examples/tls_session_base_openssl.h +52 -0
  157. data/ext/ngtcp2/examples/tls_session_base_picotls.cc +56 -0
  158. data/ext/ngtcp2/examples/tls_session_base_picotls.h +54 -0
  159. data/ext/ngtcp2/examples/tls_session_base_wolfssl.cc +54 -0
  160. data/ext/ngtcp2/examples/tls_session_base_wolfssl.h +54 -0
  161. data/ext/ngtcp2/examples/tls_shared_picotls.cc +59 -0
  162. data/ext/ngtcp2/examples/tls_shared_picotls.h +36 -0
  163. data/ext/ngtcp2/examples/util.cc +646 -0
  164. data/ext/ngtcp2/examples/util.h +361 -0
  165. data/ext/ngtcp2/examples/util_gnutls.cc +136 -0
  166. data/ext/ngtcp2/examples/util_openssl.cc +131 -0
  167. data/ext/ngtcp2/examples/util_test.cc +237 -0
  168. data/ext/ngtcp2/examples/util_test.h +45 -0
  169. data/ext/ngtcp2/examples/util_wolfssl.cc +130 -0
  170. data/ext/ngtcp2/fuzz/corpus/decode_frame/ack +0 -0
  171. data/ext/ngtcp2/fuzz/corpus/decode_frame/ack_ecn +0 -0
  172. data/ext/ngtcp2/fuzz/corpus/decode_frame/connection_close +0 -0
  173. data/ext/ngtcp2/fuzz/corpus/decode_frame/crypto +1 -0
  174. data/ext/ngtcp2/fuzz/corpus/decode_frame/data_blocked +1 -0
  175. data/ext/ngtcp2/fuzz/corpus/decode_frame/datagram +1 -0
  176. data/ext/ngtcp2/fuzz/corpus/decode_frame/datagram_len +1 -0
  177. data/ext/ngtcp2/fuzz/corpus/decode_frame/max_data +1 -0
  178. data/ext/ngtcp2/fuzz/corpus/decode_frame/max_stream_data +0 -0
  179. data/ext/ngtcp2/fuzz/corpus/decode_frame/max_streams +0 -0
  180. data/ext/ngtcp2/fuzz/corpus/decode_frame/new_connection_id +1 -0
  181. data/ext/ngtcp2/fuzz/corpus/decode_frame/new_token +1 -0
  182. data/ext/ngtcp2/fuzz/corpus/decode_frame/path_challenge +1 -0
  183. data/ext/ngtcp2/fuzz/corpus/decode_frame/path_response +1 -0
  184. data/ext/ngtcp2/fuzz/corpus/decode_frame/reset_stream +0 -0
  185. data/ext/ngtcp2/fuzz/corpus/decode_frame/retire_connection_id +1 -0
  186. data/ext/ngtcp2/fuzz/corpus/decode_frame/stop_sending +0 -0
  187. data/ext/ngtcp2/fuzz/corpus/decode_frame/stream +0 -0
  188. data/ext/ngtcp2/fuzz/corpus/decode_frame/stream_data_blocked +0 -0
  189. data/ext/ngtcp2/fuzz/corpus/decode_frame/stream_len +0 -0
  190. data/ext/ngtcp2/fuzz/corpus/decode_frame/streams_blocked +0 -0
  191. data/ext/ngtcp2/fuzz/corpus/ksl/random +0 -0
  192. data/ext/ngtcp2/fuzz/decode_frame.cc +25 -0
  193. data/ext/ngtcp2/fuzz/ksl.cc +77 -0
  194. data/ext/ngtcp2/interop/Dockerfile +39 -0
  195. data/ext/ngtcp2/interop/run_endpoint.sh +93 -0
  196. data/ext/ngtcp2/lib/CMakeLists.txt +110 -0
  197. data/ext/ngtcp2/lib/Makefile.am +122 -0
  198. data/ext/ngtcp2/lib/includes/CMakeLists.txt +4 -0
  199. data/ext/ngtcp2/lib/includes/Makefile.am +25 -0
  200. data/ext/ngtcp2/lib/includes/ngtcp2/ngtcp2.h +5843 -0
  201. data/ext/ngtcp2/lib/includes/ngtcp2/version.h.in +51 -0
  202. data/ext/ngtcp2/lib/libngtcp2.pc.in +33 -0
  203. data/ext/ngtcp2/lib/ngtcp2_acktr.c +335 -0
  204. data/ext/ngtcp2/lib/ngtcp2_acktr.h +221 -0
  205. data/ext/ngtcp2/lib/ngtcp2_addr.c +117 -0
  206. data/ext/ngtcp2/lib/ngtcp2_addr.h +69 -0
  207. data/ext/ngtcp2/lib/ngtcp2_balloc.c +90 -0
  208. data/ext/ngtcp2/lib/ngtcp2_balloc.h +91 -0
  209. data/ext/ngtcp2/lib/ngtcp2_bbr.c +693 -0
  210. data/ext/ngtcp2/lib/ngtcp2_bbr.h +157 -0
  211. data/ext/ngtcp2/lib/ngtcp2_bbr2.c +1490 -0
  212. data/ext/ngtcp2/lib/ngtcp2_bbr2.h +149 -0
  213. data/ext/ngtcp2/lib/ngtcp2_buf.c +56 -0
  214. data/ext/ngtcp2/lib/ngtcp2_buf.h +108 -0
  215. data/ext/ngtcp2/lib/ngtcp2_cc.c +616 -0
  216. data/ext/ngtcp2/lib/ngtcp2_cc.h +422 -0
  217. data/ext/ngtcp2/lib/ngtcp2_cid.c +147 -0
  218. data/ext/ngtcp2/lib/ngtcp2_cid.h +175 -0
  219. data/ext/ngtcp2/lib/ngtcp2_conn.c +13731 -0
  220. data/ext/ngtcp2/lib/ngtcp2_conn.h +1119 -0
  221. data/ext/ngtcp2/lib/ngtcp2_conn_stat.h +131 -0
  222. data/ext/ngtcp2/lib/ngtcp2_conv.c +291 -0
  223. data/ext/ngtcp2/lib/ngtcp2_conv.h +208 -0
  224. data/ext/ngtcp2/lib/ngtcp2_crypto.c +895 -0
  225. data/ext/ngtcp2/lib/ngtcp2_crypto.h +148 -0
  226. data/ext/ngtcp2/lib/ngtcp2_err.c +154 -0
  227. data/ext/ngtcp2/lib/ngtcp2_err.h +34 -0
  228. data/ext/ngtcp2/lib/ngtcp2_gaptr.c +167 -0
  229. data/ext/ngtcp2/lib/ngtcp2_gaptr.h +98 -0
  230. data/ext/ngtcp2/lib/ngtcp2_idtr.c +79 -0
  231. data/ext/ngtcp2/lib/ngtcp2_idtr.h +89 -0
  232. data/ext/ngtcp2/lib/ngtcp2_ksl.c +819 -0
  233. data/ext/ngtcp2/lib/ngtcp2_ksl.h +345 -0
  234. data/ext/ngtcp2/lib/ngtcp2_log.c +822 -0
  235. data/ext/ngtcp2/lib/ngtcp2_log.h +123 -0
  236. data/ext/ngtcp2/lib/ngtcp2_macro.h +58 -0
  237. data/ext/ngtcp2/lib/ngtcp2_map.c +336 -0
  238. data/ext/ngtcp2/lib/ngtcp2_map.h +136 -0
  239. data/ext/ngtcp2/lib/ngtcp2_mem.c +113 -0
  240. data/ext/ngtcp2/lib/ngtcp2_mem.h +72 -0
  241. data/ext/ngtcp2/lib/ngtcp2_net.h +136 -0
  242. data/ext/ngtcp2/lib/ngtcp2_objalloc.c +40 -0
  243. data/ext/ngtcp2/lib/ngtcp2_objalloc.h +140 -0
  244. data/ext/ngtcp2/lib/ngtcp2_opl.c +46 -0
  245. data/ext/ngtcp2/lib/ngtcp2_opl.h +65 -0
  246. data/ext/ngtcp2/lib/ngtcp2_path.c +77 -0
  247. data/ext/ngtcp2/lib/ngtcp2_path.h +49 -0
  248. data/ext/ngtcp2/lib/ngtcp2_pkt.c +2527 -0
  249. data/ext/ngtcp2/lib/ngtcp2_pkt.h +1235 -0
  250. data/ext/ngtcp2/lib/ngtcp2_pmtud.c +160 -0
  251. data/ext/ngtcp2/lib/ngtcp2_pmtud.h +123 -0
  252. data/ext/ngtcp2/lib/ngtcp2_ppe.c +230 -0
  253. data/ext/ngtcp2/lib/ngtcp2_ppe.h +153 -0
  254. data/ext/ngtcp2/lib/ngtcp2_pq.c +164 -0
  255. data/ext/ngtcp2/lib/ngtcp2_pq.h +126 -0
  256. data/ext/ngtcp2/lib/ngtcp2_pv.c +172 -0
  257. data/ext/ngtcp2/lib/ngtcp2_pv.h +194 -0
  258. data/ext/ngtcp2/lib/ngtcp2_qlog.c +1219 -0
  259. data/ext/ngtcp2/lib/ngtcp2_qlog.h +161 -0
  260. data/ext/ngtcp2/lib/ngtcp2_range.c +61 -0
  261. data/ext/ngtcp2/lib/ngtcp2_range.h +80 -0
  262. data/ext/ngtcp2/lib/ngtcp2_rcvry.h +40 -0
  263. data/ext/ngtcp2/lib/ngtcp2_ringbuf.c +121 -0
  264. data/ext/ngtcp2/lib/ngtcp2_ringbuf.h +132 -0
  265. data/ext/ngtcp2/lib/ngtcp2_rob.c +319 -0
  266. data/ext/ngtcp2/lib/ngtcp2_rob.h +197 -0
  267. data/ext/ngtcp2/lib/ngtcp2_rst.c +138 -0
  268. data/ext/ngtcp2/lib/ngtcp2_rst.h +86 -0
  269. data/ext/ngtcp2/lib/ngtcp2_rtb.c +1676 -0
  270. data/ext/ngtcp2/lib/ngtcp2_rtb.h +468 -0
  271. data/ext/ngtcp2/lib/ngtcp2_str.c +233 -0
  272. data/ext/ngtcp2/lib/ngtcp2_str.h +94 -0
  273. data/ext/ngtcp2/lib/ngtcp2_strm.c +698 -0
  274. data/ext/ngtcp2/lib/ngtcp2_strm.h +310 -0
  275. data/ext/ngtcp2/lib/ngtcp2_unreachable.c +71 -0
  276. data/ext/ngtcp2/lib/ngtcp2_unreachable.h +46 -0
  277. data/ext/ngtcp2/lib/ngtcp2_vec.c +243 -0
  278. data/ext/ngtcp2/lib/ngtcp2_vec.h +120 -0
  279. data/ext/ngtcp2/lib/ngtcp2_version.c +39 -0
  280. data/ext/ngtcp2/lib/ngtcp2_window_filter.c +99 -0
  281. data/ext/ngtcp2/lib/ngtcp2_window_filter.h +65 -0
  282. data/ext/ngtcp2/m4/ax_check_compile_flag.m4 +74 -0
  283. data/ext/ngtcp2/m4/ax_cxx_compile_stdcxx.m4 +1009 -0
  284. data/ext/ngtcp2/tests/CMakeLists.txt +68 -0
  285. data/ext/ngtcp2/tests/Makefile.am +94 -0
  286. data/ext/ngtcp2/tests/main.c +358 -0
  287. data/ext/ngtcp2/tests/ngtcp2_acktr_test.c +367 -0
  288. data/ext/ngtcp2/tests/ngtcp2_acktr_test.h +37 -0
  289. data/ext/ngtcp2/tests/ngtcp2_conn_test.c +9821 -0
  290. data/ext/ngtcp2/tests/ngtcp2_conn_test.h +104 -0
  291. data/ext/ngtcp2/tests/ngtcp2_conv_test.c +430 -0
  292. data/ext/ngtcp2/tests/ngtcp2_conv_test.h +46 -0
  293. data/ext/ngtcp2/tests/ngtcp2_crypto_test.c +667 -0
  294. data/ext/ngtcp2/tests/ngtcp2_crypto_test.h +35 -0
  295. data/ext/ngtcp2/tests/ngtcp2_gaptr_test.c +127 -0
  296. data/ext/ngtcp2/tests/ngtcp2_gaptr_test.h +36 -0
  297. data/ext/ngtcp2/tests/ngtcp2_idtr_test.c +79 -0
  298. data/ext/ngtcp2/tests/ngtcp2_idtr_test.h +34 -0
  299. data/ext/ngtcp2/tests/ngtcp2_ksl_test.c +502 -0
  300. data/ext/ngtcp2/tests/ngtcp2_ksl_test.h +39 -0
  301. data/ext/ngtcp2/tests/ngtcp2_map_test.c +206 -0
  302. data/ext/ngtcp2/tests/ngtcp2_map_test.h +38 -0
  303. data/ext/ngtcp2/tests/ngtcp2_pkt_test.c +1645 -0
  304. data/ext/ngtcp2/tests/ngtcp2_pkt_test.h +68 -0
  305. data/ext/ngtcp2/tests/ngtcp2_pmtud_test.c +153 -0
  306. data/ext/ngtcp2/tests/ngtcp2_pmtud_test.h +34 -0
  307. data/ext/ngtcp2/tests/ngtcp2_pv_test.c +129 -0
  308. data/ext/ngtcp2/tests/ngtcp2_pv_test.h +35 -0
  309. data/ext/ngtcp2/tests/ngtcp2_range_test.c +105 -0
  310. data/ext/ngtcp2/tests/ngtcp2_range_test.h +36 -0
  311. data/ext/ngtcp2/tests/ngtcp2_ringbuf_test.c +91 -0
  312. data/ext/ngtcp2/tests/ngtcp2_ringbuf_test.h +35 -0
  313. data/ext/ngtcp2/tests/ngtcp2_rob_test.c +552 -0
  314. data/ext/ngtcp2/tests/ngtcp2_rob_test.h +37 -0
  315. data/ext/ngtcp2/tests/ngtcp2_rtb_test.c +470 -0
  316. data/ext/ngtcp2/tests/ngtcp2_rtb_test.h +38 -0
  317. data/ext/ngtcp2/tests/ngtcp2_str_test.c +96 -0
  318. data/ext/ngtcp2/tests/ngtcp2_str_test.h +36 -0
  319. data/ext/ngtcp2/tests/ngtcp2_strm_test.c +575 -0
  320. data/ext/ngtcp2/tests/ngtcp2_strm_test.h +36 -0
  321. data/ext/ngtcp2/tests/ngtcp2_test_helper.c +404 -0
  322. data/ext/ngtcp2/tests/ngtcp2_test_helper.h +191 -0
  323. data/ext/ngtcp2/tests/ngtcp2_vec_test.c +426 -0
  324. data/ext/ngtcp2/tests/ngtcp2_vec_test.h +36 -0
  325. data/ext/ngtcp2/third-party/CMakeLists.txt +34 -0
  326. data/ext/ngtcp2/third-party/Makefile.am +31 -0
  327. data/ext/ngtcp2/third-party/http-parser/AUTHORS +68 -0
  328. data/ext/ngtcp2/third-party/http-parser/LICENSE-MIT +23 -0
  329. data/ext/ngtcp2/third-party/http-parser/Makefile +157 -0
  330. data/ext/ngtcp2/third-party/http-parser/README.md +246 -0
  331. data/ext/ngtcp2/third-party/http-parser/bench.c +111 -0
  332. data/ext/ngtcp2/third-party/http-parser/contrib/parsertrace.c +160 -0
  333. data/ext/ngtcp2/third-party/http-parser/contrib/url_parser.c +47 -0
  334. data/ext/ngtcp2/third-party/http-parser/http_parser.c +2419 -0
  335. data/ext/ngtcp2/third-party/http-parser/http_parser.gyp +111 -0
  336. data/ext/ngtcp2/third-party/http-parser/http_parser.h +431 -0
  337. data/ext/ngtcp2/third-party/http-parser/test.c +4411 -0
  338. data/lib/protocol/quic/version.rb +10 -0
  339. data/lib/protocol/quic.rb +9 -0
  340. data/license.md +21 -0
  341. data.tar.gz.sig +1 -0
  342. metadata +424 -0
  343. metadata.gz.sig +1 -0
@@ -0,0 +1,755 @@
1
+ # ngtcp2
2
+ #
3
+ # Copyright (c) 2016 ngtcp2 contributors
4
+ # Copyright (c) 2012 nghttp2 contributors
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining
7
+ # a copy of this software and associated documentation files (the
8
+ # "Software"), to deal in the Software without restriction, including
9
+ # without limitation the rights to use, copy, modify, merge, publish,
10
+ # distribute, sublicense, and/or sell copies of the Software, and to
11
+ # permit persons to whom the Software is furnished to do so, subject to
12
+ # the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be
15
+ # included in all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
+ AC_PREREQ(2.61)
25
+ AC_INIT([ngtcp2], [0.14.0-DEV], [t-tujikawa@users.sourceforge.net])
26
+ AC_CONFIG_AUX_DIR([.])
27
+ AC_CONFIG_MACRO_DIR([m4])
28
+ AC_CONFIG_HEADERS([config.h])
29
+ AC_USE_SYSTEM_EXTENSIONS
30
+
31
+ LT_PREREQ([2.2.6])
32
+ LT_INIT()
33
+
34
+ AC_CANONICAL_BUILD
35
+ AC_CANONICAL_HOST
36
+ AC_CANONICAL_TARGET
37
+
38
+ AM_INIT_AUTOMAKE([subdir-objects])
39
+
40
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
41
+
42
+ # See versioning rule:
43
+ # https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
44
+ AC_SUBST(LT_CURRENT, 10)
45
+ AC_SUBST(LT_REVISION, 1)
46
+ AC_SUBST(LT_AGE, 0)
47
+
48
+ AC_SUBST(CRYPTO_OPENSSL_LT_CURRENT, 4)
49
+ AC_SUBST(CRYPTO_OPENSSL_LT_REVISION, 0)
50
+ AC_SUBST(CRYPTO_OPENSSL_LT_AGE, 0)
51
+
52
+ AC_SUBST(CRYPTO_GNUTLS_LT_CURRENT, 4)
53
+ AC_SUBST(CRYPTO_GNUTLS_LT_REVISION, 0)
54
+ AC_SUBST(CRYPTO_GNUTLS_LT_AGE, 0)
55
+
56
+ AC_SUBST(CRYPTO_WOLFSSL_LT_CURRENT, 1)
57
+ AC_SUBST(CRYPTO_WOLFSSL_LT_REVISION, 0)
58
+ AC_SUBST(CRYPTO_WOLFSSL_LT_AGE, 0)
59
+
60
+ # from nghttp2
61
+ major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
62
+ minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
63
+ patch=`echo $PACKAGE_VERSION |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
64
+
65
+ PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"`
66
+
67
+ AC_SUBST(PACKAGE_VERSION_NUM)
68
+
69
+ # Checks for command-line options from ngtcp2
70
+ AC_ARG_ENABLE([werror],
71
+ [AS_HELP_STRING([--enable-werror],
72
+ [Turn on compile time warnings])],
73
+ [werror=$enableval], [werror=no])
74
+
75
+ AC_ARG_ENABLE([debug],
76
+ [AS_HELP_STRING([--enable-debug],
77
+ [Turn on debug output])],
78
+ [debug=$enableval], [debug=no])
79
+
80
+ if test "x${debug}" = "xyes"; then
81
+ DEBUGCFLAGS="-O0 -g3"
82
+ AC_SUBST([DEBUGCFLAGS])
83
+ AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.])
84
+ fi
85
+
86
+ AC_ARG_ENABLE([memdebug],
87
+ [AS_HELP_STRING([--enable-memdebug],
88
+ [Turn on memory allocation debug output])],
89
+ [memdebug=$enableval], [memdebug=no])
90
+
91
+ AC_ARG_ENABLE([mempool],
92
+ [AS_HELP_STRING([--enable-mempool], [Turn on memory pool [default=yes]])],
93
+ [mempool=$enableval], [mempool=yes])
94
+
95
+ AC_ARG_ENABLE(asan,
96
+ AS_HELP_STRING([--enable-asan],
97
+ [Enable AddressSanitizer (ASAN)]),
98
+ [asan=$enableval], [asan=no])
99
+
100
+ AC_ARG_ENABLE([lib-only],
101
+ [AS_HELP_STRING([--enable-lib-only],
102
+ [Build libngtcp2 and libngtcp2_crypto only.])],
103
+ [lib_only=$enableval], [lib_only=no])
104
+
105
+ AC_ARG_WITH([jemalloc],
106
+ [AS_HELP_STRING([--with-jemalloc],
107
+ [Use jemalloc [default=check]])],
108
+ [request_jemalloc=$withval], [request_jemalloc=check])
109
+
110
+ AC_ARG_WITH([cunit],
111
+ [AS_HELP_STRING([--with-cunit],
112
+ [Use cunit [default=check]])],
113
+ [request_cunit=$withval], [request_cunit=check])
114
+
115
+ AC_ARG_WITH([libnghttp3],
116
+ [AS_HELP_STRING([--with-libnghttp3],
117
+ [Use libnghttp3 [default=check]])],
118
+ [request_libnghttp3=$withval], [request_libnghttp3=check])
119
+
120
+ AC_ARG_WITH([libev],
121
+ [AS_HELP_STRING([--with-libev],
122
+ [Use libev [default=check]])],
123
+ [request_libev=$withval], [request_libev=check])
124
+
125
+ AC_ARG_WITH([openssl],
126
+ [AS_HELP_STRING([--with-openssl],
127
+ [Use openssl [default=check]])],
128
+ [request_openssl=$withval], [request_openssl=check])
129
+
130
+ AC_ARG_WITH([gnutls],
131
+ [AS_HELP_STRING([--with-gnutls],
132
+ [Use gnutls [default=no]])],
133
+ [request_gnutls=$withval], [request_gnutls=no])
134
+
135
+ AC_ARG_WITH([boringssl],
136
+ [AS_HELP_STRING([--with-boringssl],
137
+ [Use boringssl [default=no]])],
138
+ [request_boringssl=$withval], [request_boringssl=no])
139
+
140
+ AC_ARG_WITH([picotls],
141
+ [AS_HELP_STRING([--with-picotls],
142
+ [Use picotls [default=no]])],
143
+ [request_picotls=$withval], [request_picotls=no])
144
+
145
+ AC_ARG_WITH([wolfssl],
146
+ [AS_HELP_STRING([--with-wolfssl],
147
+ [Use wolfSSL [default=no]])],
148
+ [request_wolfssl=$withval], [request_wolfssl=no])
149
+
150
+ AC_ARG_VAR([BORINGSSL_CFLAGS], [C compiler flags for BORINGSSL])
151
+ AC_ARG_VAR([BORINGSSL_LIBS], [linker flags for BORINGSSL])
152
+
153
+ AC_ARG_VAR([PICOTLS_CFLAGS], [C compiler flags for PICOTLS])
154
+ AC_ARG_VAR([PICOTLS_LIBS], [linker flags for PICOTLS])
155
+
156
+ AC_ARG_VAR([WOLFSSL_CFLAGS], [C compiler flags for WOLFSSL])
157
+ AC_ARG_VAR([WOLFSSL_LIBS], [linker flags for WOLFSSL])
158
+
159
+ AC_ARG_VAR([LIBEV_CFLAGS], [C compiler flags for libev, skipping any checks])
160
+ AC_ARG_VAR([LIBEV_LIBS], [linker flags for libev, skipping any checks])
161
+
162
+ AC_ARG_VAR([JEMALLOC_CFLAGS],
163
+ [C compiler flags for jemalloc, skipping any checks])
164
+ AC_ARG_VAR([JEMALLOC_LIBS], [linker flags for jemalloc, skipping any checks])
165
+
166
+ AC_ARG_VAR([LIBTOOL_LDFLAGS],
167
+ [libtool specific flags (e.g., -static-libtool-libs)])
168
+
169
+ # Checks for programs
170
+ AC_PROG_CC
171
+ AC_PROG_CXX
172
+ AC_PROG_CPP
173
+ AC_PROG_INSTALL
174
+ AC_PROG_LN_S
175
+ AC_PROG_MAKE_SET
176
+ AC_PROG_MKDIR_P
177
+
178
+ PKG_PROG_PKG_CONFIG([0.20])
179
+
180
+ AX_CXX_COMPILE_STDCXX([20], [noext], [optional])
181
+
182
+ case "${build}" in
183
+ *-apple-darwin*)
184
+ EXTRA_DEFS="-D__APPLE_USE_RFC_3542"
185
+ AC_SUBST([EXTRA_DEFS])
186
+ ;;
187
+ esac
188
+
189
+ # Checks for libraries.
190
+
191
+ # cunit
192
+ have_cunit=no
193
+ if test "x${request_cunit}" != "xno"; then
194
+ PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
195
+ # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
196
+ # do this because Debian (Ubuntu) lacks pkg-config file for cunit.
197
+ if test "x${have_cunit}" = "xno"; then
198
+ AC_MSG_WARN([${CUNIT_PKG_ERRORS}])
199
+ AC_CHECK_LIB([cunit], [CU_initialize_registry],
200
+ [have_cunit=yes], [have_cunit=no])
201
+ if test "x${have_cunit}" = "xyes"; then
202
+ CUNIT_LIBS="-lcunit"
203
+ CUNIT_CFLAGS=""
204
+ AC_SUBST([CUNIT_LIBS])
205
+ AC_SUBST([CUNIT_CFLAGS])
206
+ fi
207
+ fi
208
+ if test "x${have_cunit}" = "xyes"; then
209
+ # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
210
+ # program can be built without -lncurses, but it emits runtime
211
+ # error.
212
+ case "${build}" in
213
+ *-apple-darwin*)
214
+ CUNIT_LIBS="$CUNIT_LIBS -lncurses"
215
+ AC_SUBST([CUNIT_LIBS])
216
+ ;;
217
+ esac
218
+ fi
219
+ fi
220
+
221
+ if test "x${request_cunit}" = "xyes" &&
222
+ test "x${have_cunit}" != "xyes"; then
223
+ AC_MSG_ERROR([cunit was requested (--with-cunit) but not found])
224
+ fi
225
+
226
+ AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
227
+
228
+ AM_CONDITIONAL([ENABLE_SHARED], [ test "x${enable_shared}" = "xyes" ])
229
+
230
+ # OpenSSL (required for libngtcp2_crypto_openssl,
231
+ # libngtcp2_crypto_picotls and examples)
232
+ have_openssl=no
233
+ have_vanilla_openssl=no
234
+ if test "x${request_openssl}" != "xno"; then
235
+ PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.1],
236
+ [have_openssl=yes], [have_openssl=no])
237
+ if test "x${have_openssl}" = "xno"; then
238
+ AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
239
+ else
240
+ have_vanilla_openssl=yes
241
+ VANILLA_OPENSSL_LIBS="$OPENSSL_LIBS"
242
+ VANILLA_OPENSSL_CFLAGS="$OPENSSL_CFLAGS"
243
+
244
+ AC_SUBST(VANILLA_OPENSSL_LIBS)
245
+ AC_SUBST(VANILLA_OPENSSL_CFLAGS)
246
+
247
+ # Until OpenSSL gains mainline support for QUIC, check for a
248
+ # patched version.
249
+
250
+ save_CFLAGS="$CFLAGS"
251
+ save_LIBS="$LIBS"
252
+ CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
253
+ LIBS="$OPENSSL_LIBS $LIBS"
254
+
255
+ AC_MSG_CHECKING([for SSL_is_quic])
256
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
257
+ #include <openssl/ssl.h>
258
+ ]], [[
259
+ SSL *ssl = NULL;
260
+ SSL_is_quic(ssl);
261
+ ]])],
262
+ [AC_MSG_RESULT([yes]); have_openssl_quic=yes],
263
+ [AC_MSG_RESULT([no]); have_openssl_quic=no])
264
+
265
+ CFLAGS="$save_CFLAGS"
266
+ LIBS="$save_LIBS"
267
+
268
+ if test "x${have_openssl_quic}" = "xno"; then
269
+ AC_MSG_NOTICE([openssl does not have QUIC interface, disabling it])
270
+ have_openssl=no
271
+ OPENSSL_LIBS=
272
+ OPENSSL_CFLAGS=
273
+ fi
274
+ fi
275
+ fi
276
+
277
+ if test "x${request_openssl}" = "xyes" &&
278
+ test "x${have_openssl}" != "xyes"; then
279
+ AC_MSG_ERROR([openssl was requested (--with-openssl) but not found])
280
+ fi
281
+
282
+ AM_CONDITIONAL([HAVE_OPENSSL], [ test "x${have_openssl}" = "xyes" ])
283
+
284
+ # GnuTLS (required for libngtcp2_crypto_gnutls)
285
+ have_gnutls=no
286
+ if test "x${request_gnutls}" != "xno"; then
287
+ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.7.2],
288
+ [have_gnutls=yes], [have_gnutls=no])
289
+ if test "x${have_gnutls}" = "xno"; then
290
+ AC_MSG_NOTICE($GNUTLS_PKG_ERRORS)
291
+ fi
292
+ fi
293
+
294
+ if test "x${request_gnutls}" = "xyes" &&
295
+ test "x${have_gnutls}" != "xyes"; then
296
+ AC_MSG_ERROR([gnutls was requested (--with-gnutls) but not found])
297
+ fi
298
+
299
+ AM_CONDITIONAL([HAVE_GNUTLS], [ test "x${have_gnutls}" = "xyes" ])
300
+
301
+ # BoringSSL (required for libngtcp2_crypto_boringssl)
302
+ have_boringssl=no
303
+ if test "x${request_boringssl}" != "xno"; then
304
+ save_CFLAGS="$CFLAGS"
305
+ save_LIBS="$LIBS"
306
+ CFLAGS="$BORINGSSL_CFLAGS $CFLAGS"
307
+ LIBS="$BORINGSSL_LIBS $LIBS"
308
+
309
+ AC_MSG_CHECKING([for SSL_set_quic_early_data_context])
310
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
311
+ #include <openssl/ssl.h>
312
+ ]], [[
313
+ SSL *ssl = NULL;
314
+ SSL_set_quic_early_data_context(ssl, NULL, 0);
315
+ ]])],
316
+ [AC_MSG_RESULT([yes]); have_boringssl=yes],
317
+ [AC_MSG_RESULT([no]); have_boringssl=no])
318
+
319
+ CFLAGS="$save_CFLAGS"
320
+ LIBS="$save_LIBS"
321
+ fi
322
+
323
+ if test "x${request_boringssl}" = "xyes" &&
324
+ test "x${have_boringssl}" != "xyes"; then
325
+ AC_MSG_ERROR([boringssl was requested (--with-boringssl) but not found])
326
+ fi
327
+
328
+ AM_CONDITIONAL([HAVE_BORINGSSL], [ test "x${have_boringssl}" = "xyes" ])
329
+
330
+ # Picotls openssl backend (required for libngtcp2_crypto_picotls)
331
+ have_picotls=no
332
+ if test "x${request_picotls}" != "xno"; then
333
+ save_CFLAGS="$CFLAGS"
334
+ save_LIBS="$LIBS"
335
+ CFLAGS="$PICOTLS_CFLAGS $VANILLA_OPENSSL_CFLAGS $CFLAGS"
336
+ LIBS="$PICOTLS_LIBS $VANILLA_OPENSSL_LIBS $LIBS"
337
+
338
+ AC_MSG_CHECKING([for ptls_openssl_random_bytes])
339
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
340
+ #include <picotls.h>
341
+ #include <picotls/openssl.h>
342
+ ]], [[
343
+ ptls_openssl_random_bytes(NULL, 0);
344
+ ]])],
345
+ [AC_MSG_RESULT([yes]); have_picotls=yes],
346
+ [AC_MSG_RESULT([no]); have_picotls=no])
347
+
348
+ CFLAGS="$save_CFLAGS"
349
+ LIBS="$save_LIBS"
350
+ fi
351
+
352
+ if test "x${request_picotls}" = "xyes" &&
353
+ test "x${have_picotls}" != "xyes"; then
354
+ AC_MSG_ERROR([picotls was requested (--with-picotls) but not found])
355
+ fi
356
+
357
+ AM_CONDITIONAL([HAVE_PICOTLS], [ test "x${have_picotls}" = "xyes" ])
358
+
359
+ # wolfSSL (required for libngtcp2_crypto_wolfssl)
360
+ have_wolfssl=no
361
+ if test "x${request_wolfssl}" != "xno"; then
362
+ PKG_CHECK_MODULES([WOLFSSL], [wolfssl >= 5.5.0],
363
+ [have_wolfssl=yes], [have_wolfssl=no])
364
+ if test "x${have_wolfssl}" = "xno"; then
365
+ AC_MSG_NOTICE($WOLFSSL_PKG_ERRORS)
366
+ fi
367
+ fi
368
+
369
+ if test "x${request_wolfssl}" = "xyes" &&
370
+ test "x${have_wolfssl}" != "xyes"; then
371
+ AC_MSG_ERROR([wolfssl was requested (--with-wolfssl) but not found])
372
+ fi
373
+
374
+ AM_CONDITIONAL([HAVE_WOLFSSL], [ test "x${have_wolfssl}" = "xyes" ])
375
+
376
+ have_crypto=no
377
+ if test "x${have_openssl}" = "xyes" ||
378
+ test "x${have_gnutls}" = "xyes" ||
379
+ test "x${have_boringssl}" = "xyes" ||
380
+ test "x${have_picotls}" = "xyes" ||
381
+ test "x${have_wolfssl}" = "xyes"; then
382
+ have_crypto=yes
383
+ fi
384
+
385
+ AM_CONDITIONAL([HAVE_CRYPTO], [ test "x${have_crypto}" = "xyes" ])
386
+
387
+ # libnghttp3 (required for examples)
388
+ have_libnghttp3=no
389
+ if test "x${request_libnghttp3}" != "xno"; then
390
+ PKG_CHECK_MODULES([LIBNGHTTP3], [libnghttp3 >= 0.2.0],
391
+ [have_libnghttp3=yes], [have_libnghttp3=no])
392
+ if test "${have_libnghttp3}" = "xno"; then
393
+ AC_MSG_NOTICE($LIBNGHTTP3_PKG_ERRORS)
394
+ fi
395
+ fi
396
+
397
+ if test "x${request_libnghttp3}" = "xyes" &&
398
+ test "x${have_libnghttp3}" != "xyes"; then
399
+ AC_MSG_ERROR([libnghttp3 was requested (--with-libnghttp3) but not found])
400
+ fi
401
+
402
+ AM_CONDITIONAL([HAVE_NGHTTP3], [ test "x${have_libnghttp3}" = "xyes" ])
403
+
404
+ # libev (required for examples)
405
+ have_libev=no
406
+ if test "x${request_libev}" != "xno"; then
407
+ if test "x${LIBEV_LIBS}" = "x" && test "x${LIBEV_CFLAGS}" = "x"; then
408
+ # libev does not have pkg-config file. Check it in an old way.
409
+ save_LIBS=$LIBS
410
+ # android requires -lm for floor
411
+ AC_CHECK_LIB([ev], [ev_time], [have_libev=yes], [have_libev=no], [-lm])
412
+ if test "x${have_libev}" = "xyes"; then
413
+ AC_CHECK_HEADER([ev.h], [have_libev=yes], [have_libev=no])
414
+ if test "x${have_libev}" = "xyes"; then
415
+ LIBEV_LIBS=-lev
416
+ LIBEV_CFLAGS=
417
+ fi
418
+ fi
419
+ LIBS=$save_LIBS
420
+ else
421
+ have_libev=yes
422
+ fi
423
+ fi
424
+
425
+ if test "x${request_libev}" = "xyes" &&
426
+ test "x${have_libev}" != "xyes"; then
427
+ AC_MSG_ERROR([libev was requested (--with-libev) but not found])
428
+ fi
429
+
430
+ if test "x${lib_only}" = "xno" &&
431
+ test "x${HAVE_CXX20}" != "x1"; then
432
+ AC_MSG_WARN([C++ compiler is not capable of C++20. Examples will not be built.])
433
+ fi
434
+
435
+ enable_examples=no
436
+ if test "x${lib_only}" = "xno" &&
437
+ test "x${have_libnghttp3}" = "xyes" &&
438
+ test "x${have_crypto}" = "xyes" &&
439
+ test "x${have_libev}" = "xyes" &&
440
+ test "x${HAVE_CXX20}" = "x1"; then
441
+ enable_examples=yes
442
+
443
+ if test "x${have_openssl}" = "xyes"; then
444
+ AC_DEFINE([ENABLE_EXAMPLE_OPENSSL], [1],
445
+ [Define to 1 in order to build examples/{client,server}])
446
+ fi
447
+
448
+ if test "x${have_gnutls}" = "xyes"; then
449
+ AC_DEFINE([ENABLE_EXAMPLE_GNUTLS], [1],
450
+ [Define to 1 in order to build examples/{gtlsclient,gtlsserver}])
451
+ fi
452
+
453
+ if test "x${have_boringssl}" = "xyes"; then
454
+ AC_DEFINE([ENABLE_EXAMPLE_BORINGSSL], [1],
455
+ [Define to 1 in order to build examples/{bsslclient,bsslserver}])
456
+ fi
457
+
458
+ if test "x${have_picotls}" = "xyes"; then
459
+ AC_DEFINE([ENABLE_EXAMPLE_PICOTLS], [1],
460
+ [Define to 1 in order to build examples/{ptlsclient,ptlsserver}])
461
+ fi
462
+
463
+ if test "x${have_wolfssl}" = "xyes"; then
464
+ AC_DEFINE([ENABLE_EXAMPLE_WOLFSSL], [1],
465
+ [Define to 1 in order to build examples/{wsslclient,wsslserver}])
466
+ fi
467
+ fi
468
+
469
+ AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ])
470
+ AM_CONDITIONAL([ENABLE_EXAMPLE_OPENSSL], [ test "x${enable_examples}" = "xyes" && test "x${have_openssl}" = "xyes" ])
471
+ AM_CONDITIONAL([ENABLE_EXAMPLE_GNUTLS], [ test "x${enable_examples}" = "xyes" && test "x${have_gnutls}" = "xyes" ])
472
+ AM_CONDITIONAL([ENABLE_EXAMPLE_BORINGSSL], [ test "x${enable_examples}" = "xyes" && test "x${have_boringssl}" = "xyes" ])
473
+ AM_CONDITIONAL([ENABLE_EXAMPLE_PICOTLS], [ test "x${enable_examples}" = "xyes" && test "x${have_picotls}" = "xyes" ])
474
+ AM_CONDITIONAL([ENABLE_EXAMPLE_WOLFSSL], [ test "x${enable_examples}" = "xyes" && test "x${have_wolfssl}" = "xyes" ])
475
+
476
+ AC_SUBST([EXAMPLES_ENABLED], "${enable_examples}")
477
+ AC_SUBST([EXAMPLES_OPENSSL], "${have_openssl}")
478
+ AC_SUBST([EXAMPLES_GNUTLS], "${have_gnutls}")
479
+ AC_SUBST([EXAMPLES_BORINGSSL], "${have_boringssl}")
480
+ AC_SUBST([EXAMPLES_PICOTLS], "${have_picotls}")
481
+ AC_SUBST([EXAMPLES_WOLFSSL], "${have_wolfssl}")
482
+
483
+ # jemalloc
484
+ have_jemalloc=no
485
+ if test "x${request_jemalloc}" != "xno"; then
486
+ if test "x${JEMALLOC_LIBS}" = "x" && test "x${JEMALLOC_CFLAGS}" = "x"; then
487
+ save_LIBS=$LIBS
488
+ AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes], [],
489
+ [$PTHREAD_LDFLAGS])
490
+
491
+ if test "x${have_jemalloc}" = "xyes"; then
492
+ jemalloc_libs=${ac_cv_search_malloc_stats_print}
493
+ else
494
+ # On Darwin, malloc_stats_print is je_malloc_stats_print
495
+ AC_SEARCH_LIBS([je_malloc_stats_print], [jemalloc], [have_jemalloc=yes],
496
+ [], [$PTHREAD_LDFLAGS])
497
+
498
+ if test "x${have_jemalloc}" = "xyes"; then
499
+ jemalloc_libs=${ac_cv_search_je_malloc_stats_print}
500
+ fi
501
+ fi
502
+
503
+ LIBS=$save_LIBS
504
+
505
+ if test "x${have_jemalloc}" = "xyes" &&
506
+ test "x${jemalloc_libs}" != "xnone required"; then
507
+ JEMALLOC_LIBS=${jemalloc_libs}
508
+ fi
509
+ else
510
+ have_jemalloc=yes
511
+ fi
512
+ fi
513
+
514
+ if test "x${request_jemalloc}" = "xyes" &&
515
+ test "x${have_jemalloc}" != "xyes"; then
516
+ AC_MSG_ERROR([jemalloc was requested (--with-jemalloc) but not found])
517
+ fi
518
+
519
+ # Checks for header files.
520
+ AC_CHECK_HEADERS([ \
521
+ arpa/inet.h \
522
+ netinet/in.h \
523
+ stddef.h \
524
+ stdint.h \
525
+ stdlib.h \
526
+ string.h \
527
+ unistd.h \
528
+ sys/endian.h \
529
+ endian.h \
530
+ byteswap.h \
531
+ asm/types.h \
532
+ linux/netlink.h \
533
+ linux/rtnetlink.h
534
+ ])
535
+
536
+ # Checks for typedefs, structures, and compiler characteristics.
537
+ AC_TYPE_SIZE_T
538
+ AC_TYPE_SSIZE_T
539
+ AC_TYPE_UINT8_T
540
+ AC_TYPE_UINT16_T
541
+ AC_TYPE_UINT32_T
542
+ AC_TYPE_UINT64_T
543
+ AC_TYPE_INT8_T
544
+ AC_TYPE_INT16_T
545
+ AC_TYPE_INT32_T
546
+ AC_TYPE_INT64_T
547
+ AC_TYPE_OFF_T
548
+ AC_TYPE_PID_T
549
+ AC_TYPE_UID_T
550
+ AC_CHECK_TYPES([ptrdiff_t])
551
+ AC_C_BIGENDIAN
552
+ AC_C_INLINE
553
+ AC_SYS_LARGEFILE
554
+
555
+ # Checks for library functions.
556
+ AC_CHECK_FUNCS([ \
557
+ memmove \
558
+ memset \
559
+ ])
560
+
561
+ # Checks for symbols.
562
+ AC_CHECK_DECLS([be64toh], [], [], [[
563
+ #ifdef HAVE_ENDIAN_H
564
+ # include <endian.h>
565
+ #endif
566
+ #ifdef HAVE_SYS_ENDIAN_H
567
+ # include <sys/endian.h>
568
+ #endif
569
+ ]])
570
+
571
+ AC_CHECK_DECLS([bswap_64], [], [], [[
572
+ #include <byteswap.h>
573
+ ]])
574
+
575
+ # More compiler flags from nghttp2.
576
+ save_CFLAGS=$CFLAGS
577
+ save_CXXFLAGS=$CXXFLAGS
578
+
579
+ CFLAGS=
580
+ CXXFLAGS=
581
+
582
+ if test "x$werror" != "xno"; then
583
+ # For C compiler
584
+ AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
585
+ AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
586
+ AX_CHECK_COMPILE_FLAG([-Werror], [CFLAGS="$CFLAGS -Werror"])
587
+ AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
588
+ AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"])
589
+ AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CFLAGS="$CFLAGS -Wmissing-declarations"])
590
+ AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"])
591
+ AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
592
+ AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"])
593
+ AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"])
594
+ AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])
595
+ AX_CHECK_COMPILE_FLAG([-Winline], [CFLAGS="$CFLAGS -Winline"])
596
+ AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"])
597
+ AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"])
598
+ AX_CHECK_COMPILE_FLAG([-Wundef], [CFLAGS="$CFLAGS -Wundef"])
599
+ AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"])
600
+ AX_CHECK_COMPILE_FLAG([-Wempty-body], [CFLAGS="$CFLAGS -Wempty-body"])
601
+ AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"])
602
+ AX_CHECK_COMPILE_FLAG([-Wclobbered], [CFLAGS="$CFLAGS -Wclobbered"])
603
+ AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"])
604
+ AX_CHECK_COMPILE_FLAG([-Wpragmas], [CFLAGS="$CFLAGS -Wpragmas"])
605
+ AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [CFLAGS="$CFLAGS -Wunreachable-code"])
606
+ AX_CHECK_COMPILE_FLAG([-Waddress], [CFLAGS="$CFLAGS -Waddress"])
607
+ AX_CHECK_COMPILE_FLAG([-Wattributes], [CFLAGS="$CFLAGS -Wattributes"])
608
+ AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"])
609
+ AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [CFLAGS="$CFLAGS -Wshorten-64-to-32"])
610
+
611
+ AX_CHECK_COMPILE_FLAG([-Wconversion], [CFLAGS="$CFLAGS -Wconversion"])
612
+ AX_CHECK_COMPILE_FLAG([-Wextended-offsetof], [CFLAGS="$CFLAGS -Wextended-offsetof"])
613
+ AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral], [CFLAGS="$CFLAGS -Wformat-nonliteral"])
614
+ AX_CHECK_COMPILE_FLAG([-Wlanguage-extension-token], [CFLAGS="$CFLAGS -Wlanguage-extension-token"])
615
+ AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CFLAGS="$CFLAGS -Wmissing-field-initializers"])
616
+ AX_CHECK_COMPILE_FLAG([-Wmissing-noreturn], [CFLAGS="$CFLAGS -Wmissing-noreturn"])
617
+ AX_CHECK_COMPILE_FLAG([-Wmissing-variable-declarations], [CFLAGS="$CFLAGS -Wmissing-variable-declarations"])
618
+ # Not used because we cannot change public structs
619
+ # AX_CHECK_COMPILE_FLAG([-Wpadded], [CFLAGS="$CFLAGS -Wpadded"])
620
+ AX_CHECK_COMPILE_FLAG([-Wsign-conversion], [CFLAGS="$CFLAGS -Wsign-conversion"])
621
+ # Not used because this basically disallows default case
622
+ # AX_CHECK_COMPILE_FLAG([-Wswitch-enum], [CFLAGS="$CFLAGS -Wswitch-enum"])
623
+ AX_CHECK_COMPILE_FLAG([-Wunreachable-code-break], [CFLAGS="$CFLAGS -Wunreachable-code-break"])
624
+ AX_CHECK_COMPILE_FLAG([-Wunused-macros], [CFLAGS="$CFLAGS -Wunused-macros"])
625
+ AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="$CFLAGS -Wunused-parameter"])
626
+ AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [CFLAGS="$CFLAGS -Wredundant-decls"])
627
+ # Only work with Clang for the moment
628
+ AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"])
629
+ AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CFLAGS="$CFLAGS -Wsometimes-uninitialized"])
630
+
631
+ # Only work with gcc7 for the moment
632
+ AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [CFLAGS="$CFLAGS -Wduplicated-branches"])
633
+
634
+ # This is required because we pass format string as "const char*.
635
+ AX_CHECK_COMPILE_FLAG([-Wno-format-nonliteral], [CFLAGS="$CFLAGS -Wno-format-nonliteral"])
636
+
637
+ # For C++ compiler
638
+ AC_LANG_PUSH(C++)
639
+ AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
640
+ AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="$CXXFLAGS -Werror"])
641
+ AX_CHECK_COMPILE_FLAG([-Wformat-security], [CXXFLAGS="$CXXFLAGS -Wformat-security"])
642
+ AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CXXFLAGS="$CXXFLAGS -Wsometimes-uninitialized"])
643
+ # Disable noexcept-type warning of g++-7. This is not harmful as
644
+ # long as all source files are compiled with the same compiler.
645
+ AX_CHECK_COMPILE_FLAG([-Wno-noexcept-type], [CXXFLAGS="$CXXFLAGS -Wno-noexcept-type"])
646
+ AC_LANG_POP()
647
+ fi
648
+
649
+ WARNCFLAGS=$CFLAGS
650
+ WARNCXXFLAGS=$CXXFLAGS
651
+
652
+ CFLAGS=$save_CFLAGS
653
+ CXXFLAGS=$save_CXXFLAGS
654
+
655
+ AC_SUBST([WARNCFLAGS])
656
+ AC_SUBST([WARNCXXFLAGS])
657
+
658
+ if test "x$asan" != "xno"; then
659
+ # Assume both C and C++ compiler either support ASAN or not.
660
+ save_LDFLAGS="$LDFLAGS"
661
+ LDFLAGS="$LDFLAGS -fsanitize=address"
662
+ AX_CHECK_COMPILE_FLAG([-fsanitize=address],
663
+ [CFLAGS="$CFLAGS -fsanitize=address"; CXXFLAGS="$CXXFLAGS -fsanitize=address"],
664
+ [LDFLAGS="$save_LDFLAGS"])
665
+ fi
666
+
667
+ if test "x${memdebug}" = "xyes"; then
668
+ AC_DEFINE([MEMDEBUG], [1],
669
+ [Define to 1 to enable memory allocation debug output.])
670
+ fi
671
+
672
+ if test "x${mempool}" != "xyes"; then
673
+ AC_DEFINE([NOMEMPOOL], [1], [Define to 1 to disable memory pool.])
674
+ fi
675
+
676
+ # extra flags for API function visibility
677
+ EXTRACFLAG=
678
+ AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [EXTRACFLAG="-fvisibility=hidden"])
679
+
680
+ AC_SUBST([EXTRACFLAG])
681
+
682
+ AC_CONFIG_FILES([
683
+ Makefile
684
+ lib/Makefile
685
+ lib/libngtcp2.pc
686
+ lib/includes/Makefile
687
+ lib/includes/ngtcp2/version.h
688
+ tests/Makefile
689
+ crypto/Makefile
690
+ crypto/openssl/Makefile
691
+ crypto/openssl/libngtcp2_crypto_openssl.pc
692
+ crypto/includes/Makefile
693
+ crypto/gnutls/Makefile
694
+ crypto/gnutls/libngtcp2_crypto_gnutls.pc
695
+ crypto/boringssl/Makefile
696
+ crypto/boringssl/libngtcp2_crypto_boringssl.pc
697
+ crypto/picotls/Makefile
698
+ crypto/picotls/libngtcp2_crypto_picotls.pc
699
+ crypto/wolfssl/Makefile
700
+ crypto/wolfssl/libngtcp2_crypto_wolfssl.pc
701
+ doc/Makefile
702
+ doc/source/conf.py
703
+ third-party/Makefile
704
+ examples/Makefile
705
+ examples/tests/config.ini
706
+ ])
707
+ AC_OUTPUT
708
+
709
+ AC_MSG_NOTICE([summary of build options:
710
+
711
+ Package version: ${VERSION}
712
+ Library version: $LT_CURRENT:$LT_REVISION:$LT_AGE
713
+ Install prefix: ${prefix}
714
+ System types:
715
+ Build: ${build}
716
+ Host: ${host}
717
+ Target: ${target}
718
+ Compiler:
719
+ C preprocessor: ${CPP}
720
+ CPPFLAGS: ${CPPFLAGS}
721
+ C compiler: ${CC}
722
+ CFLAGS: ${CFLAGS}
723
+ C++ compiler: ${CXX}
724
+ CXXFLAGS: ${CXXFLAGS}
725
+ LDFLAGS: ${LDFLAGS}
726
+ WARNCFLAGS: ${WARNCFLAGS}
727
+ WARNCXXFLAGS: ${WARNCXXFLAGS}
728
+ EXTRACFLAG: ${EXTRACFLAG}
729
+ LIBS: ${LIBS}
730
+ Library:
731
+ Shared: ${enable_shared}
732
+ Static: ${enable_static}
733
+ Libtool:
734
+ LIBTOOL_LDFLAGS: ${LIBTOOL_LDFLAGS}
735
+ Crypto helper libraries:
736
+ libngtcp2_crypto_openssl: ${have_openssl}
737
+ libngtcp2_crypto_gnutls: ${have_gnutls}
738
+ libngtcp2_crypto_boringssl: ${have_boringssl}
739
+ libngtcp2_crypto_picotls: ${have_picotls}
740
+ libngtcp2_crypto_wolfssl: ${have_wolfssl}
741
+ Test:
742
+ CUnit: ${have_cunit} (CFLAGS='${CUNIT_CFLAGS}' LIBS='${CUNIT_LIBS}')
743
+ Debug:
744
+ Debug: ${debug} (CFLAGS='${DEBUGCFLAGS}')
745
+ Libs:
746
+ OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
747
+ Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
748
+ Libnghttp3: ${have_libnghttp3} (CFLAGS='${LIBNGHTTP3_CFLAGS}' LIBS='${LIBNGHTTP3_LIBS}')
749
+ Jemalloc: ${have_jemalloc} (CFLAGS='${JEMALLOC_CFLAGS}' LIBS='${JEMALLOC_LIBS}')
750
+ GnuTLS: ${have_gnutls} (CFLAGS='${GNUTLS_CFLAGS}' LIBS='${GNUTLS_LIBS}')
751
+ BoringSSL: ${have_boringssl} (CFLAGS='${BORINGSSL_CFLAGS}' LIBS='${BORINGSSL_LIBS}')
752
+ Picotls: ${have_picotls} (CFLAGS='${PICOTLS_CFLAGS}' LIBS='${PICOTLS_LIBS}')
753
+ wolfSSL: ${have_wolfssl} (CFLAGS='${WOLFSSL_CFLAGS}' LIBS='${WOLFSSL_LIBS}')
754
+ Examples: ${enable_examples}
755
+ ])