X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=m4%2Fdnslib.m4;h=3e796a3ac91ddb9cbd74e73d10e97f6c2943a2e7;hb=abba601e7ce2f365b25c8cb16ea01cc014af65c3;hp=8049ee7793a62c0f9b668c127a07f5987562e93b;hpb=ad59bf15d0e8a781477a25f69b97f7d4c9eb0e00;p=nsc-5.git diff --git a/m4/dnslib.m4 b/m4/dnslib.m4 index 8049ee7..3e796a3 100644 --- a/m4/dnslib.m4 +++ b/m4/dnslib.m4 @@ -1,12 +1,12 @@ dnl ### -dnl ### NSC 3.0 -- Library Functions For DNS Processing -dnl ### (c) 1997--2003 Martin Mares +dnl ### NSC -- Library Functions For DNS Processing +dnl ### (c) 1997--2008 Martin Mares 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,11 +83,11 @@ 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(`BIND_OPTIONS', ` # Other options can be added here via macro `BIND_OPTIONS'') define(`ROOT', `/etc/named') define(`CFDIR', `cf') @@ -101,4 +104,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)