From 57d61757563ba7d71e5d2d83f96cf7170b163598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oto=20=C5=A0=C5=A5=C3=A1va?= <oto.stava@gmail.com> Date: Fri, 19 Nov 2021 14:44:44 +0100 Subject: [PATCH] modules/policy: deduplicate doc --- modules/policy/README.rst | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/policy/README.rst b/modules/policy/README.rst index 3260b27f8..1d87b4887 100644 --- a/modules/policy/README.rst +++ b/modules/policy/README.rst @@ -28,16 +28,6 @@ A *filter* selects which queries will be affected by specified Actions_. There a Always applies the action. -.. function:: domains(action, domain_table) - - Applies the action if query name matches one the domains in the table. - -.. note:: For speed this filter requires domain names in the DNS wire format, not textual representation, so each label in the name must be prefixed with its length. Always use convenience function :func:`policy.todnames` for automatic conversion from a string! For example: - - .. code-block:: lua - - policy.add(policy.domains(policy.DENY, policy.todnames({'example.com', 'example.net'}))) - .. function:: pattern(action, pattern) Applies the action if query name matches a `Lua regular expression <http://lua-users.org/wiki/PatternsTutorial>`_. @@ -52,6 +42,10 @@ A *filter* selects which queries will be affected by specified Actions_. There a policy.add(policy.suffix(policy.DENY, policy.todnames({'example.com', 'example.net'}))) +.. function:: domains(action, domain_table) + + Like :func:`policy.suffix` match, but the queried name must match exactly, not just its suffix. + .. function:: suffix_common(action, suffix_table[, common_suffix]) :param action: action if the pattern matches query name -- GitLab