From: Remi Gacogne Date: Thu, 27 Feb 2020 13:37:30 +0000 (+0100) Subject: rec: Add documentation for the new settings and Lua bindings X-Git-Tag: dnsdist-1.5.0-alpha1~12^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d14a6965ecb5de9d7e0f7129ea5345c42751647a;p=thirdparty%2Fpdns.git rec: Add documentation for the new settings and Lua bindings --- diff --git a/pdns/recursordist/docs/lua-scripting/dq.rst b/pdns/recursordist/docs/lua-scripting/dq.rst index 704c44149d..fcf9ae6710 100644 --- a/pdns/recursordist/docs/lua-scripting/dq.rst +++ b/pdns/recursordist/docs/lua-scripting/dq.rst @@ -193,6 +193,16 @@ The DNSQuestion object contains at least the following fields: Returns the :class:`DNSHeader` of the query or nil. + .. method:: DNSQuestion:getPolicyTags() -> {str} + + Get the current policy tags as a table of strings. + + .. method:: DNSQuestion:getProxyProtocolValues() -> {ProxyProtocolValue} + + .. versionadded:: 4.4.0 + + Get the Proxy Protocol Type-Length Values if any, as a table of :class:`ProxyProtocolValue` objects. + .. method:: DNSQuestion:getRecords() -> {DNSRecord} Get a table of DNS Records in this DNS Question (or answer by now). @@ -290,3 +300,20 @@ The EDNSOptionView Class .. method:: EDNSOptionView:getContent() Returns a NULL-safe string object of the first value of this EDNS option. + +The ProxyProtocolValue Class +============================ + +.. class:: ProxyProtocolValue + + .. versionadded:: 4.4.0 + + An object that represents the value of a Proxy Protocol Type-Length Value + + .. method:: ProxyProtocolValue:getContent() -> str + + Returns a NULL-safe string object. + + .. method:: ProxyProtocolValue:getType() -> int + + Returns the type of this value. diff --git a/pdns/recursordist/docs/lua-scripting/hooks.rst b/pdns/recursordist/docs/lua-scripting/hooks.rst index 7a5781c198..6fcc5f41e1 100644 --- a/pdns/recursordist/docs/lua-scripting/hooks.rst +++ b/pdns/recursordist/docs/lua-scripting/hooks.rst @@ -53,13 +53,18 @@ Interception Functions :param DNSHeader dh: The DNS Header of the query. -.. function:: gettag(remote, ednssubnet, localip, qname, qtype, ednsoptions, tcp) -> int +.. function:: gettag(remote, ednssubnet, localip, qname, qtype, ednsoptions, tcp, proxyprotocolvalues) -> int + gettag(remote, ednssubnet, localip, qname, qtype, ednsoptions, tcp) -> int gettag(remote, ednssubnet, localip, qname, qtype, ednsoptions) -> int .. versionchanged:: 4.1.0 The ``tcp`` parameter was added. + .. versionchanged:: 4.3.0 + + The ``proxyprotocolvalues`` parameter was added. + The ``gettag`` function is invoked when the Recursor attempts to discover in which packetcache an answer is available. This function must return an integer, which is the tag number of the packetcache. @@ -69,6 +74,7 @@ Interception Functions .. versionadded:: 4.1.0 It can also return a table whose keys and values are strings to fill the :attr:`DNSQuestion.data` table, as well as a ``requestorId`` value to fill the :attr:`DNSQuestion.requestorId` field and a ``deviceId`` value to fill the :attr:`DNSQuestion.deviceId` field. + .. versionadded:: 4.3.0 Along the ``deviceId`` value that can be returned, it was addded a ``deviceName`` field to fill the :attr:`DNSQuestion.deviceName` field. @@ -84,6 +90,7 @@ Interception Functions :param int qtype: The query type of the query :param ednsoptions: A table whose keys are EDNS option codes and values are :class:`EDNSOptionView` objects. This table is empty unless the :ref:`setting-gettag-needs-edns-options` option is set. :param bool tcp: Added in 4.1.0, a boolean indicating whether the query was received over UDP (false) or TCP (true). + :param proxyprotocolvalues: Added in 4.4.0, a table of :class:`ProxyProtocolValue` objects representing the Type-Length Values received via the Proxy Protocol, if any. .. function:: prerpz(dq) diff --git a/pdns/recursordist/docs/settings.rst b/pdns/recursordist/docs/settings.rst index cbebe9f2ef..10249afa93 100644 --- a/pdns/recursordist/docs/settings.rst +++ b/pdns/recursordist/docs/settings.rst @@ -1226,6 +1226,28 @@ Improves performance on Linux. Whether to compute the latency of responses in protobuf messages using the timestamp set by the kernel when the query packet was received (when available), instead of computing it based on the moment we start processing the query. +.. _setting-proxy-protocol-from: + +``proxy-protocol-from`` +----------------------- +.. versionadded:: 4.4.0 + +- IP ranges, separated by commas +- Default: empty + +Ranges that are allowed to send a Proxy Protocol header in front of UDP and TCP queries, to pass the original source and destination addresses and ports to the recursor, as well as custom values. + +.. _setting-proxy-protocol-maximum-size: + +``proxy-protocol-maximum-size`` +------------------------------- +.. versionadded:: 4.4.0 + +- Integer +- Default: 512 + +The maximum size, in bytes, of a Proxy Protocol payload (header, addresses and ports, and TLV values). Queries with a larger payload will be dropped. + .. _setting-public-suffix-list-file: ``public-suffix-list-file``