]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: configurable DoQ and quiche checks
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Sun, 30 Jul 2023 15:00:10 +0000 (17:00 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 9 Oct 2023 11:36:43 +0000 (13:36 +0200)
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/m4/dnsdist_enable_doq.m4 [new file with mode: 0644]
pdns/dnsdistdist/m4/pdns_with_quiche.m4 [new file with mode: 0644]

index e30075c25c00c746af57a4a26b23c5452671949d..11495c3c7916d20ab8a480b4fd2c4aa0f99c9117 100644 (file)
@@ -20,6 +20,7 @@ CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -fvisibility=hidden
 CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls -fvisibility=hidden $CXXFLAGS"
 
 PDNS_WITH_LIBSODIUM
+PDNS_WITH_QUICHE
 PDNS_CHECK_DNSTAP([auto])
 PDNS_CHECK_RAGEL([dnslabeltext.cc], [www.dnsdist.org])
 PDNS_WITH_LIBEDIT
@@ -80,6 +81,7 @@ DNSDIST_ENABLE_TLS_PROVIDERS
 
 PDNS_ENABLE_DNS_OVER_TLS
 DNSDIST_ENABLE_DNS_OVER_HTTPS
+DNSDIST_ENABLE_DNS_OVER_QUIC
 
 AS_IF([test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"], [
   PDNS_WITH_LIBSSL
@@ -105,6 +107,13 @@ AS_IF([test "x$enable_dns_over_https" != "xno"], [
   ])
 ])
 
+AS_IF([test "x$enable_dns_over_quic" != "xno"], [
+  AS_IF([test "x$HAVE_QUICHE" != "x1"], [
+    AC_MSG_ERROR([DNS over QUIC support requested but quiche was not found])
+  ])
+])
+
+PDNS_WITH_NGHTTP2
 DNSDIST_WITH_CDB
 PDNS_CHECK_LMDB
 PDNS_ENABLE_IPCIPHER
@@ -218,6 +227,10 @@ AS_IF([test "x$FSTRM_LIBS" != "x"],
   [AC_MSG_NOTICE([dnstap: yes])],
   [AC_MSG_NOTICE([dnstap: no])]
 )
+AS_IF([test "x$QUICHE_LIBS" != "x"],
+  [AC_MSG_NOTICE([quiche: yes])],
+  [AC_MSG_NOTICE([quiche: no])]
+)
 AS_IF([test "x$RE2_LIBS" != "x"],
   [AC_MSG_NOTICE([re2: yes])],
   [AC_MSG_NOTICE([re2: no])]
@@ -234,6 +247,10 @@ AS_IF([test "x$enable_dns_over_https" != "xno"],
   [AC_MSG_NOTICE([DNS over HTTPS (DoH): yes])],
   [AC_MSG_NOTICE([DNS over HTTPS (DoH): no])]
 )
+AS_IF([test "x$enable_dns_over_quic" != "xno"],
+  [AC_MSG_NOTICE([DNS over QUIC (DoQ): yes])],
+  [AC_MSG_NOTICE([DNS over QUIC (DoQ): no])]
+)
 AS_IF([test "x$enable_dns_over_tls" != "xno"], [
   AS_IF([test "x$GNUTLS_LIBS" != "x"],
     [AC_MSG_NOTICE([GnuTLS: yes])],
diff --git a/pdns/dnsdistdist/m4/dnsdist_enable_doq.m4 b/pdns/dnsdistdist/m4/dnsdist_enable_doq.m4
new file mode 100644 (file)
index 0000000..e0ea5fc
--- /dev/null
@@ -0,0 +1,14 @@
+AC_DEFUN([DNSDIST_ENABLE_DNS_OVER_QUIC], [
+  AC_MSG_CHECKING([whether to enable incoming DNS over QUIC (DoH) support])
+  AC_ARG_ENABLE([dns-over-quic],
+    AS_HELP_STRING([--enable-dns-over-quic], [enable incoming DNS over QUIC (DoQ) support (requires quiche) @<:@default=no@:>@]),
+    [enable_dns_over_quic=$enableval],
+    [enable_dns_over_quic=no]
+  )
+  AC_MSG_RESULT([$enable_dns_over_quic])
+  AM_CONDITIONAL([HAVE_DNS_OVER_QUIC], [test "x$enable_dns_over_quic" != "xno"])
+
+  AM_COND_IF([HAVE_DNS_OVER_QUIC], [
+    AC_DEFINE([HAVE_DNS_OVER_QUIC], [1], [Define to 1 if you enable DNS over QUIC support])
+  ])
+])
diff --git a/pdns/dnsdistdist/m4/pdns_with_quiche.m4 b/pdns/dnsdistdist/m4/pdns_with_quiche.m4
new file mode 100644 (file)
index 0000000..40d94dd
--- /dev/null
@@ -0,0 +1,29 @@
+AC_DEFUN([PDNS_WITH_QUICHE], [
+  AC_MSG_CHECKING([whether we will be linking in quiche])
+  HAVE_QUICHE=0
+  AC_ARG_WITH([quiche],
+    AS_HELP_STRING([--with-quiche],[use quiche @<:@default=auto@:>@]),
+    [with_quiche=$withval],
+    [with_quiche=auto],
+  )
+  AC_MSG_RESULT([$with_quiche])
+
+  AS_IF([test "x$with_quiche" != "xno"], [
+    AS_IF([test "x$with_quiche" = "xyes" -o "x$with_quiche" = "xauto"], [
+      PKG_CHECK_MODULES([QUICHE], [quiche], [
+        [HAVE_QUICHE=1]
+        AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche])
+        save_CFLAGS=$CFLAGS
+        save_LIBS=$LIBS
+        CFLAGS="$QUICHE_CFLAGS $CFLAGS"
+        LIBS="$QUICHE_LIBS $LIBS"
+      ], [ : ])
+    ])
+  ])
+  AM_CONDITIONAL([HAVE_QUICHE], [test "x$QUICHE_LIBS" != "x"])
+  AS_IF([test "x$with_quiche" = "xyes"], [
+    AS_IF([test x"$QUICHE_LIBS" = "x"], [
+      AC_MSG_ERROR([quiche requested but libraries were not found])
+    ])
+  ])
+])