From: Remi Gacogne Date: Mon, 28 Dec 2015 17:18:03 +0000 (+0100) Subject: dnsdist: Add SuffixMatchNodeRule() and RCodeAction() X-Git-Tag: dnsdist-1.0.0-alpha2~135^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bd31ccc3552c7aecd81be9f076004476d3e9598;p=pdns dnsdist: Add SuffixMatchNodeRule() and RCodeAction() I needed them for the regression tests, and unless there is a cleaner way to do the same thing that I missed, they will be useful. --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index b88f7445c..932d5bfd4 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -483,6 +483,9 @@ vector> setupLua(bool client, const std::string& confi return std::shared_ptr(new LogAction(fname)); }); + g_lua.writeFunction("RCodeAction", [](int rcode) { + return std::shared_ptr(new RCodeAction(rcode)); + }); g_lua.writeFunction("MaxQPSIPRule", [](unsigned int qps, boost::optional ipv4trunc, boost::optional ipv6trunc) { return std::shared_ptr(new MaxQPSIPRule(qps, ipv4trunc.get_value_or(32), ipv6trunc.get_value_or(64))); @@ -501,6 +504,9 @@ vector> setupLua(bool client, const std::string& confi return std::shared_ptr(new RegexRule(str)); }); + g_lua.writeFunction("SuffixMatchNodeRule", [](const SuffixMatchNode& smn) { + return std::shared_ptr(new SuffixMatchNodeRule(smn)); + }); g_lua.writeFunction("benchRule", [](std::shared_ptr rule, boost::optional times_, boost::optional suffix_) { setLuaNoSideEffect();