Skip to content
Snippets Groups Projects
Commit 57d61757 authored by Oto Šťáva's avatar Oto Šťáva
Browse files

modules/policy: deduplicate doc

parent ee8993bd
Branches
Tags
1 merge request!1228modules/policy: add 'domain' filter for equality matching
Pipeline #91110 failed with stages
in 36 minutes and 17 seconds
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment