From: Remi Gacogne Date: Mon, 13 Nov 2023 11:19:29 +0000 (+0100) Subject: dnsdist: Add missing documentation for dynamic block methods X-Git-Tag: rec-5.0.0-rc1~31^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a42497f50af41dd21c09ad1e6520192d364afa3c;p=thirdparty%2Fpdns.git dnsdist: Add missing documentation for dynamic block methods --- diff --git a/pdns/dnsdist-console.cc b/pdns/dnsdist-console.cc index 18af1c4a51..0856ec9b88 100644 --- a/pdns/dnsdist-console.cc +++ b/pdns/dnsdist-console.cc @@ -524,6 +524,8 @@ const std::vector g_consoleKeywords{ { "getCacheHitResponseRule", true, "selector", "Return the cache-hit response rule corresponding to the selector, if any" }, { "getCacheInsertedResponseRule", true, "selector", "Return the cache-inserted response rule corresponding to the selector, if any" }, { "getCurrentTime", true, "", "returns the current time" }, + { "getDynamicBlocks", true, "", "returns a table of the current network-based dynamic blocks" }, + { "getSMTDynamicBlocks", true, "", "returns a table of the current suffix-based dynamic blocks" }, { "getDNSCryptBind", true, "n", "return the `DNSCryptContext` object corresponding to the bind `n`" }, { "getDNSCryptBindCount", true, "", "returns the number of DNSCrypt listeners" }, { "getDOHFrontend", true, "n", "returns the DOH frontend with index n" }, diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index f5bd25e4ac..d264aed929 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -1440,6 +1440,18 @@ Dynamic Blocks Remove all current dynamic blocks. +.. function:: getDynamicBlocks() + + .. versionadded:: 1.9.0 + + Return an associative table of active network-based dynamic blocks. The keys are the network IP or range that are blocked, the value are :class:`DynBlock` objects. + +.. function:: getSMTDynamicBlocks() + + .. versionadded:: 1.9.0 + + Return an associative table of active domain-based (Suffix Match Tree or SMT) dynamic blocks. The keys are the domains that are blocked, the values are :class:`DynBlock` objects. + .. function:: showDynBlocks() List all dynamic blocks in effect. @@ -1460,6 +1472,40 @@ Dynamic Blocks :param int sec: The interval between two runs of the cleaning algorithm, in seconds. Default is 60 (1 minute), 0 means disabled. +.. class:: DynBlock + + .. versionadded:: 1.9.0 + + Represent the current state of a dynamic block. + + .. attribute:: DynBlock.action + + The action of this block, as an integer representing a :ref:`DNSAction `. + + .. attribute:: DynBlock.blocks + + The number of queries blocked. + + .. attribute:: DynBlock.bpf + + Whether this block is using eBPF, as a boolean. + + .. attribute:: DynBlock.domain + + The domain that is blocked, as a string, for Suffix Match Tree blocks. + + .. attribute:: DynBlock.reason + + The reason why this block was inserted, as a string. + + .. attribute:: DynBlock.until + + The time (in seconds since Epoch) at which the block will expire. + + .. attribute:: DynBlock.warning + + Whether this block is only a warning one (true) or is really enforced (false). + .. _exceedfuncs: Getting addresses that exceeded parameters