]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: README hints to AllowAction() yet doesnt exist, add it 3222/head
authorGreg <bearggg@users.noreply.github.com>
Wed, 13 Jan 2016 01:55:17 +0000 (17:55 -0800)
committerGreg <bearggg@users.noreply.github.com>
Wed, 13 Jan 2016 01:55:17 +0000 (17:55 -0800)
pdns/dnsdist-console.cc
pdns/dnsdist-lua.cc
pdns/dnsrulactions.hh

index e5aa6e282955e5ecfed504ecd30af7dba1df5e6f..bd06f83c670349ce0cf9183b27ba179f7a2b091e 100644 (file)
@@ -188,7 +188,7 @@ char* my_generator(const char* text, int state)
       "addDisableValidationRule(", "addDNSCryptBind(", "addDomainBlock(",
       "addDomainSpoof(", "addDynBlocks(", "addLocal(", "addLuaAction(",
       "addNoRecurseRule(", "addPoolRule(", "addQPSLimit(", "addQPSPoolRule(",
-      "AllRule(", "AndRule(",
+      "AllowAction(", "AllRule(", "AndRule(",
       "benchRule(",
       "carbonServer(", "controlSocket(", "clearDynBlocks()",
       "DelayAction(", "delta()", "DisableValidationAction(", "DropAction(",
index d8c1dd168e8f22401d9f163b9daf1075a8d92e8a..91df22529a6930b9f74a4df9c6a0c32376003d5c 100644 (file)
@@ -588,6 +588,10 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
       return std::shared_ptr<DNSAction>(new DropAction);
     });
 
+  g_lua.writeFunction("AllowAction", []() {
+      return std::shared_ptr<DNSAction>(new AllowAction);
+    });
+
   g_lua.writeFunction("DelayAction", [](int msec) {
       return std::shared_ptr<DNSAction>(new DelayAction(msec));
     });
index 5cc540e447237515a3d80c84545fe37918edd44a..323ee2b6156c9f9cc3fc813a374c97ade24a03b7 100644 (file)
@@ -224,6 +224,19 @@ public:
   }
 };
 
+class AllowAction : public DNSAction
+{
+public:
+  DNSAction::Action operator()(const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh, uint16_t& len, uint16_t bufferSize, string* ruleresult) const override
+  {
+    return Action::Allow;
+  }
+  string toString() const override
+  {
+    return "allow";
+  }
+};
+
 
 class QPSAction : public DNSAction
 {