File: view_macros.lua.j2

package info (click to toggle)
knot-resolver 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,392 kB
  • sloc: javascript: 42,732; ansic: 40,312; python: 12,616; cpp: 2,121; sh: 1,997; xml: 193; makefile: 181
file content (28 lines) | stat: -rw-r--r-- 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{%- macro get_proto_set(protocols) -%}
0
{%- for p in protocols or [] -%}
 + 2^C.KR_PROTO_{{ p.upper() }}
{%- endfor -%}
{%- endmacro -%}

{% macro view_flags(options) -%}
{% if not options.minimize -%}
"NO_MINIMIZE",
{%- endif %}
{% if not options.dns64 -%}
"DNS64_DISABLE",
{%- endif %}
{% if not options.fallback -%}
"FALLBACK_DISABLE",
{%- endif %}
{%- endmacro %}

{% macro view_answer(answer) -%}
{%- if answer == 'allow' -%}
policy.TAGS_ASSIGN({})
{%- elif answer == 'refused' -%}
'policy.REFUSE'
{%- elif answer == 'noanswer' -%}
'policy.NO_ANSWER'
{%- endif -%}
{%- endmacro %}