#include "pdns/dnssecinfra.hh"
#include <boost/algorithm/string.hpp>
#include <sstream>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/scoped_ptr.hpp>
vector<string> masters;
stringtok(masters, d_result[0][0], " ,\t");
- BOOST_FOREACH(const string master, masters) {
+ for(const auto& master: masters) {
const ComboAddress caMaster(master);
if(ip == caMaster.toString())
return true;
}
else
{
- for(auto &qname: erase) {
+ for(const auto& qname: erase) {
try {
d_deleteEmptyNonTerminalQuery_stmt->
bind("domain_id", domain_id)->
}
}
- for(auto &qname: insert) {
+ for(const auto& qname: insert) {
try {
d_insertEmptyNonTerminalQuery_stmt->
bind("domain_id", domain_id)->
KeyData kd;
while(d_ListDomainKeysQuery_stmt->hasNextRow()) {
d_ListDomainKeysQuery_stmt->nextRow(row);
- //~ BOOST_FOREACH(const std::string& val, row) {
+ //~ for(const auto& val: row) {
//~ cerr<<"'"<<val<<"'"<<endl;
//~ }
kd.id = atoi(row[0].c_str());
{
vector<string> meta;
getDomainMetadata(domain, "ALSO-NOTIFY", meta);
- BOOST_FOREACH(string& str, meta) {
+ for(const auto& str: meta) {
ips->insert(str);
}
}
execute()->
reset();
if(!meta.empty()) {
- BOOST_FOREACH(const std::string & value, meta) {
+ for(const auto& value: meta) {
d_SetDomainMetadataQuery_stmt->
bind("kind", kind)->
bind("content", value)->
if (!d_result.empty()) {
// collect all IP addresses
vector<string> tmp;
- BOOST_FOREACH(SSqlStatement::row_t& row, d_result) {
+ for(const auto& row: d_result) {
if (account == row[1])
tmp.push_back(row[0]);
}
throw PDNSException("GSQLBackend unable to delete comment: "+e.txtReason());
}
}
- BOOST_FOREACH(const DNSResourceRecord& rr, rrset) {
+ for(const auto& rr: rrset) {
feedRecord(rr);
}
bool GSQLBackend::feedEnts(int domain_id, map<DNSName,bool>& nonterm)
{
- string query;
- pair<DNSName,bool> nt;
-
- BOOST_FOREACH(nt, nonterm) {
+ for(const auto& nt: nonterm) {
try {
d_InsertEntQuery_stmt->
bind("domain_id",domain_id)->
bind("qname", nt.first)->
bind("auth",(nt.second || !d_dnssecQueries))->
execute()->
- reset();
+ reset();
}
catch (SSqlException &e) {
throw PDNSException("GSQLBackend unable to feed empty non-terminal: "+e.txtReason());
return false;
string ordername;
- pair<DNSName,bool> nt;
- BOOST_FOREACH(nt, nonterm) {
+ for(const auto& nt: nonterm) {
try {
if(narrow || !nt.second) {
d_InsertEntQuery_stmt->
throw PDNSException("GSQLBackend unable to delete comment: "+e.txtReason());
}
- BOOST_FOREACH(const Comment& comment, comments) {
+ for(const auto& comment: comments) {
feedComment(comment);
}
while(stmt->hasNextRow()) {
stmt->nextRow(row);
- for(const auto &col: row)
+ for(const auto& col: row)
out<<"\'"<<col<<"\'\t";
out<<endl;
}
#include <string>
#include <sys/types.h>
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include "dnssecinfra.hh"
#include "dnsseckeeper.hh"
#include "dns.hh"
DNSSECPrivateKey dpk;
DNSSECKeeper::keyset_t keyset = d_dk.getKeys(p->qdomain);
- BOOST_FOREACH(DNSSECKeeper::keyset_t::value_type value, keyset) {
+ for(const auto& value: keyset) {
rr.qtype=QType::DNSKEY;
rr.ttl=sd.default_ttl;
rr.qname=p->qdomain;
// check if the returned records are NS records
bool haveNS=false;
- BOOST_FOREACH(const DNSResourceRecord& ns, nsset) {
+ for(const auto& ns: nsset) {
if(ns.qtype.getCode()==QType::NS)
haveNS=true;
}
DNSBackend *db;
if(!B.superMasterBackend(p->getRemote(), p->qdomain, nsset, &nameserver, &account, &db)) {
L<<Logger::Error<<"Unable to find backend willing to host "<<p->qdomain<<" for potential supermaster "<<p->getRemote()<<". Remote nameservers: "<<endl;
- BOOST_FOREACH(class DNSResourceRecord& rr, nsset) {
+ for(const auto& rr: nsset) {
if(rr.qtype.getCode()==QType::NS)
L<<Logger::Error<<rr.content<<endl;
}
return false;
DLOG(L<<"The best NS is: "<<rrset.begin()->qname<<endl);
- BOOST_FOREACH(DNSResourceRecord rr, rrset) {
+ for(auto& rr: rrset) {
DLOG(L<<"\tadding '"<<rr.content<<"'"<<endl);
rr.d_place=DNSResourceRecord::AUTHORITY;
r->addRecord(rr);
DLOG(L<<Logger::Warning<<"Let's try DNAME.."<<endl);
vector<DNSResourceRecord> rrset = getBestDNAMESynth(p, sd, target);
if(!rrset.empty()) {
- BOOST_FOREACH(DNSResourceRecord& rr, rrset) {
+ for(auto& rr: rrset) {
rr.d_place = DNSResourceRecord::ANSWER;
r->addRecord(rr);
}
}
else {
DLOG(L<<"The best wildcard match: "<<rrset.begin()->qname<<endl);
- BOOST_FOREACH(DNSResourceRecord rr, rrset) {
+ for(auto& rr: rrset) {
rr.wildcardname = rr.qname;
rr.qname=bestmatch=target;
}
if(weRedirected) {
- BOOST_FOREACH(rr, rrset) {
+ for(auto& rr: rrset) {
if(rr.qtype.getCode() == QType::CNAME) {
r->addRecord(rr);
target = rr.content;
}
else if(weDone) {
bool haveRecords = false;
- BOOST_FOREACH(rr, rrset) {
+ for(const auto& rr: rrset) {
if((p->qtype.getCode() == QType::ANY || rr.qtype == p->qtype) && rr.qtype.getCode() && rr.auth) {
r->addRecord(rr);
haveRecords = true;
editSOA(d_dk, sd.qname, r);
- BOOST_FOREACH(const DNSResourceRecord& rr, r->getRRS()) {
+ for(const auto& rr: r->getRRS()) {
if(rr.scopeMask) {
noCache=1;
break;