2 PowerDNS Versatile Database Driven Nameserver
3 Copyright (C) 2005 - 2007 PowerDNS.COM BV
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2
7 as published by the Free Software Foundation
9 Additionally, the license of this program contains a special
10 exception which allows to distribute the program in binary form when
11 it is linked against OpenSSL.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef PDNS_ZONEPARSER_TNG
24 #define PDNS_ZONEPARSER_TNG
30 #include "namespaces.hh"
35 ZoneParserTNG(const string& fname, const string& zname="", const string& reldir="");
38 bool get(DNSResourceRecord& rr, std::string* comment=0);
39 typedef runtime_error exception;
40 typedef deque<pair<string::size_type, string::size_type> > parts_t;
43 bool getTemplateLine();
44 void stackFile(const std::string& fname);
45 unsigned makeTTLFromZone(const std::string& str);
46 string getLineOfFile();
53 uint32_t d_templatecounter, d_templatestop, d_templatestep;
54 string d_templateline;
55 parts_t d_templateparts;
58 filestate(FILE* fp, string filename) : d_fp(fp), d_filename(filename), d_lineno(0){}
63 std::stack<filestate> d_filestates;