From a14c7f7b842a0f510c2638b8d31e5c00e35c57a3 Mon Sep 17 00:00:00 2001 From: Jan Broer Date: Sat, 27 Feb 2016 01:19:24 +0100 Subject: [PATCH] Add Lua bindings for DNSQuestion skipcache --- pdns/README-dnsdist.md | 1 + pdns/dnsdist-lua.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/pdns/README-dnsdist.md b/pdns/README-dnsdist.md index 4a77b60fc..ce81d3b65 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 aa9b97cd6..13fa1b9d3 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; }); -- 2.40.0