]> mj.ucw.cz Git - nsc-5.git/blob - m4/mkconf.m4
Added the FORWARDING macro.
[nsc-5.git] / m4 / mkconf.m4
1 dnl ###
2 dnl ### NSC -- BIND Config File Builder
3 dnl ### (c) 1997--2006 Martin Mares <mj@ucw.cz>
4 dnl ###
5 include(m4/dnslib.m4)
6
7 # Definition of primary domains
8
9 define(`DO_PRIMARY', `divert(0)zone "$1" in {
10         type master;
11         file "ZONEDIR/nsc_file_name($2)";
12 ZZ_OPTIONS()dnl
13 };
14
15 divert(-1)')
16
17 define(`PRIMARY', `DO_PRIMARY($1,$1)')
18 define(`REVERSE', `DO_PRIMARY(REV($1),nsc_if_v6($1,`nsc_revblock6($1)',`nsc_revaddr($1)'))')
19
20 # Definition of secondary domain
21
22 define(`SECONDARY', `divert(0)zone "$1" in {
23         type slave;
24         file "BAKDIR/nsc_file_name($1)";
25         masters { $2; };
26 ZZ_OPTIONS()dnl
27 };
28
29 divert(-1)')
30
31 # Definition of forwarders for both normal and slave mode
32
33 define(`FORWard', `patsubst(`$*',`,',`; ')')
34 define(`FORWArd', `     forward $1;
35         forwarders { FORWard(shift($@),)};
36 ')
37
38 define(`FORWARD', `FORWArd(first, $@)')
39 define(`SLAVE', `FORWArd(only, $@)')
40
41 divert(-1)')
42
43 # Definition of a forwarding zone
44
45 define(`FORWARDING', `divert(0)zone "$1" in {
46         type forward;
47         forward only;
48         forwarders { FORWard(shift($@),)};
49 ZZ_OPTIONS()dnl
50 };
51
52 divert(-1)')
53
54 # Manual insertion of config file material
55
56 define(`CONFIG', `divert(0)$1
57 divert(-1)')
58
59 # Setting domain options
60
61 define(`ZZ_OPTIONS', `')
62
63 define(`ZONE_OPTIONS', `define(`ZZ_OPTIONS', ifelse(`$1',`',`',``       $1''))')
64
65 # The preamble
66
67 divert(0)dnl
68 `#'
69 `#'     BIND configuration file
70 `#'     Generated by NSCVER (mkconf.m4) on CURRENT_DATE
71 `#'     Please don't edit manually
72 `#'
73
74 options {
75         directory "ROOT";
76         interface-interval 0;
77 BIND_OPTIONS
78 };
79
80 zone "." in {
81         type hint;
82         file "ROOTCACHE";
83 };
84
85 divert(-1)