loglevel: 6
Take care when listing IPv6 addresses, as characters used for these are special to YAML.
-If in doubt, quote any string containing ``:``, ``[`` or ``]`` and use (online) tools to check your YAML syntax.
+If in doubt, quote any string containing ``:``, ``!``, ``[`` or ``]`` and use (online) tools to check your YAML syntax.
Specify an empty sequence using ``[]``.
The main setting file is called ``recursor.yml`` and will be processed first.
allow_from:
- '2001:DB8::/32'
- 128.66.0.0/16
- - !128.66.1.2
+ - '!128.66.1.2'
In this case the address ``128.66.1.2`` is excluded from the addresses allowed access.
return '(empty)'
if typ == LType.String:
return '``' + val + '``'
- if val == '':
- return '``[]``'
- return '``[' + val + ']``'
+ parts = re.split('[ \t,]+', val)
+ if len(parts) > 0:
+ ret = ''
+ for part in parts:
+ if part == '':
+ continue
+ if ret != '':
+ ret += ', '
+ if ':' in part or '!' in part:
+ ret += "'" + part + "'"
+ else:
+ ret += part
+ else:
+ ret = ''
+ return '``[' + ret + ']``'
def get_rust_type(typ):
"""Determine which Rust type is used for a logical type"""