chiark / gitweb /
config.m4: Fix the nameservers following network renumbering.
[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
6fc3a0c6 30m4_ifelse($][2,,,m4_dnl
2ff79b43 31m4_ifelse($1,@,$][1,$][1.$1) IN A $][2
6fc3a0c6
MW
32)m4_dnl
33m4_ifelse($][3,,,m4_dnl
34m4_ifelse($1,@,$][1,$][1.$1) IN AAAA $][3
35)m4_dnl
2ff79b43
MW
36], [NAMESERVERS])
37FOREACH([m4_dnl
38$1 IN NS m4_ifelse($1,@,$][1,$][1.$1)
39], [NAMESERVERS])])
40
41###--------------------------------------------------------------------------
42### Configuration.
43
44m4_define([CONTACT], [hostmaster.BASE])
c9445367 45m4_define([BLACKHOLE], [[A, 212.13.198.78], [AAAA, 2001:ba8:0:1d9::ffff]])
2ff79b43
MW
46m4_include([config.m4])
47
48###----- That's all, folks --------------------------------------------------
49m4_divert(0)m4_dnl