Skip to content

Commit bc131b7

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.
1 parent 3625623 commit bc131b7

File tree

215 files changed

+133803
-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

+133803
-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: 158 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,134 @@
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+
}],
281+
['OS=="win"', {
282+
'defines': [
283+
'WIN32',
284+
'_WINDOWS',
285+
],
286+
'msvs_settings': {
287+
'VCCLCompilerTool': {
288+
'CompileAs': '1'
289+
},
290+
},
291+
}],
292+
['OS!="win"', {
293+
'defines': [
294+
'HAVE_UNISTD_H',
295+
'HAVE_ARPA_INET_H',
296+
'HAVE_NETINET_IN_H',
297+
'HAVE_NETINET_IP_H',
298+
],
299+
}],
300+
[ 'OS=="linux" or OS=="openharmony"', {
301+
'link_settings': {
302+
'libraries': [ '-ldl', '-lrt' ],
303+
},
304+
}],
305+
],
306+
'sources': [
307+
'<@(ngtcp2_test_server_sources)'
308+
]
309+
},
310+
{
311+
'target_name': 'ngtcp2_test_client',
312+
'type': 'executable',
313+
'cflags': [ '-Wno-everything' ],
314+
'include_dirs': [
315+
'',
316+
'ngtcp2/examples/',
317+
'ngtcp2/lib/includes/',
318+
'ngtcp2/crypto/includes/',
319+
'ngtcp2/third-party/urlparse/',
320+
'ngtcp2/third-party/libev/',
321+
'../../nghttp2/lib',
322+
],
323+
'dependencies': [
324+
'ngtcp2',
325+
'nghttp3',
326+
'../openssl/openssl.gyp:openssl',
327+
'../nghttp2/nghttp2.gyp:sfparse',
328+
],
329+
'defines': [
330+
'HAVE_CONFIG_H',
331+
'WITH_EXAMPLE_OSSL',
332+
'EV_STANDALONE=1',
333+
],
334+
'conditions': [
335+
['OS=="mac"', {
336+
'defines': [
337+
'__APPLE_USE_RFC_3542',
338+
]
339+
}],
340+
['OS=="solaris"', {
341+
'defines': [
342+
'IPTOS_ECN_MASK=0x03',
343+
]
344+
}],
345+
['OS=="win"', {
346+
'defines': [
347+
'WIN32',
348+
'_WINDOWS',
349+
],
350+
'msvs_settings': {
351+
'VCCLCompilerTool': {
352+
'CompileAs': '1'
353+
},
354+
},
355+
}],
356+
['OS!="win"', {
357+
'defines': [
358+
'HAVE_UNISTD_H',
359+
'HAVE_ARPA_INET_H',
360+
'HAVE_NETINET_IN_H',
361+
'HAVE_NETINET_IP_H',
362+
],
363+
}],
364+
[ 'OS=="linux" or OS=="openharmony"', {
365+
'link_settings': {
366+
'libraries': [ '-ldl', '-lrt' ],
367+
},
368+
}],
369+
],
370+
'sources': [
371+
'<@(ngtcp2_test_client_sources)'
372+
]
228373
}
229374
]
230375
}

0 commit comments

Comments
 (0)