]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
allRule() for dnsdist
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 15 Dec 2015 08:45:10 +0000 (09:45 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 15 Dec 2015 08:45:10 +0000 (09:45 +0100)
pdns/dnsdist-lua.cc
pdns/dnsrulactions.hh

index 0c54b975ddb175fc5ca95099a7c652a7d9d69f28..c20cf6bbd43de2483f2f8b40995f4b5666dfdef1 100644 (file)
@@ -533,6 +533,11 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
       g_outputBuffer=(boost::format("Had %d matches out of %d, %.1f qps, in %.1f usec\n") % matches % times % (1000000*(1.0*times/udiff)) % udiff).str();
 
     });
+
+  g_lua.writeFunction("AllRule", []() {
+      return std::shared_ptr<DNSRule>(new AllRule());
+    });
+
   g_lua.writeFunction("QTypeRule", [](boost::variant<int, std::string> str) {
       uint16_t qtype;
       if(auto dir = boost::get<int>(&str)) {
index 451a313f25e57920fc01277287b64cd5a1be4755..d0e3621701b034e9611413a2e150d3a0d2af81a0 100644 (file)
@@ -81,6 +81,23 @@ private:
   NetmaskGroup d_nmg;
 };
 
+class AllRule : public DNSRule
+{
+public:
+  AllRule() {}
+  bool matches(const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh, int len) const override
+  {
+    return true;
+  }
+
+  string toString() const override
+  {
+    return "All";
+  }
+
+};
+
+
 class DNSSECRule : public DNSRule
 {
 public: