config.m4: Fix the nameservers following network renumbering.
[dnserr] / utils.m4
1 m4_divert(-1) ### -*-m4-*-
2 ###
3 ### Definitions for generating zone files.
4
5 m4_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.
17 m4_define([_FOREACH], [m4_dnl
18 m4_ifelse([$#], [1], [_foreach_func($1)],
19 [_foreach_func($1)[]_FOREACH(m4_shift($@))])])
20 m4_define([FOREACH], [m4_dnl
21 m4_pushdef([_foreach_func], [$1])m4_dnl
22 _FOREACH($2)[]m4_dnl
23 m4_popdef([_foreach_func])])
24
25 ## SUBZONE(name)
26 ##
27 ## Delegate NAME to the NAMESERVERS.
28 m4_define([SUBZONE], [m4_dnl
29 FOREACH([m4_dnl
30 m4_ifelse($][2,,,m4_dnl
31 m4_ifelse($1,@,$][1,$][1.$1) IN A $][2
32 )m4_dnl
33 m4_ifelse($][3,,,m4_dnl
34 m4_ifelse($1,@,$][1,$][1.$1) IN AAAA $][3
35 )m4_dnl
36 ], [NAMESERVERS])
37 FOREACH([m4_dnl
38 $1 IN NS m4_ifelse($1,@,$][1,$][1.$1)
39 ], [NAMESERVERS])])
40
41 ###--------------------------------------------------------------------------
42 ### Configuration.
43
44 m4_define([CONTACT], [hostmaster.BASE])
45 m4_define([BLACKHOLE], [[A, 212.13.198.78], [AAAA, 2001:ba8:0:1d9::ffff]])
46 m4_include([config.m4])
47
48 ###----- That's all, folks --------------------------------------------------
49 m4_divert(0)m4_dnl