]> granicus.if.org Git - pdns/commitdiff
docs: better layout of Lua objects in dnsdist docs
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 25 Jan 2018 17:11:08 +0000 (18:11 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 25 Jan 2018 17:11:08 +0000 (18:11 +0100)
pdns/dnsdistdist/docs/advanced/timedipsetrule.rst
pdns/dnsdistdist/docs/reference/comboaddress.rst
pdns/dnsdistdist/docs/reference/config.rst
pdns/dnsdistdist/docs/reference/dnscrypt.rst
pdns/dnsdistdist/docs/reference/dnsname.rst
pdns/dnsdistdist/docs/reference/dq.rst
pdns/dnsdistdist/docs/reference/ebpf.rst
pdns/dnsdistdist/docs/reference/netmaskgroup.rst
pdns/dnsdistdist/docs/reference/protobuf.rst

index 96c33be4a3ba660f0785fc729346825a2b99c2d5..9cfdf5e8829e26dcaafd01736e33f2888f5f571c 100644 (file)
@@ -19,24 +19,24 @@ added in :class:`ComboAddress` form.
 
   Can be used to handle IP addresses differentlt based on the date and time
 
-.. classmethod:: TimedIPSetRule:add(address, seconds)
+  .. method:: TimedIPSetRule:add(address, seconds)
 
-  Add an IP address to the set for the next ``second`` seconds.
+    Add an IP address to the set for the next ``second`` seconds.
 
-  :param ComboAddress address: The address to add
-  :param int seconds: Time to keep the address in the Rule
+    :param ComboAddress address: The address to add
+    :param int seconds: Time to keep the address in the Rule
 
-.. classmethod:: TimedIPSetRule:cleanup()
+  .. method:: TimedIPSetRule:cleanup()
 
-  Purge the set from expired IP addresses
+    Purge the set from expired IP addresses
 
-.. classmethod:: TimedIPSetRule:clear()
+  .. method:: TimedIPSetRule:clear()
 
-  Clear the entire set
+    Clear the entire set
 
-.. classmethod:: TimedIPSetRule:slice()
+  .. method:: TimedIPSetRule:slice()
 
-  Convert the TimedIPSetRule into a DNSRule that can be passed to :func:`addAction`
+    Convert the TimedIPSetRule into a DNSRule that can be passed to :func:`addAction`
 
 A working example:
 
index 6837db8d9d8541e81dc19a20696cec5c29ef9392..b32b427795e512d2e686c98cf2bfa1ea60cabad5 100644 (file)
@@ -3,12 +3,8 @@
 ComboAddress
 ============
 
-.. class:: ComboAddress
-
-  A ``ComboAddress`` represents an IP address with possibly a port number.
-  The object can be an IPv4 or an IPv6 address.
-
-Functions and methods related to ``ComboAddress``
+IP addresses are moved around in a native format, called a ComboAddress.
+ComboAddresses can be IPv4 or IPv6, and unless you want to know, you don't need to.
 
 .. function:: newCA(address) -> :class:`ComboAddress`
 
@@ -16,40 +12,46 @@ Functions and methods related to ``ComboAddress``
 
   :param string address: The IP address, with optional port, to represent.
 
-.. classmethod:: ComboAddress:getPort() -> int
+.. class:: ComboAddress
+
+  A ``ComboAddress`` represents an IP address with possibly a port number.
+  The object can be an IPv4 or an IPv6 address.
+  It has these methods:
+
+  .. method:: ComboAddress:getPort() -> int
 
-  Returns the port number.
+    Returns the port number.
 
-.. classmethod:: ComboAddress:isIPv4() -> bool
+  .. method:: ComboAddress:isIPv4() -> bool
 
-  Returns true if the address is an IPv4, false otherwise
+    Returns true if the address is an IPv4, false otherwise
 
-.. classmethod:: ComboAddress:isIPv6() -> bool
+  .. method:: ComboAddress:isIPv6() -> bool
 
-  Returns true if the address is an IPv6, false otherwise
+    Returns true if the address is an IPv6, false otherwise
 
-.. classmethod:: ComboAddress:isMappedIPv4() -> bool
+  .. method:: ComboAddress:isMappedIPv4() -> bool
 
-  Returns true if the address is an IPv4 mapped into an IPv6, false otherwise
+    Returns true if the address is an IPv4 mapped into an IPv6, false otherwise
 
-.. classmethod:: ComboAddress:mapToIPv4() -> ComboAddress
+  .. method:: ComboAddress:mapToIPv4() -> ComboAddress
 
-  Convert an IPv4 address mapped in a v6 one into an IPv4.
-  Returns a new ComboAddress
+    Convert an IPv4 address mapped in a v6 one into an IPv4.
+    Returns a new ComboAddress
 
-.. classmethod:: ComboAddress:tostring() -> string
-                 ComboAddress:toString() -> string
+  .. method:: ComboAddress:tostring() -> string
+                   ComboAddress:toString() -> string
 
-  Returns in human-friendly format
+    Returns in human-friendly format
 
-.. classmethod:: ComboAddress:tostringWithPort() -> string
-                 ComboAddress:toStringWithPort() -> string
+  .. method:: ComboAddress:tostringWithPort() -> string
+                   ComboAddress:toStringWithPort() -> string
 
-  Returns in human-friendly format, with port number
+    Returns in human-friendly format, with port number
 
-.. classmethod:: ComboAddress:truncate(bits)
+  .. method:: ComboAddress:truncate(bits)
 
-  Truncate the ComboAddress to the specified number of bits.
-  This essentially zeroes all bits after ``bits``.
+    Truncate the ComboAddress to the specified number of bits.
+    This essentially zeroes all bits after ``bits``.
 
-  :param int bits: Amount of bits to truncate to
+    :param int bits: Amount of bits to truncate to
index e397c15db32da7438c2ea00482111226be0f1cd9..a89d466346c8013b83865114dfb52828d23b6f81 100644 (file)
@@ -302,86 +302,85 @@ A server object returned by :func:`getServer` can be manipulated with these func
 
   This object represents a backend server. It has several methods.
 
-.. classmethod:: Server:addPool(pool)
+  .. method:: Server:addPool(pool)
 
-  Add this server to a pool.
+    Add this server to a pool.
 
-  :param str pool: The pool to add the server to
+    :param str pool: The pool to add the server to
 
-.. classmethod:: Server:getName() -> string
+  .. method:: Server:getName() -> string
 
-  Get the name of this server.
+    Get the name of this server.
 
-  :returns: The name of the server, or an empty string if it does not have one
+    :returns: The name of the server, or an empty string if it does not have one
 
-.. classmethod:: Server:getNameWithAddr() -> string
+  .. method:: Server:getNameWithAddr() -> string
 
-  Get the name plus IP address and port of the server
+    Get the name plus IP address and port of the server
 
-  :returns: A string containing the server name if any plus the server address and port
+    :returns: A string containing the server name if any plus the server address and port
 
-.. classmethod:: Server:getOutstanding() -> int
+  .. method:: Server:getOutstanding() -> int
 
-  Get the number of outstanding queries for this server.
+    Get the number of outstanding queries for this server.
 
-  :returns: The number of outstanding queries
+    :returns: The number of outstanding queries
 
-.. classmethod:: Server:isUp() -> bool
+  .. method:: Server:isUp() -> bool
 
-  Returns the up status of the server
+    Returns the up status of the server
 
-  :returns: true when the server is up, false otherwise
+    :returns: true when the server is up, false otherwise
 
-.. classmethod:: Server:rmPool(pool)
+  .. method:: Server:rmPool(pool)
 
-  Removes the server from the named pool
+    Removes the server from the named pool
 
-  :param str pool: The pool to remove the server from
+    :param str pool: The pool to remove the server from
 
-.. classmethod:: Server:setAuto([status])
+  .. method:: Server:setAuto([status])
 
-.. versionchanged:: 1.3.0
-    ``status`` optional parameter added.
+    .. versionchanged:: 1.3.0
+        ``status`` optional parameter added.
 
-  Set the server in the default auto state.
-  This will enable health check queries that will set the server ``up`` and ``down`` appropriately.
+    Set the server in the default auto state.
+    This will enable health check queries that will set the server ``up`` and ``down`` appropriately.
 
-  :param bool status: Set the initial status of the server to ``up`` (true) or ``down`` (false) instead of using the last known status
+    :param bool status: Set the initial status of the server to ``up`` (true) or ``down`` (false) instead of using the last known status
 
-.. classmethod:: Server:setQPS(limit)
+  .. method:: Server:setQPS(limit)
 
-  Limit the queries per second for this server.
+    Limit the queries per second for this server.
 
-  :param int limit: The maximum number of queries per second
+    :param int limit: The maximum number of queries per second
 
-.. classmethod:: Server:setDown()
+  .. method:: Server:setDown()
 
-  Set the server in an ``DOWN`` state.
-  The server will not receive queries and the health checks are disabled
+    Set the server in an ``DOWN`` state.
+    The server will not receive queries and the health checks are disabled
 
-.. classmethod:: Server:setUp()
+  .. method:: Server:setUp()
 
-  Set the server in an ``UP`` state.
-  This server will still receive queries and health checks are disabled
+    Set the server in an ``UP`` state.
+    This server will still receive queries and health checks are disabled
 
-Attributes
-~~~~~~~~~~
+  Apart from the functions, a :class:`Server` object has these attributes:
 
-.. attribute:: Server.name
+  .. attribute:: Server.name
 
-  The name of the server
+    The name of the server
 
-.. attribute:: Server.upStatus
+  .. attribute:: Server.upStatus
 
-  Whether or not this server is up or down
+    Whether or not this server is up or down
 
-.. attribute:: Server.order
+  .. attribute:: Server.order
 
-  The order of the server
+    The order of the server
 
-.. attribute:: Server.weight
+  .. attribute:: Server.weight
 
-  The weight of the server
+    The weight of the server
 
 Pools
 -----
@@ -417,19 +416,19 @@ Pools are automatically created when a server is added to a pool (with :func:`ne
 
   This represents the pool where zero or more servers are part of.
 
-.. classmethod:: ServerPool:getCache() -> PacketCache
+  .. method:: ServerPool:getCache() -> PacketCache
 
-  Returns the :class:`PacketCache` for this pool or nil.
+    Returns the :class:`PacketCache` for this pool or nil.
 
-.. classmethod:: ServerPool:setCache(cache)
+  .. method:: ServerPool:setCache(cache)
 
-  Adds ``cache`` as the pool's cache.
+    Adds ``cache`` as the pool's cache.
 
-  :param PacketCache cache: The new cache to add to the pool
+    :param PacketCache cache: The new cache to add to the pool
 
-.. classmethod:: ServerPool:unsetCache()
+  .. method:: ServerPool:unsetCache()
 
-  Removes the cache from this pool.
+    Removes the cache from this pool.
 
 PacketCache
 ~~~~~~~~~~~
@@ -457,40 +456,40 @@ See :doc:`../guides/cache` for a how to.
 
   Represents a cache that can be part of :class:`ServerPool`.
 
-.. classmethod:: PacketCache:expunge(n)
+  .. method:: PacketCache:expunge(n)
 
-  Remove entries from the cache, leaving at most ``n`` entries
+    Remove entries from the cache, leaving at most ``n`` entries
 
-  :param int n: Number of entries to keep
+    :param int n: Number of entries to keep
 
-.. classmethod:: PacketCache:expungeByName(name [, qtype=dnsdist.ANY[, suffixMatch=false]])
+  .. method:: PacketCache:expungeByName(name [, qtype=dnsdist.ANY[, suffixMatch=false]])
 
-  .. versionchanged:: 1.2.0
-    ``suffixMatch`` parameter added.
+    .. versionchanged:: 1.2.0
+      ``suffixMatch`` parameter added.
 
-  Remove entries matching ``name`` and type from the cache.
+    Remove entries matching ``name`` and type from the cache.
 
-  :param DNSName name: The name to expunge
-  :param int qtype: The type to expunge
-  :param bool suffixMatch: When set to true, remove al entries under ``name``
+    :param DNSName name: The name to expunge
+    :param int qtype: The type to expunge
+    :param bool suffixMatch: When set to true, remove al entries under ``name``
 
-.. classmethod:: PacketCache:isFull() -> bool
+  .. method:: PacketCache:isFull() -> bool
 
-  Return true if the cache has reached the maximum number of entries.
+    Return true if the cache has reached the maximum number of entries.
 
-.. classmethod:: PacketCache:printStats()
+  .. method:: PacketCache:printStats()
 
-  Print the cache stats (hits, misses, deferred lookups and deferred inserts).
+    Print the cache stats (hits, misses, deferred lookups and deferred inserts).
 
-.. classmethod:: PacketCache:purgeExpired(n)
+  .. method:: PacketCache:purgeExpired(n)
 
-  Remove expired entries from the cache until there is at most ``n`` entries remaining in the cache.
+    Remove expired entries from the cache until there is at most ``n`` entries remaining in the cache.
 
-  :param int n: Number of entries to keep
+    :param int n: Number of entries to keep
 
-.. classmethod:: PacketCache:toString() -> string
+  .. method:: PacketCache:toString() -> string
 
-  Return the number of entries in the Packet Cache, and the maximum number of entries
+    Return the number of entries in the Packet Cache, and the maximum number of entries
 
 Client State
 ------------
@@ -499,7 +498,7 @@ Also called frontend or bind, the Client State object returned by :func:`getBind
 
 .. function:: getBind(index) -> ClientState
 
-  Return a ClientState object.
+  Return a :class:`ClientState` object.
 
   :param int index: The object index
 
@@ -510,34 +509,25 @@ ClientState functions
 
   This object represents an address and port dnsdist is listening on. When ``reuseport`` is in use, several ClientState objects can be present for the same address and port.
 
-.. classmethod:: Server:addPool(pool)
-
-  Add this server to a pool.
-
-  :param str pool: The pool to add the server to
-
-.. classmethod:: ClientState:attachFilter(filter)
+  .. method:: ClientState:attachFilter(filter)
 
-   Attach a BPF filter to this frontend.
+     Attach a BPF filter to this frontend.
 
-   :param BPFFilter filter: The filter to attach to this frontend
+     :param BPFFilter filter: The filter to attach to this frontend
 
-.. classmethod:: ClientState:detachFilter()
+  .. method:: ClientState:detachFilter()
 
-   Remove the BPF filter associated to this frontend, if any.
+     Remove the BPF filter associated to this frontend, if any.
 
-.. classmethod:: ClientState:toString() -> string
+  .. method:: ClientState:toString() -> string
 
-  Return the address and port this frontend is listening on.
+    Return the address and port this frontend is listening on.
 
-  :returns: The address and port this frontend is listening on
+    :returns: The address and port this frontend is listening on
 
-Attributes
-~~~~~~~~~~
-
-.. attribute:: ClientState.muted
+  .. attribute:: ClientState.muted
 
-  If set to true, queries received on this frontend will be normally processed and sent to a backend if needed, but no response will be ever be sent to the client over UDP. TCP queries are processed normally and responses sent to the client.
+    If set to true, queries received on this frontend will be normally processed and sent to a backend if needed, but no response will be ever be sent to the client over UDP. TCP queries are processed normally and responses sent to the client.
 
 Status, Statistics and More
 ---------------------------
@@ -547,6 +537,7 @@ Status, Statistics and More
   Print all statistics dnsdist gathers
 
 .. function:: getTLSContext(idx)
+
   .. versionadded:: 1.3.0
 
   Return the TLSContext object for the context of index ``idx``.
@@ -601,6 +592,7 @@ Status, Statistics and More
   Show some statistics regarding TCP
 
 .. function:: showTLSContexts()
+
   .. versionadded:: 1.3.0
 
   Print the list of all availables DNS over TLS contexts.
@@ -731,16 +723,17 @@ TLSContext
 ~~~~~~~~~~
 
 .. class:: TLSContext
+
   .. versionadded:: 1.3.0
 
   This object represents an address and port dnsdist is listening on for DNS over TLS queries.
 
-.. classmethod:: TLSContext:rotateTicketsKey()
+  .. method:: TLSContext:rotateTicketsKey()
 
-   Replace the current TLS tickets key by a new random one.
+     Replace the current TLS tickets key by a new random one.
 
-.. classmethod:: TLSContext:loadTicketsKeys(ticketsKeysFile)
+  .. method:: TLSContext:loadTicketsKeys(ticketsKeysFile)
 
-   Load new tickets keys from the selected file, replacing the existing ones. These keys should be rotated often and never written to persistent storage to preserve forward secrecy. The default is to generate a random key. The OpenSSL provider supports several tickets keys to be able to decrypt existing sessions after the rotation, while the GnuTLS provider only supports one key.
+     Load new tickets keys from the selected file, replacing the existing ones. These keys should be rotated often and never written to persistent storage to preserve forward secrecy. The default is to generate a random key. The OpenSSL provider supports several tickets keys to be able to decrypt existing sessions after the rotation, while the GnuTLS provider only supports one key.
 
-  :param str ticketsKeysFile: The path to a file from where TLS tickets keys should be loaded.
+    :param str ticketsKeysFile: The path to a file from where TLS tickets keys should be loaded.
index a906364fc5c4d274f585615a39d749b9d064a41c..75ef9f2fe540b9a0e0af25d020eb88ad5282920f 100644 (file)
@@ -58,41 +58,41 @@ Certificates
 
   Represents a DNSCrypt certificate.
 
-.. classmethod:: DNSCryptCert:getClientMagic() -> string
+  .. method:: DNSCryptCert:getClientMagic() -> string
 
-  Return this certificate's client magic value.
+    Return this certificate's client magic value.
 
-.. classmethod:: DNSCryptCert:getEsVersion() -> string
+  .. method:: DNSCryptCert:getEsVersion() -> string
 
-  Return the cryptographic construction to use with this certificate,.
+    Return the cryptographic construction to use with this certificate,.
 
-.. classmethod:: DNSCryptCert:getMagic() -> string
+  .. method:: DNSCryptCert:getMagic() -> string
 
-  Return the certificate magic number.
+    Return the certificate magic number.
 
-.. classmethod:: DNSCryptCert:getProtocolMinorVersion() -> string
+  .. method:: DNSCryptCert:getProtocolMinorVersion() -> string
 
-  Return this certificate's minor version.
+    Return this certificate's minor version.
 
-.. classmethod:: DNSCryptCert:getResolverPublicKey() -> string
+  .. method:: DNSCryptCert:getResolverPublicKey() -> string
 
-  Return the public key corresponding to this certificate.
+    Return the public key corresponding to this certificate.
 
-.. classmethod:: DNSCryptCert:getSerial() -> int
+  .. method:: DNSCryptCert:getSerial() -> int
 
-  Return the certificate serial number.
+    Return the certificate serial number.
 
-.. classmethod:: DNSCryptCert:getSignature() -> string
+  .. method:: DNSCryptCert:getSignature() -> string
 
-  Return this certificate's signature.
+    Return this certificate's signature.
 
-.. classmethod:: DNSCryptCert:getTSEnd() -> int
+  .. method:: DNSCryptCert:getTSEnd() -> int
 
-  Return the date the certificate is valid from, as a Unix timestamp.
+    Return the date the certificate is valid from, as a Unix timestamp.
 
-.. classmethod:: DNSCryptCert:getTSStart() -> int
+  .. method:: DNSCryptCert:getTSStart() -> int
 
-  Return the date the certificate is valid until (inclusive), as a Unix timestamp
+    Return the date the certificate is valid until (inclusive), as a Unix timestamp
 
 Context
 -------
@@ -101,34 +101,34 @@ Context
 
   Represents a DNSCrypt content. Can be used to rotate certs.
 
-.. classmethod:: DNSCryptContext:generateAndLoadInMemoryCertificate(keyfile, serial, begin, end)
+  .. method:: DNSCryptContext:generateAndLoadInMemoryCertificate(keyfile, serial, begin, end)
 
-  Generate a new resolver key and the associated certificate in-memory, sign it with the provided provider key, and use the new certificate
+    Generate a new resolver key and the associated certificate in-memory, sign it with the provided provider key, and use the new certificate
 
-  :param string keyfile: Path to the key file to use
-  :param int serial: The serial number of the certificate
-  :param int begin: Unix timestamp from when the certificate is valid
-  :param int end: Unix timestamp from until the certificate is valid
+    :param string keyfile: Path to the key file to use
+    :param int serial: The serial number of the certificate
+    :param int begin: Unix timestamp from when the certificate is valid
+    :param int end: Unix timestamp from until the certificate is valid
 
-.. classmethod:: DNSCryptContext:getCurrentCertificate() -> DNSCryptCert
+  .. method:: DNSCryptContext:getCurrentCertificate() -> DNSCryptCert
 
-  Return the current certificate.
+    Return the current certificate.
 
-.. classmethod:: DNSCryptContext:getOldCertificate() -> DNSCryptCert
+  .. method:: DNSCryptContext:getOldCertificate() -> DNSCryptCert
 
-  Return the previous certificate.
+    Return the previous certificate.
 
-.. classmethod:: DNSCryptContext:getProviderName() -> string
+  .. method:: DNSCryptContext:getProviderName() -> string
 
-  Return the provider name
+    Return the provider name
 
-.. classmethod:: DNSCryptContext:hasOldCertificate() -> bool
+  .. method:: DNSCryptContext:hasOldCertificate() -> bool
 
-  Whether or not the context has a previous certificate, from a certificate rotation.
+    Whether or not the context has a previous certificate, from a certificate rotation.
 
-.. classmethod:: DNSCryptContext:loadNewCertificate(certificate, keyfile)
+  .. method:: DNSCryptContext:loadNewCertificate(certificate, keyfile)
 
-  Load a new certificate and the corresponding private key, and use it
+    Load a new certificate and the corresponding private key, and use it
 
-  :param string certificate: Path to a certificate file
-  :param string keyfile: Path to a the corresponding key file
+    :param string certificate: Path to a certificate file
+    :param string keyfile: Path to a the corresponding key file
index e769ad57c81dfc31bf67af8312a980ff0f072e25..939e5ea0baf654515f1c8f1b3259dd785a7e0dd6 100644 (file)
@@ -3,11 +3,7 @@
 DNSName objects
 ===============
 
-.. class:: DNSName
-
-  A ``DNSName`` object represents a name in the DNS.
-  It is returned by several functions and has several functions to programmatically interact with it.
-
+A :class:`DNSName` object represents a name in the DNS. It has serveral functions that can manipulate it without conversions to strings.
 Creating a ``DNSName`` is done with the :func:`newDNSName`::
 
   myname = newDNSName("www.example.com")
@@ -25,7 +21,6 @@ The ``myname`` variable has several functions to get information from it
     print('it is')
   end
 
-
 Functions and methods of a ``DNSName``
 --------------------------------------
 
@@ -35,28 +30,33 @@ Functions and methods of a ``DNSName``
 
   :param string name: The name to create a DNSName for
 
-.. classmethod:: DNSName::chopoff() -> bool
+.. class:: DNSName
+
+  A ``DNSName`` object represents a name in the DNS.
+  It is returned by several functions and has several functions to programmatically interact with it.
+
+  .. method:: DNSName:chopoff() -> bool
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Removes the left-most label and returns ``true``.
-  ``false`` is returned if no label was removed
+    Removes the left-most label and returns ``true``.
+    ``false`` is returned if no label was removed
 
-.. classmethod:: DNSName:countLabels() -> int
+  .. method:: DNSName:countLabels() -> int
 
-  Returns the number of DNSLabels in the name
+    Returns the number of DNSLabels in the name
 
-.. classmethod:: DNSName:isPartOf(name) -> bool
+  .. method:: DNSName:isPartOf(name) -> bool
 
-  Returns true if the DNSName is part of the DNS tree of ``name``.
+    Returns true if the DNSName is part of the DNS tree of ``name``.
 
-  :param DNSName name: The name to check against
+    :param DNSName name: The name to check against
 
-.. classmethod:: DNSName:toString() -> string
-                 DNSName:tostring() -> string
+  .. method:: DNSName:toString() -> string
+              DNSName:tostring() -> string
 
-  Returns a human-readable form of the DNSName.
+    Returns a human-readable form of the DNSName.
 
-.. classmethod:: DNSName:wirelength -> int
+  .. method:: DNSName:wirelength() -> int
 
-  Returns the length in bytes of the DNSName as it would be on the wire.
+    Returns the length in bytes of the DNSName as it would be on the wire.
index a5e8cc4b7b770424c8a88789351e2154ee88db6b..b0ea734fc7feaaf726a2f9cb2770bad3f96127e4 100644 (file)
@@ -7,124 +7,124 @@ A DNSQuestion or ``dq`` object is available in several hooks and Lua actions.
 This object contains details about the current state of the question.
 This state can be modified from the various hooks.
 
-The DNSQuestion object has several attributes, many of them read-only:
-
 .. class:: DNSQuestion
 
-.. attribute:: DNSQuestion.dh
+  The DNSQuestion object has several attributes, many of them read-only:
+
+  .. attribute:: DNSQuestion.dh
 
-  The :ref:`DNSHeader` of this query.
+    The :ref:`DNSHeader` of this query.
 
-.. attribute:: DNSQuestion.ecsOverride
+  .. attribute:: DNSQuestion.ecsOverride
 
-  Whether an existing ECS value should be overridden, settable.
+    Whether an existing ECS value should be overridden, settable.
 
-.. attribute:: DNSQuestion.ecsPrefixLength
+  .. attribute:: DNSQuestion.ecsPrefixLength
 
-   The ECS prefix length to use, settable.
+     The ECS prefix length to use, settable.
 
-.. attribute:: DNSQuestion.len
+  .. attribute:: DNSQuestion.len
 
-  The length of the :attr:`qname <DNSQuestion.qname>`.
+    The length of the :attr:`qname <DNSQuestion.qname>`.
 
-.. attribute:: DNSQuestion.localaddr
+  .. attribute:: DNSQuestion.localaddr
 
-  :ref:`ComboAddress` of the local bind this question was received on.
+    :ref:`ComboAddress` of the local bind this question was received on.
 
-.. attribute:: DNSQuestion.opcode
+  .. attribute:: DNSQuestion.opcode
 
-  Integer describing the OPCODE of the packet. Can be matched against :ref:`DNSOpcode`.
+    Integer describing the OPCODE of the packet. Can be matched against :ref:`DNSOpcode`.
 
-.. attribute:: DNSQuestion.qclass
+  .. attribute:: DNSQuestion.qclass
 
-  QClass (as an unsigned integer) of this question.
-  Can be compared against :ref:`DNSQClass`.
+    QClass (as an unsigned integer) of this question.
+    Can be compared against :ref:`DNSQClass`.
 
-.. attribute:: DNSQuestion.qname
+  .. attribute:: DNSQuestion.qname
 
-  :class:`DNSName` of this question.
+    :class:`DNSName` of this question.
 
-.. attribute:: DNSQuestion.qtype
+  .. attribute:: DNSQuestion.qtype
 
-  QType (as an unsigned integer) of this question.
-  Can be compared against ``dnsdist.A``, ``dnsdist.AAAA`` etc.
+    QType (as an unsigned integer) of this question.
+    Can be compared against ``dnsdist.A``, ``dnsdist.AAAA`` etc.
 
-.. attribute:: DNSQuestion.remoteaddr
+  .. attribute:: DNSQuestion.remoteaddr
 
-  :ref:`ComboAddress` of the remote client.
+    :ref:`ComboAddress` of the remote client.
 
-.. attribute:: DNSQuestion.rcode
+  .. attribute:: DNSQuestion.rcode
 
-  RCode (as an unsigned integer) of this question.
-  Can be compared against :ref:`DNSRCode`
+    RCode (as an unsigned integer) of this question.
+    Can be compared against :ref:`DNSRCode`
 
-.. attribute:: DNSQuestion.size
+  .. attribute:: DNSQuestion.size
 
-  The total size of the buffer starting at :attr:`DNSQuestion.dh`.
+    The total size of the buffer starting at :attr:`DNSQuestion.dh`.
 
-.. attribute:: DNSQuestion.skipCache
+  .. attribute:: DNSQuestion.skipCache
 
-  Whether to skip cache lookup / storing the answer for this question, settable.
+    Whether to skip cache lookup / storing the answer for this question, settable.
 
-.. attribute:: DNSQuestion.tcp
+  .. attribute:: DNSQuestion.tcp
 
-  Whether the query have been received over TCP.
+    Whether the query have been received over TCP.
 
-.. attribute:: DNSQuestion.useECS
+  .. attribute:: DNSQuestion.useECS
 
-  Whether to send ECS to the backend, settable.
+    Whether to send ECS to the backend, settable.
 
-It also supports the following methods:
+  It also supports the following methods:
 
-.. classmethod:: DNSQuestion:getDO() -> bool
+  .. method:: DNSQuestion:getDO() -> bool
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Get the value of the DNSSEC OK bit.
+    Get the value of the DNSSEC OK bit.
 
-  :returns: true if the DO bit was set, false otherwise
+    :returns: true if the DO bit was set, false otherwise
 
-.. classmethod:: DNSQuestion:getTag(key) -> string
+  .. method:: DNSQuestion:getTag(key) -> string
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Get the value of a tag stored into the DNSQuestion object.
+    Get the value of a tag stored into the DNSQuestion object.
 
-  :param string key: The tag's key
-  :returns: A table of tags, using strings as keys and values
+    :param string key: The tag's key
+    :returns: A table of tags, using strings as keys and values
 
-.. classmethod:: DNSQuestion:getTagArray() -> table
+  .. method:: DNSQuestion:getTagArray() -> table
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Get all the tags stored into the DNSQuestion object.
+    Get all the tags stored into the DNSQuestion object.
 
-  :returns: The tag's value if it was set, an empty string otherwise
+    :returns: The tag's value if it was set, an empty string otherwise
 
-.. classmethod:: DNSQuestion:sendTrap(reason)
+  .. method:: DNSQuestion:sendTrap(reason)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Send an SNMP trap.
+    Send an SNMP trap.
 
-  :param string reason: An optional string describing the reason why this trap was sent
+    :param string reason: An optional string describing the reason why this trap was sent
 
-.. classmethod:: DNSQuestion:setTag(key, value)
+  .. method:: DNSQuestion:setTag(key, value)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Set a tag into the DNSQuestion object.
+    Set a tag into the DNSQuestion object.
 
-  :param string key: The tag's key
-  :param string value: The tag's value
+    :param string key: The tag's key
+    :param string value: The tag's value
 
-.. classmethod:: DNSQuestion:setTagArray(tags)
+  .. method:: DNSQuestion:setTagArray(tags)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Set an array of tags into the DNSQuestion object.
+    Set an array of tags into the DNSQuestion object.
 
-  :param table tags: A table of tags, using strings as keys and values
+    :param table tags: A table of tags, using strings as keys and values
 
 .. _DNSResponse:
 
@@ -135,23 +135,23 @@ DNSResponse object
 
   This object has all the functions and members of a :ref:`DNSQuestion <DNSQuestion>` and some more
 
-.. classmethod:: DNSResponse:editTTLs(func)
+  .. method:: DNSResponse:editTTLs(func)
 
-  The function ``func`` is invoked for every entry in the answer, authority and additional section.
+    The function ``func`` is invoked for every entry in the answer, authority and additional section.
 
-  ``func`` points to a function with the following prototype: ``myFunc(section, qclass, qtype, ttl)``
+    ``func`` points to a function with the following prototype: ``myFunc(section, qclass, qtype, ttl)``
 
-  All parameters to ``func`` are integers:
+    All parameters to ``func`` are integers:
 
-  - ``section`` is the section in the packet and can be compared to :ref:`DNSSection`
-  - ``qclass`` is the QClass of the record. Can be compared to :ref:`DNSQClass`
-  - ``qtype`` is the QType of the record. Can be e.g. compared to ``dnsdist.A``, ``dnsdist.AAAA`` and the like.
-  - ``ttl`` is the current TTL
+    - ``section`` is the section in the packet and can be compared to :ref:`DNSSection`
+    - ``qclass`` is the QClass of the record. Can be compared to :ref:`DNSQClass`
+    - ``qtype`` is the QType of the record. Can be e.g. compared to ``dnsdist.A``, ``dnsdist.AAAA`` and the like.
+    - ``ttl`` is the current TTL
 
-  This function must return an integer with the new TTL.
-  Setting this TTL to 0 to leaves it unchanged
+    This function must return an integer with the new TTL.
+    Setting this TTL to 0 to leaves it unchanged
 
-  :param string func: The function to call to edit TTLs.
+    :param string func: The function to call to edit TTLs.
 
 .. _DNSHeader:
 
@@ -162,35 +162,35 @@ DNSHeader (``dh``) object
 
   This object holds a representation of a DNS packet's header.
 
-.. classmethod:: DNSHeader:getRD() -> bool
+  .. method:: DNSHeader:getRD() -> bool
 
-  Get recursion desired flag.
+    Get recursion desired flag.
 
-.. classmethod:: DNSHeader:setRD(rd)
+  .. method:: DNSHeader:setRD(rd)
 
-  Set recursion desired flag.
+    Set recursion desired flag.
 
-  :param bool rd: State of the RD flag
+    :param bool rd: State of the RD flag
 
-.. classmethod:: DNSHeader:setTC(tc)
+  .. method:: DNSHeader:setTC(tc)
 
-  Set truncation flag (TC).
+    Set truncation flag (TC).
 
-  :param bool tc: State of the TC flag
+    :param bool tc: State of the TC flag
 
-.. classmethod:: DNSHeader:setQR(qr)
+  .. method:: DNSHeader:setQR(qr)
 
-  Set Query/Response flag.
-  Setting QR to true means "This is an answer packet".
+    Set Query/Response flag.
+    Setting QR to true means "This is an answer packet".
 
-  :param bool qr: State of the QR flag
+    :param bool qr: State of the QR flag
 
-.. classmethod:: DNSHeader:getCD() -> bool
+  .. method:: DNSHeader:getCD() -> bool
 
-  Get checking disabled flag.
+    Get checking disabled flag.
 
-.. classmethod:: DNSHeader:setCD(cd)
+  .. method:: DNSHeader:setCD(cd)
 
-  Set checking disabled flag.
+    Set checking disabled flag.
 
-  :param bool cd: State of the CD flag
+    :param bool cd: State of the CD flag
index e48a77a7a6b7537c89fa66afa71143fbcd56fa8c..b55c06c887c506b3be11f0916f2585eea608839e 100644 (file)
@@ -48,47 +48,46 @@ These are all the functions, objects and methods related to the :doc:`../advance
 
   Represents an eBPF filter
 
-.. classmethod:: BPFFilter:attachToAllBinds()
+  .. method:: BPFFilter:attachToAllBinds()
 
-  Attach this filter to every bind already defined.
-  This is the run-time equivalent of :func:`setDefaultBPFFilter`
+    Attach this filter to every bind already defined.
+    This is the run-time equivalent of :func:`setDefaultBPFFilter`
 
-.. classmethod:: BPFFilter:block(address)
+  .. method:: BPFFilter:block(address)
 
-  Block this address
+    Block this address
 
-  :param ComboAddress address: The address to block
+    :param ComboAddress address: The address to block
 
-.. classmethod:: BPFFilter:blockQName(name [, qtype=255])
+  .. method:: BPFFilter:blockQName(name [, qtype=255])
 
-  Block queries for this exact qname. An optional qtype can be used, defaults to 255.
+    Block queries for this exact qname. An optional qtype can be used, defaults to 255.
 
-  :param DNSName name: The name to block
-  :param int qtype: QType to block
+    :param DNSName name: The name to block
+    :param int qtype: QType to block
 
-.. classmethod:: BPFFilter:getStats()
+  .. method:: BPFFilter:getStats()
 
-  Print the block tables.
+    Print the block tables.
 
-.. classmethod:: BPFFilter:unblock(address)
+  .. method:: BPFFilter:purgeExpired()
 
-  Unblock this address.
+    Remove the expired ephemeral rules associated with this filter.
 
-  :param ComboAddress address: The address to unblock
+  .. method:: BPFFilter:unblock(address)
 
-.. classmethod:: BPFFilter:unblockQName(name [, qtype=255])
+    Unblock this address.
 
-  Remove this qname from the block list.
+    :param ComboAddress address: The address to unblock
 
-  :param DNSName name: the name to unblock
-  :param int qtype: The qtype to unblock
+  .. method:: BPFFilter:unblockQName(name [, qtype=255])
 
-.. class:: DynBPFFilter
-
-  Represents an dynamic eBPF filter, allowing the use of ephemeral rules to an existing eBPF filter.
+    Remove this qname from the block list.
 
-.. classmethod:: BPFFilter:purgeExpired()
+    :param DNSName name: the name to unblock
+    :param int qtype: The qtype to unblock
 
-  Remove the expired ephemeral rules associated with this filter.
+.. class:: DynBPFFilter
 
+  Represents an dynamic eBPF filter, allowing the use of ephemeral rules to an existing eBPF filter.
 
index 2453276a1acbcc30f1b4b6f9c5f6b33efea7a0ff..840651a7e2041080f5e34e119bcd6f2fad3bbd4b 100644 (file)
@@ -1,32 +1,32 @@
 NetmaskGroup
 ============
 
-.. class:: NetmaskGroup
-
-   Represents a group of netmasks that can be used to match :class:`ComboAddress`\ es against.
-
 .. function:: newNMG() -> NetmaskGroup
 
   Returns a NetmaskGroup
 
-.. classmethod:: NetmaskGroup:addMask(mask)
-                 NetmaskGroup:addMask(masks)
+.. class:: NetmaskGroup
+
+   Represents a group of netmasks that can be used to match :class:`ComboAddress`\ es against.
+
+  .. method:: NetmaskGroup:addMask(mask)
+              NetmaskGroup:addMask(masks)
 
-  Add one or more masks to the NMG.
+    Add one or more masks to the NMG.
 
-  :param string mask: Add this mask, prefix with `!` to exclude this mask from matching.
-  :param table masks: Adds the keys of the table to the :class:`NetmaskGroup`. It should be a table whose keys are :class:`ComboAddress` objects and values are integers, as returned by `exceed*` functions.
+    :param string mask: Add this mask, prefix with `!` to exclude this mask from matching.
+    :param table masks: Adds the keys of the table to the :class:`NetmaskGroup`. It should be a table whose keys are :class:`ComboAddress` objects and values are integers, as returned by `exceed*` functions.
 
-.. classmethod:: NetmaskGroup:match(address) -> bool
+  .. method:: NetmaskGroup:match(address) -> bool
 
-  Checks if ``address`` is matched by this NetmaskGroup.
+    Checks if ``address`` is matched by this NetmaskGroup.
 
-  :param ComboAddress address: The address to match.
+    :param ComboAddress address: The address to match.
 
-.. classmethod:: NetmaskGroup:clear()
+  .. method:: NetmaskGroup:clear()
 
-  Clears the NetmaskGroup.
+    Clears the NetmaskGroup.
 
-.. classmethod:: NetmaskGroup:size() -> int
+  .. method:: NetmaskGroup:size() -> int
 
-  Returns number of netmasks in this NetmaskGroup.
+    Returns number of netmasks in this NetmaskGroup.
index de53b81bca2fa66c53caf078dcf3ecfd7d6cab63..8f3ee6c00fea991be8b83092a402a50341fb40d2 100644 (file)
@@ -14,107 +14,107 @@ Protobuf Logging Reference
 
   This object represents a single protobuf message as emitted by :program:`dnsdist`.
 
-.. classmethod:: DNSDistProtoBufMessage:addResponseRR(name, type, class, ttl, blob)
+  .. method:: DNSDistProtoBufMessage:addResponseRR(name, type, class, ttl, blob)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Add a response RR to the protobuf message.
+    Add a response RR to the protobuf message.
 
-  :param string name: The RR name.
-  :param int type: The RR type.
-  :param int class: The RR class.
-  :param int ttl: The RR TTL.
-  :param string blob: The RR binary content.
+    :param string name: The RR name.
+    :param int type: The RR type.
+    :param int class: The RR class.
+    :param int ttl: The RR TTL.
+    :param string blob: The RR binary content.
 
-.. classmethod:: DNSDistProtoBufMessage:setBytes(bytes)
+  .. method:: DNSDistProtoBufMessage:setBytes(bytes)
 
-  Set the size of the query
+    Set the size of the query
 
-  :param int bytes: Number of bytes in the query.
+    :param int bytes: Number of bytes in the query.
 
-.. classmethod:: DNSDistProtoBufMessage:setEDNSSubnet(netmask)
+  .. method:: DNSDistProtoBufMessage:setEDNSSubnet(netmask)
 
-  Set the EDNS Subnet to ``netmask``.
+    Set the EDNS Subnet to ``netmask``.
 
-  :param string netmask: The netmask to set to.
+    :param string netmask: The netmask to set to.
 
-.. classmethod:: DNSDistProtoBufMessage:setQueryTime(sec, usec)
+  .. method:: DNSDistProtoBufMessage:setQueryTime(sec, usec)
 
-  In a response message, set the time at which the query has been received.
+    In a response message, set the time at which the query has been received.
 
-  :param int sec: Unix timestamp when the query was received.
-  :param int usec: The microsecond the query was received.
+    :param int sec: Unix timestamp when the query was received.
+    :param int usec: The microsecond the query was received.
 
-.. classmethod:: DNSDistProtoBufMessage:setQuestion(name, qtype, qclass)
+  .. method:: DNSDistProtoBufMessage:setQuestion(name, qtype, qclass)
 
-  Set the question in the protobuf message.
+    Set the question in the protobuf message.
 
-  :param DNSName name: The qname of the question
-  :param int qtype: The qtype of the question
-  :param int qclass: The qclass of the question
+    :param DNSName name: The qname of the question
+    :param int qtype: The qtype of the question
+    :param int qclass: The qclass of the question
 
-.. classmethod:: DNSDistProtoBufMessage:setProtobufResponseType(sec, usec)
+  .. method:: DNSDistProtoBufMessage:setProtobufResponseType(sec, usec)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Change the protobuf response type from a query to a response, and optionally set the query time.
+    Change the protobuf response type from a query to a response, and optionally set the query time.
 
-  :param int sec: Optional query time in seconds.
-  :param int usec: Optional query time in additional micro-seconds.
+    :param int sec: Optional query time in seconds.
+    :param int usec: Optional query time in additional micro-seconds.
 
-.. classmethod:: DNSDistProtoBufMessage:setRequestor(address)
+  .. method:: DNSDistProtoBufMessage:setRequestor(address)
 
-  Set the requestor's address.
+    Set the requestor's address.
 
-  :param ComboAddress address: The address to set to
+    :param ComboAddress address: The address to set to
 
-.. classmethod:: DNSDistProtoBufMessage:setRequestorFromString(address)
+  .. method:: DNSDistProtoBufMessage:setRequestorFromString(address)
 
-  Set the requestor's address from a string.
+    Set the requestor's address from a string.
 
-  :param string address: The address to set to
+    :param string address: The address to set to
 
-.. classmethod:: DNSDistProtoBufMessage:setResponder(address)
+  .. method:: DNSDistProtoBufMessage:setResponder(address)
 
-  Set the responder's address.
+    Set the responder's address.
 
-  :param ComboAddress address: The address to set to
+    :param ComboAddress address: The address to set to
 
-.. classmethod:: DNSDistProtoBufMessage:setResponderFromString(string)
+  .. method:: DNSDistProtoBufMessage:setResponderFromString(string)
 
-  Set the responder's address.
+    Set the responder's address.
 
-  :param string address: The address to set to
+    :param string address: The address to set to
 
-.. classmethod:: DNSDistProtoBufMessage:setResponseCode(rcode)
+  .. method:: DNSDistProtoBufMessage:setResponseCode(rcode)
 
-  Set the response code of the query.
+    Set the response code of the query.
 
-  :param int rcode: The response code of the answer
+    :param int rcode: The response code of the answer
 
-.. classmethod:: DNSDistProtoBufMessage:setTag(value)
+  .. method:: DNSDistProtoBufMessage:setTag(value)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Add a tag to the list of tags.
+    Add a tag to the list of tags.
 
-  :param string value: The tag value
+    :param string value: The tag value
 
-.. classmethod:: DNSDistProtoBufMessage:setTagArray(valueList)
+  .. method:: DNSDistProtoBufMessage:setTagArray(valueList)
 
-  .. versionadded:: 1.2.0
+    .. versionadded:: 1.2.0
 
-  Add a list of tags.
+    Add a list of tags.
 
-  :param table tags: A list of tags as strings
+    :param table tags: A list of tags as strings
 
-.. classmethod:: DNSDistProtoBufMessage:setTime(sec, usec)
+  .. method:: DNSDistProtoBufMessage:setTime(sec, usec)
 
-  Set the time at which the query or response has been received.
+    Set the time at which the query or response has been received.
 
-  :param int sec: Unix timestamp when the query was received.
-  :param int usec: The microsecond the query was received.
+    :param int sec: Unix timestamp when the query was received.
+    :param int usec: The microsecond the query was received.
 
-.. classmethod:: DNSDistProtoBufMessage:toDebugString() -> string
+  .. method:: DNSDistProtoBufMessage:toDebugString() -> string
 
-  Return an string containing the content of the message
+    Return an string containing the content of the message