[Pdns-users] pdns.conf comment suggestion/idea
Roderick Groesbeek
powerdns at roderick.triple-it.nl
Wed Mar 17 14:19:55 UTC 2004
Or just implement an easy strip after '#' to the '\' or '\n'.
Vriendelijke Groet,
Roderick
--
Pettemerstraat 12A T r I p l e
1823 CW Alkmaar T
Tel. +31 (0)72-5129516
fax. +31 (0)72-5129520 Automatisering
www.triple-it.nl "Laat uw Net Werken!"
----- Original Message -----
From: "Roderick Groesbeek" <powerdns at roderick.triple-it.nl>
To: <pdns-users at mailman.powerdns.com>
Sent: Wednesday, March 17, 2004 2:53 PM
Subject: [Pdns-users] pdns.conf comment suggestion/idea
> Howdy,
>
> Info:
> ===
> I'm converting our main dns (bind) server to PowerDNS.
> And in the named.conf we have documented our AXFR enabled IP as follows:
>
> Bind Config:
> =========
> allow-transfer {
> .....
> 193.176.144/24; //
> domain-registry.nl
> 194.53.253/24; //
> domain-registry.nl
> 193.176.144.128/28; //
> domain-registry.nl
> ....
> };
>
>
> Now I tried to replicate that commented configuration in the pdns.conf.
> Placing '#' skips until end-of-line, so NO GO..
>
> As it seems, there is no way to place commented multi-line configuration
> in PDNS yet.
>
> I would like to suggest following pdns.conf comment style.
>
> PDNS Config:
> ==========
> allow-axfr-ips= 193.176.144/24, // domain-registry.nl \
> 194.53.253/24, // domain-registry.nl \
> 193.176.144.128/28, // domain-registry.nl \
>
> In short "multiple line configuration parameters with inline comment".
>
> Some quick typed example code that would probably implement the
> desired behaviour..
> ~~
> while(getline(f,pline)) {
> chomp(pline," \t\r\n"); // strip trailing white spaces
>
> if(pline[pline.size()-1]=='\\') {
> string::size_type posc;
> if ((posc=pline.find("//"))!=string::npos) // Inline comment
> line+=pline.substr(0,posc-1); // Skip comment
> else
> line+=pline.substr(0,pline.length()-1);
>
> chomp(line," \t"); // Skip trailing
> spaces
> if((pos=line.find_first_not_of(" \t"))!=string::npos) // Skip
leading
> spaces
> line=line.substr(pos);
> ~~
> [untested]
>
>
> But maybe it should be nicely commented with '/* */', etc..
>
> Anyway a multiline commented configuration parsing style sounds like a
nice
> feature.
> What do you guys (& ladies) think?
>
>
> Vriendelijke Groet,
>
> Roderick
> --
> Pettemerstraat 12A T r I p l e
> 1823 CW Alkmaar T
> Tel. +31 (0)72-5129516
> fax. +31 (0)72-5129520 Automatisering
> www.triple-it.nl "Laat uw Net Werken!"
>
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users
>
More information about the Pdns-users
mailing list