]> mj.ucw.cz Git - nsc-5.git/blobdiff - m4/dnslib.m4
Preparing for release of version 4.0
[nsc-5.git] / m4 / dnslib.m4
index 8049ee7793a62c0f9b668c127a07f5987562e93b..6cdb921c95b2c355eb4207b3fa7b541fe9563128 100644 (file)
@@ -1,12 +1,12 @@
 dnl ###
-dnl ### NSC 3.0 -- Library Functions For DNS Processing
-dnl ### (c) 1997--2003 Martin Mares <mj@ucw.cz>
+dnl ### NSC -- Library Functions For DNS Processing
+dnl ### (c) 1997--2011 Martin Mares <mj@ucw.cz>
 dnl ###
 divert(-1)
 
 # NSC version
 
-define(`NSCVER', `NSC 2.99a')
+define(`NSCVER', `NSC 3.1')
 
 # Current date and time
 
@@ -19,6 +19,10 @@ define(MINUTES, `eval($1*60)')
 define(HOURS, `eval($1*3600)')
 define(DAYS, `eval($1*86400)')
 
+# Since slashes can occur in zone names, we convert them to @'s
+
+define(nsc_file_name, `translit($1,/,@)')
+
 # Reverse an IP address
 
 define(nsc_revIPa, `ifelse($#, 1, `$1', `nsc_revIPa(shift($@)).$1')')
@@ -33,8 +37,7 @@ define(nsc_corr_dot, `ifelse(substr($1,decr(len($1))),.,$1,$1`'ifelse(index($1,.
 
 define(nsc_if_v6, `ifelse(index($1,:),-1,`$3',`$2')')
 
-define(nsc_norm_v6, `nsc_norm_v6_z(dnl
-ifelse(regexp($1,`::.*::'),-1,`ifelse(index($1,::),-1,`nsc_norm_v6_nn($1)',`nsc_norm_v6_cc($1)')',`nsc_bad_v6($1)'))')
+define(nsc_norm_v6, `nsc_norm_v6_z(ifelse(regexp($1,`::.*::'),-1,`ifelse(index($1,::),-1,`nsc_norm_v6_nn($1)',`nsc_norm_v6_cc($1)')',`nsc_bad_v6($1)'))')
 # If there is no ::, check the number of :'s
 define(nsc_norm_v6_nn, `ifelse(nsc_extract_colons($1),:::::::,$1,`nsc_bad_v6($1)')')
 # Replace :: by the right number of :'s to get 8 (possibly empty) components
@@ -80,17 +83,16 @@ define(`nsc__forloop',
 define(`nsc_fatal_error', `errprint(`NSC error: $1
 ')m4exit(1)')
 
-# Default values of parameters and user configuration
+# Default values of parameters
 
 define(`NAMED_RESTART_CMD', `ndc reload')
 
-define(`BIND_OPTIONS', `       # Other options can be added here via macro BIND_OPTIONS')
-
 define(`ROOT', `/etc/named')
 define(`CFDIR', `cf')
 define(`ZONEDIR', `zone')
 define(`BAKDIR', `bak')
 define(`VERSDIR', `ver')
+define(`HASHDIR', `hash')
 define(`ROOTCACHE', `root.cache')
 
 define(`REFRESH', HOURS(8))
@@ -101,4 +103,10 @@ define(`NSNAME', translit(esyscmd(`hostname -f'),`
 ',`'))
 define(`MAINTNAME', `root'.`nsc_corr_dot(NSNAME)')
 
+# And finally we change comments to semicolons to be compatible with the zone files
+
+changecom(;)
+
+; User-defined parts of configuration
+
 include(CFDIR/config)