r.auth = (parts[2] == "1");
} else {
r.scopeMask = 0;
- r.auth = 1;
+ r.auth = true;
}
r.qname=DNSName(parts[1+extraFields]);
r.qtype=parts[3+extraFields];
}
rr.qclass=QClass::IN; // Internet class randomness.
rr.ttl=5; // 5 seconds
- rr.auth = 1; // it may be random.. but it is auth!
+ rr.auth = true; // it may be random.. but it is auth!
rr.content = d_answer;
d_answer.clear(); // this was the last answer
if(d_dnssecQueries)
r.auth = !row[7].empty() && row[7][0]=='1';
else
- r.auth = 1;
+ r.auth = true;
r.disabled = !row[5].empty() && row[5][0]=='1';
r->setRemote(&d_remote);
r->setAnswer(true); // this implies the allocation of the header
r->setA(true); // and we are authoritative
- r->setRA(0); // no recursion available
+ r->setRA(false); // no recursion available
r->setRD(d.rd); // if you wanted to recurse, answer will say you wanted it
r->setID(d.id);
r->setOpcode(d.opcode);
string msg=getMessageForRRSET(signQName, rrc, toSign); // this is what we will hash & sign
pair<string, string> lookup(rc->getPubKeyHash(), getLookupKey(msg)); // this hash is a memory saving exercise
- bool doCache=1;
+ bool doCache=true;
if(doCache)
{
ReadLock l(&g_signatures_lock);
if((len=recvmsg(sock, &msgh, 0)) < 0 ) {
if(errno != EAGAIN)
g_log<<Logger::Error<<"recvfrom gave error, ignoring: "<<stringerror()<<endl;
- return 0;
+ return false;
}
break;
}
BOOST_STATIC_ASSERT(offsetof(sockaddr_in, sin_port) == offsetof(sockaddr_in6, sin6_port));
if(remote.sin4.sin_port == 0) // would generate error on responding. sin4 also works for ipv6
- return 0;
+ return false;
packet.setSocket(sock);
packet.setRemote(&remote);
rr.dr.d_type = QType::CNAME;
rr.dr.d_name = prefix + rr.dr.d_name;
rr.dr.d_content = std::make_shared<CNAMERecordContent>(CNAMERecordContent(prefix + getRR<DNAMERecordContent>(rr.dr)->getTarget()));
- rr.auth = 0; // don't sign CNAME
+ rr.auth = false; // don't sign CNAME
target= getRR<CNAMERecordContent>(rr.dr)->getTarget();
ret.push_back(rr);
}
set<DNSName> authSet;
vector<DNSZoneRecord> rrset;
- bool weDone=0, weRedirected=0, weHaveUnauth=0, doSigs=0;
+ bool weDone=false, weRedirected=false, weHaveUnauth=false, doSigs=false;
DNSName haveAlias;
uint8_t aliasScopeMask;
rrset.push_back(rr);
}
if(rec->d_type == QType::CNAME && p.qtype.getCode() != QType::CNAME)
- weRedirected = 1;
+ weRedirected = true;
else
- weDone = 1;
+ weDone = true;
}
}
catch(std::exception &e) {
// cerr<<"Auth: "<<rr.auth<<", "<<(rr.dr.d_type == p.qtype)<<", "<<rr.dr.d_type.getName()<<endl;
if((p.qtype.getCode() == QType::ANY || rr.dr.d_type == p.qtype.getCode()) && rr.auth)
- weDone=1;
+ weDone=true;
// the line below fakes 'unauth NS' for delegations for non-DNSSEC backends.
if((rr.dr.d_type == p.qtype.getCode() && !rr.auth) || (rr.dr.d_type == QType::NS && (!rr.auth || !(d_sd.qname==rr.dr.d_name))))
- weHaveUnauth=1;
+ weHaveUnauth=true;
if(rr.dr.d_type == QType::CNAME && p.qtype.getCode() != QType::CNAME)
- weRedirected=1;
+ weRedirected=true;
if(DP && rr.dr.d_type == QType::ALIAS && (p.qtype.getCode() == QType::A || p.qtype.getCode() == QType::AAAA || p.qtype.getCode() == QType::ANY)) {
if (!d_doExpandALIAS) {
DNSResourceRecord rr;
rr.qname = zone;
- rr.auth = 1;
+ rr.auth = true;
rr.ttl = ::arg().asNum("default-ttl");
rr.qtype = "SOA";
cerr<<"Domain '"<<zone<<"' does not exist"<<endl;
return EXIT_FAILURE;
}
- rr.auth = 1;
+ rr.auth = true;
rr.domain_id = di.id;
rr.qname = name;
DNSResourceRecord oldrr;
rr.qname=DNSName("blah")+zone;
rr.qtype=QType::A;
rr.ttl=3600;
- rr.auth=1;
+ rr.auth=true;
rr.qclass = QClass::IN;
UeberBackend db("key-only");
throw runtime_error("No backends available for DNSSEC key storage");
}
- ChunkedSigningPipe csp(DNSName(zone), 1, cores);
+ ChunkedSigningPipe csp(DNSName(zone), true, cores);
vector<DNSZoneRecord> signatures;
uint32_t rnd;
rr.qname=zone;
rr.ttl=86400;
rr.domain_id=di.id;
- rr.auth=1;
+ rr.auth=true;
rr.content="ns1.example.com. ahu.example.com. 2012081039 7200 3600 1209600 3600";
cout<<"Feeding SOA"<<endl;
db->feedRecord(rr, DNSName());
rr.qname=zone;
rr.ttl=86400;
rr.domain_id=di.id;
- rr.auth=1;
+ rr.auth=true;
rr.content="ns1.example.com. ahu.example.com. 2012081039 7200 3600 1209600 3600";
cout<<"Feeding SOA"<<endl;
db->feedRecord(rr, DNSName());
else if(pdns_iequals(cmds[n], "KSK"))
dpk.d_flags = 257;
else if(pdns_iequals(cmds[n], "active"))
- active = 1;
+ active = true;
else if(pdns_iequals(cmds[n], "passive") || pdns_iequals(cmds[n], "inactive")) // passive eventually needs to be removed
- active = 0;
+ active = false;
else if(pdns_iequals(cmds[n], "published"))
- published = 1;
+ published = true;
else if(pdns_iequals(cmds[n], "unpublished"))
- published = 0;
+ published = false;
else {
cerr<<"Unknown key flag '"<<cmds[n]<<"'"<<endl;
return 1;
rrout.content = makeSOAContent(sd)->getZoneRepresentation(true);
rrout.qtype = QType::SOA;
rrout.domain_id = sd.domain_id;
- rrout.auth = 1;
+ rrout.auth = true;
rrout.ttl = sd.ttl;
return true;
instances.push_back(this); // report to the static list of ourself
}
- d_negcached=0;
- d_cached=0;
+ d_negcached=false;
+ d_cached=false;
d_cache_ttl = ::arg().asNum("query-cache-ttl");
d_negcache_ttl = ::arg().asNum("negquery-cache-ttl");
d_qtype = 0;
DNSResourceRecord rr;
rr.qname = qname;
rr.qtype = qtype;
- rr.auth = 1;
+ rr.auth = true;
rr.ttl = ttl;
validateGatheredRRType(rr);
// synthesize RRs as needed
DNSResourceRecord autorr;
autorr.qname = zonename;
- autorr.auth = 1;
+ autorr.auth = true;
autorr.ttl = ::arg().asNum("default-ttl");
if (!have_soa && zonekind != DomainInfo::Slave) {
cout<<"COMMIT;"<<endl;
}
}
- g_intransaction=1;
+ g_intransaction=true;
if(g_mode == MYSQL)
cout<<"BEGIN;"<<endl;