.. attribute:: DNSQuestion.qclass
QClass (as an unsigned integer) of this question.
- Can be compared against :ref:`DNSQClass`.
+ Can be compared against :ref:`DNSClass`.
.. attribute:: DNSQuestion.qname
.. attribute:: DNSQuestion.qtype
QType (as an unsigned integer) of this question.
- Can be compared against ``dnsdist.A``, ``dnsdist.AAAA`` etc.
+ Can be compared against the pre-defined :ref:`constants <DNSQType>` like ``DNSQType.A``, DNSQType.AAAA``.
.. attribute:: DNSQuestion.remoteaddr
.. method:: DNSQuestion:getEDNSOptions() -> table
- .. versionadded:: 1.3.1
+ .. versionadded:: 1.3.3
Return the list of EDNS Options, if any.
:returns: A table of EDNSOptionView objects, indexed on the ECS Option code
+ .. method:: DNSQuestion:getServerNameIndication() -> string
+
+ .. versionadded:: 1.4.0
+
+ Return the TLS Server Name Indication (SNI) value sent by the client over DoT or DoH, if any. See :func:`SNIRule`
+ for more information, especially about the availability of SNI over DoH.
+
+ :returns: A string containing the TLS SNI value, if any
+
.. method:: DNSQuestion:getTag(key) -> string
.. versionadded:: 1.2.0
:returns: A table of tags, using strings as keys and values
+ .. method:: DNSQuestion:getTrailingData() -> string
+
+ .. versionadded:: 1.4.0
+
+ Get all data following the DNS message.
+
+ :returns: The trailing data as a null-safe string
+
.. method:: DNSQuestion:sendTrap(reason)
.. versionadded:: 1.2.0
:param table tags: A table of tags, using strings as keys and values
+ .. method:: DNSQuestion:setTrailingData(tail) -> bool
+
+ .. versionadded:: 1.4.0
+
+ Set the data following the DNS message, overwriting anything already present.
+
+ :param string tail: The new data
+ :returns: true if the operation succeeded, false otherwise
+
.. _DNSResponse:
DNSResponse object
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.
+ - ``qclass`` is the QClass of the record. Can be compared to :ref:`DNSClass`
+ - ``qtype`` is the QType of the record. Can be e.g. compared to ``DNSQType.A``, ``DNSQType.AAAA`` :ref:`constants <DNSQType>` and the like.
- ``ttl`` is the current TTL
This function must return an integer with the new TTL.
.. class:: EDNSOptionView
- .. versionadded:: 1.3.1
+ .. versionadded:: 1.3.3
An object that represents the values of a single EDNS option received in a query.
- .. attribute:: EDNSOptionView.count -> int
+ .. method:: EDNSOptionView:count()
The number of values for this EDNS option.