Changeset 1648 for trunk/pdns/pdns/pdnssec.cc
- Timestamp:
- 06/19/10 15:20:30 (3 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/pdnssec.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdnssec.cc
r1645 r1648 63 63 ::arg().laxFile(configname.c_str()); 64 64 65 66 65 BackendMakers().launch(::arg()["launch"]); // vrooooom! 67 66 ::arg().laxFile(configname.c_str()); 68 cerr<<::arg()["launch"]<<", '" << ::arg()["gmysql-dbname"] <<"'" <<endl; 69 67 cerr<<"Backend: "<<::arg()["launch"]<<", '" << ::arg()["gmysql-dbname"] <<"'" <<endl; 70 68 71 69 S.declare("qsize-q","Number of questions waiting for database attention"); … … 132 130 } 133 131 132 void checkZone(DNSSECKeeper& dk, const std::string& zone) 133 { 134 loadMainConfig(); 135 reportAllTypes(); 136 UeberBackend* B = new UeberBackend("default"); 137 SOAData sd; 138 139 if(!B->getSOA(zone, sd)) { 140 cerr<<"No SOA!"<<endl; 141 return; 142 } 143 cerr<<"ID: "<<sd.domain_id<<endl; 144 sd.db->list(zone, sd.domain_id); 145 DNSResourceRecord rr; 146 uint64_t numrecords=0, numerrors=0; 147 148 while(sd.db->get(rr)) { 149 if(rr.qtype.getCode() == QType::MX) 150 rr.content = lexical_cast<string>(rr.priority)+" "+rr.content; 151 152 try { 153 shared_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(rr.qtype.getCode(), 1, rr.content)); 154 string tmp=drc->serialize(rr.qname); 155 } 156 catch(std::exception& e) 157 { 158 cerr<<"Following record had a problem: "<<rr.qname<<" IN " <<rr.qtype.getName()<< " " << rr.content<<endl; 159 cerr<<"Error was: "<<e.what()<<endl; 160 numerrors++; 161 } 162 numrecords++; 163 } 164 cerr<<"Checked "<<numrecords<<" records, "<<numerrors<<" errors"<<endl; 165 166 167 } 168 169 134 170 int main(int argc, char** argv) 135 171 try … … 167 203 } 168 204 orderZone(dk, cmds[1]); 205 } 206 if(cmds[0] == "check-zone") { 207 if(cmds.size() != 2) { 208 cerr << "Error: "<<cmds[0]<<" takes exactly 1 parameter"<<endl; 209 return 0; 210 } 211 checkZone(dk, cmds[1]); 169 212 } 170 213 else if(cmds[0] == "update-zone-keys") {