static int net_quic_max_conns(lua_State *L)
{
+#if ENABLE_QUIC
if (kr_fails_assert(the_network)) {
return 0;
}
lua_error_p(L, "net.quic_max_conns must be within <1, 4096>");
the_network->quic_params->max_conns = (uint16_t)v;
+#endif // otherwise we just ignore the setting
lua_pushboolean(L, true);
return 1;
}
static int net_quic_max_streams(lua_State *L)
{
+#if ENABLE_QUIC
if (kr_fails_assert(the_network)) {
return 0;
}
lua_error_p(L, "net.quic_max_streams must be within <1, 4096>");
the_network->quic_params->max_streams = (uint16_t)v;
+#endif // otherwise we just ignore the setting
lua_pushboolean(L, true);
return 1;
}
static int net_quic_reqire_retry(lua_State *L)
{
+#if ENABLE_QUIC
if (kr_fails_assert(the_network)) {
return 0;
}
}
the_network->quic_params->require_retry = v;
+#endif // otherwise we just ignore the setting
lua_pushboolean(L, true);
return 1;
}
'udp_queue.c',
'worker.c',
'zimport.c',
- 'quic_common.c',
- 'quic_demux.c',
- 'quic_conn.c',
- 'quic_stream.c',
])
+if enable_quic
+ kresd_src += files([
+ 'quic_common.c',
+ 'quic_demux.c',
+ 'quic_conn.c',
+ 'quic_stream.c',
+ ])
+endif
+
if nghttp2.found()
kresd_src += files(['http.c'])
endif
nghttp2,
malloc,
libm,
- libngtcp2,
- libngtcp2_crypto,
]
+if enable_quic
+ kresd_deps += libngtcp2_deps
+endif
+
subdir('lua')
trie_free(the_network->proxy_addrs6);
tls_credentials_free(the_network->tls_credentials);
+#if HAS_QUIC
quic_configuration_free(the_network->quic_params);
+#endif
tls_client_params_free(the_network->tls_client_params);
tls_session_ticket_ctx_destroy(the_network->tls_session_ticket_ctx);
#ifndef NDEBUG
#pragma once
+#include "kresconfig.h"
+
+#if !ENABLE_QUIC
+#else
+
#include <ngtcp2/ngtcp2.h>
#include <ngtcp2/ngtcp2_crypto.h>
#include <ngtcp2/ngtcp2_crypto_gnutls.h>
ngtcp2_version_cid *dec_cids,
const struct sockaddr *src_addr,
uint8_t *secret, size_t secret_len);
+
+#endif
#include "daemon/session2.h"
-#include "ngtcp2/ngtcp2.h"
-
#define VERBOSE_LOG(session, fmt, ...) do {\
if (kr_log_is_debug(PROTOLAYER, NULL)) {\
#include "kresconfig.h"
#include "lib/proto.h"
#include "mempattern.h"
-#include "quic_conn.h"
#include "daemon/worker.h"
#include <libknot/wire.h>
-#include <ngtcp2/ngtcp2.h>
#include <string.h>
#include <uv.h>
#include <lua.h>
luajit = dependency('luajit')
# https://mesonbuild.com/howtox.html#add-math-library-lm-portably
libm = meson.get_compiler('c').find_library('m', required : false)
-libngtcp2 = dependency('libngtcp2', version: '>=1.11.0')
-libngtcp2_crypto = dependency('libngtcp2_crypto_gnutls')
message('------------------------------')
nghttp2 = dependency('libnghttp2', required: false)
openssl = dependency('openssl', required: false)
+libngtcp2 = dependency('libngtcp2', version: '>=1.11.0', required: get_option('quic') == 'external')
+libngtcp2_crypto = dependency('libngtcp2_crypto_gnutls', required: get_option('quic') == 'external')
+enable_quic = libngtcp2.found() and libngtcp2_crypto.found()
+if enable_quic
+ libngtcp2_deps = [libngtcp2, libngtcp2_crypto]
+endif
+quic_summary = [enable_quic, 'with external libngtcp2*']
+
have_asprintf = meson.get_compiler('c').has_function('asprintf',
prefix: '#define _GNU_SOURCE\n#include <stdio.h>')
summary({'sendmmsg': sendmmsg,
'XDP (in libknot)': xdp,
'doh2 (serving)': nghttp2.found(),
+ 'DoQ': quic_summary,
'capabilities': capng.found(),
'malloc': malloc.found() ? malloc_name : 'libc default',
}, section: 'Features', bool_yn: true)
conf_data.set('ENABLE_CAP_NG', capng.found().to_int())
conf_data.set('ENABLE_JEMALLOC', malloc.found().to_int())
conf_data.set('ENABLE_DOH2', nghttp2.found().to_int())
+conf_data.set('ENABLE_QUIC', enable_quic.to_int())
conf_data.set('DBG_ASSERTION_ABORT', get_option('debug').to_int())
if get_option('debug')
conf_data.set('DBG_ASSERTION_FORK', '0')
description: 'memory allocator to use in kresd',
)
+option(
+ 'quic',
+ type: 'combo',
+ choices: [
+ 'auto',
+ 'external',
+ 'disabled',
+ ],
+ value: 'auto',
+ description: 'build DNS-over-QUIC support, requiring compatible libngtcp2',
+)
+
option(
'doc',
type: 'combo',