]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
chore(dnsdist): create dnsdist-dnscrypt.hh and move handleDNSCryptQuery to it
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 23 Oct 2025 09:01:27 +0000 (11:01 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 1 Jun 2026 10:52:27 +0000 (12:52 +0200)
pdns/dnsdistdist/dnsdist-dnscrypt.cc
pdns/dnsdistdist/dnsdist-dnscrypt.hh [new file with mode: 0644]
pdns/dnsdistdist/dnsdist.cc
pdns/dnsdistdist/dnsdist.hh

index e143189dfd19826a75540415db6c430dbb91ecfe..171f2ab0fd99b60b4c5ec14eb8aafbaaf34d2f53 100644 (file)
  * 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 (file)
index 0000000..e9676a3
--- /dev/null
@@ -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
index c840a79de4bd33de29f58e6e8bc9741f01b1a08e..131fe3ce5c670d12a098616f67637acb455673f6 100644 (file)
@@ -38,6 +38,7 @@
 #include <vector>
 
 #include "dns.hh"
+#include "dnsdist-dnscrypt.hh"
 #include "dnsdist-idstate.hh"
 #include "dnsdist-opentelemetry.hh"
 #include "dnsdist-systemd.hh"
index 34834803f1268332007bf2fc74e6852b58213a3b..094bd62cdcd11a2762cc03163c2bc20aa1624629 100644 (file)
@@ -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>& dnsCryptQuery, time_t now, bool tcp);
 
 enum class ProcessQueryResult : uint8_t