From: Pieter Lexis Date: Thu, 23 Oct 2025 09:01:27 +0000 (+0200) Subject: chore(dnsdist): create dnsdist-dnscrypt.hh and move handleDNSCryptQuery to it X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=48ff3190690af97f4f7bcc0f4e4b5696207c9af6;p=thirdparty%2Fpdns.git chore(dnsdist): create dnsdist-dnscrypt.hh and move handleDNSCryptQuery to it --- diff --git a/pdns/dnsdistdist/dnsdist-dnscrypt.cc b/pdns/dnsdistdist/dnsdist-dnscrypt.cc index e143189dfd..171f2ab0fd 100644 --- a/pdns/dnsdistdist/dnsdist-dnscrypt.cc +++ b/pdns/dnsdistdist/dnsdist-dnscrypt.cc @@ -19,12 +19,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "dnsdist-dnscrypt.hh" + +#ifdef HAVE_DNSCRYPT #include "dolog.hh" #include "dnsdist.hh" #include "dnsdist-metrics.hh" #include "dnscrypt.hh" -#ifdef HAVE_DNSCRYPT bool handleDNSCryptQuery(PacketBuffer& packet, DNSCryptQuery& query, bool tcp, time_t now, PacketBuffer& response) { query.parsePacket(packet, tcp, now); diff --git a/pdns/dnsdistdist/dnsdist-dnscrypt.hh b/pdns/dnsdistdist/dnsdist-dnscrypt.hh new file mode 100644 index 0000000000..e9676a35ab --- /dev/null +++ b/pdns/dnsdistdist/dnsdist-dnscrypt.hh @@ -0,0 +1,29 @@ +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#pragma once + +#include "config.h" + +#ifdef HAVE_DNSCRYPT +#include "dnsdist.hh" +bool handleDNSCryptQuery(PacketBuffer& packet, DNSCryptQuery& query, bool tcp, time_t now, PacketBuffer& response); +#endif diff --git a/pdns/dnsdistdist/dnsdist.cc b/pdns/dnsdistdist/dnsdist.cc index c840a79de4..131fe3ce5c 100644 --- a/pdns/dnsdistdist/dnsdist.cc +++ b/pdns/dnsdistdist/dnsdist.cc @@ -38,6 +38,7 @@ #include #include "dns.hh" +#include "dnsdist-dnscrypt.hh" #include "dnsdist-idstate.hh" #include "dnsdist-opentelemetry.hh" #include "dnsdist-systemd.hh" diff --git a/pdns/dnsdistdist/dnsdist.hh b/pdns/dnsdistdist/dnsdist.hh index 34834803f1..094bd62cdc 100644 --- a/pdns/dnsdistdist/dnsdist.hh +++ b/pdns/dnsdistdist/dnsdist.hh @@ -996,7 +996,6 @@ bool checkQueryHeaders(const struct dnsheader& dnsHeader, ClientState& clientSta class DNSCryptQuery; -bool handleDNSCryptQuery(PacketBuffer& packet, DNSCryptQuery& query, bool tcp, time_t now, PacketBuffer& response); bool checkDNSCryptQuery(const ClientState& clientState, PacketBuffer& query, std::unique_ptr& dnsCryptQuery, time_t now, bool tcp); enum class ProcessQueryResult : uint8_t