From: Jan Broer Date: Sat, 27 Feb 2016 00:19:24 +0000 (+0100) Subject: Add Lua bindings for DNSQuestion skipcache X-Git-Tag: rec-4.0.0-alpha2~34^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3466%2Fhead;p=thirdparty%2Fpdns.git Add Lua bindings for DNSQuestion skipcache --- diff --git a/pdns/README-dnsdist.md b/pdns/README-dnsdist.md index 4a77b60fcf..ce81d3b653 100644 --- a/pdns/README-dnsdist.md +++ b/pdns/README-dnsdist.md @@ -1061,6 +1061,7 @@ instantiate a server with additional parameters * member `remoteaddr`: ComboAddress of the remote client * member `rcode`: RCode of this question * member `size`: the total size of the buffer starting at `dh` + * member `skipCache`: whether to skip cache lookup / storing the answer for this question (settable) * member `tcp`: whether this question was received over a TCP socket * DNSHeader related * member `getRD()`: get recursion desired flag diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index aa9b97cd60..13fa1b9d3a 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -1301,6 +1301,7 @@ vector> setupLua(bool client, const std::string& confi g_lua.registerMember("len", [](const DNSQuestion& dq) -> uint16_t { return dq.len; }, [](DNSQuestion& dq, uint16_t newlen) { dq.len = newlen; }); g_lua.registerMember("size", [](const DNSQuestion& dq) -> size_t { return dq.size; }, [](DNSQuestion& dq, size_t newSize) { (void) newSize; }); g_lua.registerMember("tcp", [](const DNSQuestion& dq) -> bool { return dq.tcp; }, [](DNSQuestion& dq, bool newTcp) { (void) newTcp; }); + g_lua.registerMember("skipCache", [](const DNSQuestion& dq) -> bool { return dq.skipCache; }, [](DNSQuestion& dq, bool newSkipCache) { dq.skipCache = newSkipCache; }); g_lua.writeFunction("setMaxTCPClientThreads", [](uint64_t max) { g_maxTCPClientThreads = max; });