]> granicus.if.org Git - pdns/commitdiff
Add Lua bindings for DNSQuestion skipcache
authorJan Broer <janeczku@yahoo.de>
Sat, 27 Feb 2016 00:19:24 +0000 (01:19 +0100)
committerJan Broer <janeczku@yahoo.de>
Sun, 28 Feb 2016 13:26:21 +0000 (14:26 +0100)
pdns/README-dnsdist.md
pdns/dnsdist-lua.cc

index 4a77b60fcfbc07cc230dc57aa1abfc4f989c98bf..ce81d3b653712b16bbb18dc8f2541bc18de941bb 100644 (file)
@@ -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
index aa9b97cd602f428a8aab891034814263d6080987..13fa1b9d3af9bb1dcf28c3e0b739e8b94b362ec9 100644 (file)
@@ -1301,6 +1301,7 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
   g_lua.registerMember<uint16_t (DNSQuestion::*)>("len", [](const DNSQuestion& dq) -> uint16_t { return dq.len; }, [](DNSQuestion& dq, uint16_t newlen) { dq.len = newlen; });
   g_lua.registerMember<size_t (DNSQuestion::*)>("size", [](const DNSQuestion& dq) -> size_t { return dq.size; }, [](DNSQuestion& dq, size_t newSize) { (void) newSize; });
   g_lua.registerMember<bool (DNSQuestion::*)>("tcp", [](const DNSQuestion& dq) -> bool { return dq.tcp; }, [](DNSQuestion& dq, bool newTcp) { (void) newTcp; });
+  g_lua.registerMember<bool (DNSQuestion::*)>("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; });