]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/dnsdist-lua-rules.cc
dnsdist: Implement SNIRule for DoT
[thirdparty/pdns.git] / pdns / dnsdist-lua-rules.cc
index 4b4114bc7ee8ac8ffd22ea4b647605460e5f8cca..b781e8c79ac5ecef92b8e0b98dc95ea2e9015cb6 100644 (file)
@@ -280,12 +280,25 @@ void setupLuaRules()
       return std::shared_ptr<DNSRule>(new RegexRule(str));
     });
 
+#ifdef HAVE_DNS_OVER_HTTPS
+  g_lua.writeFunction("HTTPHeaderRule", [](const std::string& header, const std::string& regex) {
+      return std::shared_ptr<DNSRule>(new HTTPHeaderRule(header, regex));
+    });
+  g_lua.writeFunction("HTTPPathRule", [](const std::string& path) {
+      return std::shared_ptr<DNSRule>(new HTTPPathRule(path));
+    });
+#endif
+
 #ifdef HAVE_RE2
   g_lua.writeFunction("RE2Rule", [](const std::string& str) {
       return std::shared_ptr<DNSRule>(new RE2Rule(str));
     });
 #endif
 
+  g_lua.writeFunction("SNIRule", [](const std::string& name) {
+      return std::shared_ptr<DNSRule>(new SNIRule(name));
+  });
+
   g_lua.writeFunction("SuffixMatchNodeRule", [](const SuffixMatchNode& smn, boost::optional<bool> quiet) {
       return std::shared_ptr<DNSRule>(new SuffixMatchNodeRule(smn, quiet ? *quiet : false));
     });