chiark / gitweb /
dnserr.in: IPv6 records for the invalid signature entries.
[dnserr] / utils.m4
CommitLineData
2ff79b43
MW
1m4_divert(-1) ### -*-m4-*-
2###
3### Definitions for generating zone files.
4
5m4_changequote([, ])
6
7###--------------------------------------------------------------------------
8### Utilities.
9
10## FOREACH(what, list)
11##
12## The LIST is a comma-separated list of things, like an m4 argument list.
13## For each item in the list, expand WHAT as if it's the body of a macro with
14## the list item as its arguments. In other words, the list item itself can
15## be a list of comma-separated items, which are available as $1, $2, ...,
16## within WHAT.
17m4_define([_FOREACH], [m4_dnl
18m4_ifelse([$#], [1], [_foreach_func($1)],
19 [_foreach_func($1)[]_FOREACH(m4_shift($@))])])
20m4_define([FOREACH], [m4_dnl
21m4_pushdef([_foreach_func], [$1])m4_dnl
22_FOREACH($2)[]m4_dnl
23m4_popdef([_foreach_func])])
24
25## SUBZONE(name)
26##
27## Delegate NAME to the NAMESERVERS.
28m4_define([SUBZONE], [m4_dnl
29FOREACH([m4_dnl
30m4_ifelse($1,@,$][1,$][1.$1) IN A $][2
31], [NAMESERVERS])
32FOREACH([m4_dnl
33$1 IN NS m4_ifelse($1,@,$][1,$][1.$1)
34], [NAMESERVERS])])
35
36###--------------------------------------------------------------------------
37### Configuration.
38
39m4_define([CONTACT], [hostmaster.BASE])
40m4_define([BLACKHOLE], [212.13.198.78])
41m4_include([config.m4])
42
43###----- That's all, folks --------------------------------------------------
44m4_divert(0)m4_dnl