Author: hannes
Date: Wed Aug 31 01:41:36 2005
New Revision: 9937
Modified:
trunk/libraries/koala/sources/examples/buddha/config.dylan
trunk/libraries/koala/sources/examples/buddha/zone.dylan
Log:
Bug: 7257
added print-{bind|tinydns}-zone-file for <config>
generate ptr and a records seperately
Modified: trunk/libraries/koala/sources/examples/buddha/config.dylan
==============================================================================
--- trunk/libraries/koala/sources/examples/buddha/config.dylan (original)
+++ trunk/libraries/koala/sources/examples/buddha/config.dylan Wed Aug 31
01:41:36 2005
@@ -95,3 +95,20 @@
=> ()
config.config-nets := remove!(config.config-nets, network);
end;
+
+define method print-bind-zone-file
+ (config :: <config>, stream :: <stream>)
+ => ()
+ //we need to print dhcpd.conf file here
+ for (zone in config.config-zones)
+ print-bind-zone-file(zone, stream)
+ end;
+end;
+
+define method print-tinydns-zone-file
+ (config :: <config>, stream :: <stream>)
+ => ()
+ for (zone in config.config-zones)
+ print-tinydns-zone-file(zone, stream)
+ end;
+end;
Modified: trunk/libraries/koala/sources/examples/buddha/zone.dylan
==============================================================================
--- trunk/libraries/koala/sources/examples/buddha/zone.dylan (original)
+++ trunk/libraries/koala/sources/examples/buddha/zone.dylan Wed Aug 31
01:41:36 2005
@@ -66,26 +66,33 @@
end;
define method print-tinydns-zone-file (zone :: <zone>, stream :: <stream>)
- unless(zone.zone-reverse?)
- //Zfqdn:mname:rname:ser:ref:ret:exp:min:ttl:timestamp:lo
- format(stream, "Z%s:%s:%s:%d:%d:%d:%d:%d:%d\n",
- zone.zone-name, zone.zone-nameserver[0],
- zone.zone-hostmaster, zone.zone-serial,
- zone.zone-refresh, zone.zone-retry,
- zone.zone-expire, zone.zone-minimum,
- zone.zone-time-to-live);
- //nameserver
+ //Zfqdn:mname:rname:ser:ref:ret:exp:min:ttl:timestamp:lo
+ format(stream, "Z%s:%s:%s:%d:%d:%d:%d:%d:%d\n",
+ zone.zone-name, zone.zone-nameserver[0],
+ zone.zone-hostmaster, zone.zone-serial,
+ zone.zone-refresh, zone.zone-retry,
+ zone.zone-expire, zone.zone-minimum,
+ zone.zone-time-to-live);
+ //nameserver
+ do(method(x)
+ format(stream, "&%s::%s\n", zone.zone-name, x)
+ end, zone.zone-nameserver);
+ if (zone.zone-reverse?)
+ //PTR
do(method(x)
- format(stream, "&%s::%s\n", zone.zone-name, x)
- end, zone.zone-nameserver);
+ format(stream, "^%s:%s\n",
+ x.host-name,
+ ip-address-to-string(x.host-ipv4-address));
+ end, zone.zone-hosts);
+ else
//MX
do(method(x)
format(stream, "@%s::%s:%d\n",
zone.zone-name, tail(x), head(x));
end, zone.zone-mail-exchange);
- //A, PTR
+ //A
do(method(x)
- format(stream, "=%s:%s\n",
+ format(stream, "+%s:%s\n",
x.host-name,
ip-address-to-string(x.host-ipv4-address));
end, zone.zone-hosts);
--
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
https://gauss.gwydiondylan.org/mailman/listinfo/gd-chatter
|