Skip to content

Commit 65a32ba

Browse files
committed
deps: add ngtcp2 test binaries
The goal here is to add the ngtcp2 client and server samples so that we can use them in CI to test our QUIC implementation. PR-URL: #59946 Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 2e5c8df commit 65a32ba

File tree

215 files changed

+133809
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+133809
-33
lines changed

deps/nghttp2/nghttp2.gyp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@
6767
'sources': [
6868
'<@(nghttp2_sources)',
6969
]
70+
},
71+
{
72+
'target_name': 'sfparse',
73+
'type': 'static_library',
74+
'include_dirs': ['lib'],
75+
'sources': [
76+
'lib/sfparse.c',
77+
],
78+
'direct_dependent_settings': {
79+
'include_dirs': [ 'lib/includes' ]
80+
}
7081
}
7182
]
7283
}

deps/ngtcp2/ngtcp2.gyp

Lines changed: 164 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,36 @@
8787
'nghttp3/lib/nghttp3_unreachable.c',
8888
'nghttp3/lib/nghttp3_vec.c',
8989
'nghttp3/lib/nghttp3_version.c',
90+
],
91+
'ngtcp2_test_server_sources': [
92+
'ngtcp2/examples/tls_server_session_ossl.cc',
93+
'ngtcp2/examples/tls_server_context_ossl.cc',
94+
'ngtcp2/examples/tls_session_base_ossl.cc',
95+
'ngtcp2/examples/util_openssl.cc',
96+
'ngtcp2/examples/http.cc',
97+
'ngtcp2/examples/server_base.cc',
98+
'ngtcp2/examples/shared.cc',
99+
'ngtcp2/examples/server.cc',
100+
'ngtcp2/examples/util.cc',
101+
'ngtcp2/examples/debug.cc',
102+
'ngtcp2/examples/siphash.cc',
103+
'ngtcp2/third-party/urlparse/urlparse.c',
104+
'ngtcp2/third-party/libev/ev.c',
105+
],
106+
'ngtcp2_test_client_sources': [
107+
'ngtcp2/examples/tls_client_session_ossl.cc',
108+
'ngtcp2/examples/tls_client_context_ossl.cc',
109+
'ngtcp2/examples/tls_session_base_ossl.cc',
110+
'ngtcp2/examples/util_openssl.cc',
111+
'ngtcp2/examples/http.cc',
112+
'ngtcp2/examples/client_base.cc',
113+
'ngtcp2/examples/shared.cc',
114+
'ngtcp2/examples/client.cc',
115+
'ngtcp2/examples/util.cc',
116+
'ngtcp2/examples/debug.cc',
117+
'ngtcp2/examples/siphash.cc',
118+
'ngtcp2/third-party/urlparse/urlparse.c',
119+
'ngtcp2/third-party/libev/ev.c',
90120
]
91121
},
92122
'targets': [
@@ -131,19 +161,6 @@
131161
'HAVE_NETINET_IN_H',
132162
],
133163
}],
134-
# TODO: Support OpenSSL 3.5 shared library builds.
135-
# The complexity here is that we need to use the ngtcp2 ossl
136-
# adapter, which does not include any conditional checks to
137-
# see if the version of OpenSSL used has the necessary QUIC
138-
# APIs, so we need to ensure that we conditionally enable use
139-
# of the adapter only when we know that the OpenSSL version we
140-
# are compiling against has the necessary APIs. We can do that
141-
# by checkig the OpenSSL version number but, currently, the
142-
# code that does so checks only the VERSION.dat file that is
143-
# bundled with the openssl dependency. We'll need to update
144-
# that to support the shared library case, where the version
145-
# of the shared library needs to be determined.
146-
#
147164
# TODO: Support Boringssl here also. ngtcp2 provides an adapter
148165
# for Boringssl. If we can detect that boringssl is being used
149166
# here then we can use that adapter and also set the
@@ -225,6 +242,140 @@
225242
'sources': [
226243
'<@(nghttp3_sources)'
227244
]
245+
},
246+
{
247+
'target_name': 'ngtcp2_test_server',
248+
'type': 'executable',
249+
'cflags': [ '-Wno-everything' ],
250+
'include_dirs': [
251+
'',
252+
'ngtcp2/examples/',
253+
'ngtcp2/lib/includes/',
254+
'ngtcp2/crypto/includes/',
255+
'ngtcp2/third-party/urlparse/',
256+
'ngtcp2/third-party/libev/',
257+
'../../nghttp2/lib',
258+
],
259+
'dependencies': [
260+
'ngtcp2',
261+
'nghttp3',
262+
'../openssl/openssl.gyp:openssl',
263+
'../nghttp2/nghttp2.gyp:sfparse',
264+
],
265+
'defines': [
266+
'HAVE_CONFIG_H',
267+
'WITH_EXAMPLE_OSSL',
268+
'EV_STANDALONE=1',
269+
],
270+
'conditions': [
271+
['OS=="mac"', {
272+
'defines': [
273+
'__APPLE_USE_RFC_3542',
274+
]
275+
}],
276+
['OS=="solaris"', {
277+
'defines': [
278+
'IPTOS_ECN_MASK=0x03',
279+
],
280+
'link_settings': {
281+
'libraries': [ '-lsocket', '-lnsl' ],
282+
},
283+
}],
284+
['OS=="win"', {
285+
'defines': [
286+
'WIN32',
287+
'_WINDOWS',
288+
],
289+
'msvs_settings': {
290+
'VCCLCompilerTool': {
291+
'CompileAs': '1'
292+
},
293+
},
294+
}],
295+
['OS!="win"', {
296+
'defines': [
297+
'HAVE_UNISTD_H',
298+
'HAVE_ARPA_INET_H',
299+
'HAVE_NETINET_IN_H',
300+
'HAVE_NETINET_IP_H',
301+
],
302+
}],
303+
[ 'OS=="linux" or OS=="openharmony"', {
304+
'link_settings': {
305+
'libraries': [ '-ldl', '-lrt' ],
306+
},
307+
}],
308+
],
309+
'sources': [
310+
'<@(ngtcp2_test_server_sources)'
311+
]
312+
},
313+
{
314+
'target_name': 'ngtcp2_test_client',
315+
'type': 'executable',
316+
'cflags': [ '-Wno-everything' ],
317+
'include_dirs': [
318+
'',
319+
'ngtcp2/examples/',
320+
'ngtcp2/lib/includes/',
321+
'ngtcp2/crypto/includes/',
322+
'ngtcp2/third-party/urlparse/',
323+
'ngtcp2/third-party/libev/',
324+
'../../nghttp2/lib',
325+
],
326+
'dependencies': [
327+
'ngtcp2',
328+
'nghttp3',
329+
'../openssl/openssl.gyp:openssl',
330+
'../nghttp2/nghttp2.gyp:sfparse',
331+
],
332+
'defines': [
333+
'HAVE_CONFIG_H',
334+
'WITH_EXAMPLE_OSSL',
335+
'EV_STANDALONE=1',
336+
],
337+
'conditions': [
338+
['OS=="mac"', {
339+
'defines': [
340+
'__APPLE_USE_RFC_3542',
341+
]
342+
}],
343+
['OS=="solaris"', {
344+
'defines': [
345+
'IPTOS_ECN_MASK=0x03',
346+
],
347+
'link_settings': {
348+
'libraries': [ '-lsocket', '-lnsl' ],
349+
},
350+
}],
351+
['OS=="win"', {
352+
'defines': [
353+
'WIN32',
354+
'_WINDOWS',
355+
],
356+
'msvs_settings': {
357+
'VCCLCompilerTool': {
358+
'CompileAs': '1'
359+
},
360+
},
361+
}],
362+
['OS!="win"', {
363+
'defines': [
364+
'HAVE_UNISTD_H',
365+
'HAVE_ARPA_INET_H',
366+
'HAVE_NETINET_IN_H',
367+
'HAVE_NETINET_IP_H',
368+
],
369+
}],
370+
[ 'OS=="linux" or OS=="openharmony"', {
371+
'link_settings': {
372+
'libraries': [ '-ldl', '-lrt' ],
373+
},
374+
}],
375+
],
376+
'sources': [
377+
'<@(ngtcp2_test_client_sources)'
378+
]
228379
}
229380
]
230381
}

0 commit comments

Comments
 (0)