From: bert hubert Date: Fri, 26 Dec 2014 21:17:25 +0000 (+0100) Subject: add create-zone, load-zone and list-zone to pdnssec X-Git-Tag: rec-3.7.0-rc1~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9865bc5188996d73f8a807c49a4387cfd17cf32;p=thirdparty%2Fpdns.git add create-zone, load-zone and list-zone to pdnssec --- diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 780c7830c4..4638e38f6b 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -703,6 +703,82 @@ int deleteZone(const string &zone) { return 1; } +int listZone(const string &zone) { + UeberBackend B; + DomainInfo di; + + if (! B.getDomainInfo(zone, di)) { + cerr<<"Domain '"<list(zone, di.id); + DNSResourceRecord rr; + while(di.backend->get(rr)) { + if(rr.qtype.getCode()) { + if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::CNAME) && !rr.content.empty() && rr.content[rr.content.size()-1] != '.') + rr.content.append(1, '.'); + + cout<startTransaction(zone, di.id)) { + cerr<<"Unable to start transaction for load of zone '"<feedRecord(rr); + } + db->commitTransaction(); + return 0; +} + +int createZone(const string &zone) { + UeberBackend B; + DomainInfo di; + if (B.getDomainInfo(zone, di)) { + cerr<<"Domain '"<