From: Otto Moerbeek Date: Mon, 7 Dec 2020 10:10:27 +0000 (+0100) Subject: Keep const QType in definitions and introduce a nicer way to build X-Git-Tag: dnsdist-1.6.0-alpha2~46^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22165a1874bee9b44ef345f7a8f8cd124d3a5302;p=thirdparty%2Fpdns.git Keep const QType in definitions and introduce a nicer way to build the name to number mapping and vice versa. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3e4348caff..ed2605ec97 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1352,7 +1352,7 @@ static bool udrCheckUniqueDNSRecord(const DNSName& dname, uint16_t qtype, const } #endif /* NOD_ENABLED */ -int followCNAMERecords(vector& ret, const QType& qtype, int rcode) +int followCNAMERecords(vector& ret, const QType qtype, int rcode) { vector resolved; DNSName target; diff --git a/pdns/qtype.cc b/pdns/qtype.cc index d33273bf54..7c23075b97 100644 --- a/pdns/qtype.cc +++ b/pdns/qtype.cc @@ -30,7 +30,7 @@ static_assert(sizeof(QType) == 2, "QType is not 2 bytes in size, something is wrong!"); -const vector QType::names = { +const map QType::names = { {"A", 1}, {"NS", 2}, {"CNAME", 5}, @@ -92,14 +92,21 @@ const vector QType::names = { {"LUA", 65402}, }; +static map swapElements(const map& names) { + map ret; + + for (const auto& n : names) { + ret.insert(make_pair(n.second, n.first)); + } + return ret; +} + +const map QType::numbers = swapElements(names); + + bool QType::isSupportedType() const { - for (const auto& pos : names) { - if (pos.second == code) { - return true; - } - } - return false; + return numbers.count(code) == 1; } bool QType::isMetadataType() const @@ -116,10 +123,9 @@ bool QType::isMetadataType() const const string QType::getName() const { - for (const auto& pos : names) { - if (pos.second == code) { - return pos.first; - } + const auto& name = numbers.find(code); + if (name != numbers.cend()) { + return name->second; } return "TYPE" + itoa(code); } @@ -128,17 +134,16 @@ uint16_t QType::chartocode(const char *p) { string P = toUpper(p); - for(const auto& pos: names) { - if (pos.first == P) { - return pos.second; - } + const auto& num = names.find(P); + if (num != names.cend()) { + return num->second; } if (*p == '#') { - return static_cast(atoi(p+1)); + return static_cast(atoi(p + 1)); } if (boost::starts_with(P, "TYPE")) { - return static_cast(atoi(p+4)); + return static_cast(atoi(p + 4)); } return 0; diff --git a/pdns/qtype.hh b/pdns/qtype.hh index 1751ac14f0..510563b61a 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -40,23 +40,8 @@ class QType { public: QType(uint16_t qtype = 0) : code(qtype) {} - QType(const QType& orig) : code(orig.code) {} - QType &operator=(uint16_t arg) - { - code = arg; - return *this; - } QType &operator=(const char *); QType &operator=(const string &); - QType &operator=(const QType& rhs) - { - code = rhs.code; - return *this; - } - bool operator<(const QType rhs) const - { - return code < rhs.code; - } operator uint16_t() const { return code; @@ -67,6 +52,7 @@ public: { return code; } + bool isSupportedType() const; bool isMetadataType() const; @@ -135,8 +121,8 @@ public: LUA = 65402 }; - typedef pair namenum; - const static vector names; + const static map names; + const static map numbers; private: diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 7ff340e6ff..e590d4fe42 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -186,7 +186,7 @@ int SyncRes::beginResolve(const DNSName &qname, const QType qtype, uint16_t qcla * - trustanchor.server CH TXT * - negativetrustanchor.server CH TXT */ -bool SyncRes::doSpecialNamesResolve(const DNSName &qname, QType qtype, const uint16_t qclass, vector &ret) +bool SyncRes::doSpecialNamesResolve(const DNSName &qname, const QType qtype, const uint16_t qclass, vector &ret) { static const DNSName arpa("1.0.0.127.in-addr.arpa."), ip6_arpa("1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa."), localhost("localhost."), versionbind("version.bind."), idserver("id.server."), versionpdns("version.pdns."), trustanchorserver("trustanchor.server."), @@ -292,7 +292,7 @@ void SyncRes::AuthDomain::addSOA(std::vector& records) const } } -int SyncRes::AuthDomain::getRecords(const DNSName& qname, QType qtype, std::vector& records) const +int SyncRes::AuthDomain::getRecords(const DNSName& qname, const QType qtype, std::vector& records) const { int result = RCode::NoError; records.clear(); @@ -381,16 +381,16 @@ int SyncRes::AuthDomain::getRecords(const DNSName& qname, QType qtype, std::vect return result; } -bool SyncRes::doOOBResolve(const AuthDomain& domain, const DNSName &qname, QType qtype, vector&ret, int& res) +bool SyncRes::doOOBResolve(const AuthDomain& domain, const DNSName &qname, const QType qtype, vector&ret, int& res) { d_authzonequeries++; s_authzonequeries++; - res = domain.getRecords(qname, qtype.getCode(), ret); + res = domain.getRecords(qname, qtype, ret); return true; } -bool SyncRes::doOOBResolve(const DNSName &qname, QType qtype, vector&ret, unsigned int depth, int& res) +bool SyncRes::doOOBResolve(const DNSName &qname, const QType qtype, vector&ret, unsigned int depth, int& res) { string prefix; if(doLog()) { @@ -641,7 +641,7 @@ LWResult::Result SyncRes::asyncresolveWrapper(const ComboAddress& ip, bool ednsM #define QLOG(x) LOG(prefix << " child=" << child << ": " << x << endl) -int SyncRes::doResolve(const DNSName &qname, QType qtype, vector&ret, unsigned int depth, set& beenthere, vState& state) { +int SyncRes::doResolve(const DNSName &qname, const QType qtype, vector&ret, unsigned int depth, set& beenthere, vState& state) { string prefix = d_prefix; prefix.append(depth, ' '); @@ -818,7 +818,7 @@ int SyncRes::doResolve(const DNSName &qname, QType qtype, vector&ret, * \param stopAtDelegation if non-nullptr and pointed-to value is Stop requests the callee to stop at a delegation, if so pointed-to value is set to Stopped * \return DNS RCODE or -1 (Error) */ -int SyncRes::doResolveNoQNameMinimization(const DNSName &qname, QType qtype, vector&ret, unsigned int depth, set& beenthere, vState& state, bool *fromCache, StopAtDelegation *stopAtDelegation, bool considerforwards) +int SyncRes::doResolveNoQNameMinimization(const DNSName &qname, const QType qtype, vector&ret, unsigned int depth, set& beenthere, vState& state, bool *fromCache, StopAtDelegation *stopAtDelegation, bool considerforwards) { string prefix; if(doLog()) { @@ -1157,7 +1157,7 @@ vector SyncRes::getAddrs(const DNSName &qname, unsigned int depth, return ret; } -void SyncRes::getBestNSFromCache(const DNSName &qname, QType qtype, vector& bestns, bool* flawedNSSet, unsigned int depth, set& beenthere, const boost::optional& cutOffDomain) +void SyncRes::getBestNSFromCache(const DNSName &qname, const QType qtype, vector& bestns, bool* flawedNSSet, unsigned int depth, set& beenthere, const boost::optional& cutOffDomain) { string prefix; DNSName subdomain(qname); @@ -1269,7 +1269,7 @@ SyncRes::domainmap_t::const_iterator SyncRes::getBestAuthZone(DNSName* qname) co } /** doesn't actually do the work, leaves that to getBestNSFromCache */ -DNSName SyncRes::getBestNSNamesFromCache(const DNSName &qname, QType qtype, NsSet& nsset, bool* flawedNSSet, unsigned int depth, set&beenthere) +DNSName SyncRes::getBestNSNamesFromCache(const DNSName &qname, const QType qtype, NsSet& nsset, bool* flawedNSSet, unsigned int depth, set&beenthere) { string prefix; if (doLog()) { @@ -1342,7 +1342,7 @@ DNSName SyncRes::getBestNSNamesFromCache(const DNSName &qname, QType qtype, NsSe return nsFromCacheDomain; } -void SyncRes::updateValidationStatusInCache(const DNSName &qname, const QType& qt, bool aa, vState newState) const +void SyncRes::updateValidationStatusInCache(const DNSName &qname, const QType qt, bool aa, vState newState) const { if (qt == QType::ANY || qt == QType::ADDR) { // not doing that @@ -1369,7 +1369,7 @@ static bool scanForCNAMELoop(const DNSName& name, const vector& recor return false; } -bool SyncRes::doCNAMECacheCheck(const DNSName &qname, QType qtype, vector& ret, unsigned int depth, int &res, vState& state, bool wasAuthZone, bool wasForwardRecurse) +bool SyncRes::doCNAMECacheCheck(const DNSName &qname, const QType qtype, vector& ret, unsigned int depth, int &res, vState& state, bool wasAuthZone, bool wasForwardRecurse) { string prefix; if(doLog()) { @@ -1640,7 +1640,7 @@ static void addTTLModifiedRecords(vector& records, const uint32_t ttl } } -void SyncRes::computeNegCacheValidationStatus(const NegCache::NegCacheEntry& ne, const DNSName& qname, const QType& qtype, const int res, vState& state, unsigned int depth) +void SyncRes::computeNegCacheValidationStatus(const NegCache::NegCacheEntry& ne, const DNSName& qname, const QType qtype, const int res, vState& state, unsigned int depth) { DNSName subdomain(qname); /* if we are retrieving a DS, we only care about the state of the parent zone */ @@ -2081,7 +2081,7 @@ static void addNXNSECS(vector&ret, const vector& records) ret.insert(ret.end(), ne.DNSSECRecords.signatures.begin(), ne.DNSSECRecords.signatures.end()); } -static bool rpzHitShouldReplaceContent(const DNSName& qname, const QType& qtype, const std::vector& records) +static bool rpzHitShouldReplaceContent(const DNSName& qname, const QType qtype, const std::vector& records) { if (qtype == QType::CNAME) { return true; @@ -2104,7 +2104,7 @@ static bool rpzHitShouldReplaceContent(const DNSName& qname, const QType& qtype, return true; } -static void removeConflictingRecord(std::vector& records, const DNSName& name, QType dtype) +static void removeConflictingRecord(std::vector& records, const DNSName& name, const QType dtype) { for (auto it = records.begin(); it != records.end(); ) { bool remove = false; @@ -2134,7 +2134,7 @@ static void removeConflictingRecord(std::vector& records, const DNSNa } } -void SyncRes::handlePolicyHit(const std::string& prefix, const DNSName& qname, const QType& qtype, std::vector& ret, bool& done, int& rcode, unsigned int depth) +void SyncRes::handlePolicyHit(const std::string& prefix, const DNSName& qname, const QType qtype, std::vector& ret, bool& done, int& rcode, unsigned int depth) { if (d_pdl && d_pdl->policyHitEventFilter(d_requestor, qname, qtype, d_queryReceivedOverTCP, d_appliedPolicy, d_policyTags, d_discardedPolicies)) { /* reset to no match */ @@ -2287,7 +2287,7 @@ vector SyncRes::retrieveAddressesForNS(const std::string& prefix, return result; } -bool SyncRes::throttledOrBlocked(const std::string& prefix, const ComboAddress& remoteIP, const DNSName& qname, const QType& qtype, bool pierceDontQuery) +bool SyncRes::throttledOrBlocked(const std::string& prefix, const ComboAddress& remoteIP, const DNSName& qname, const QType qtype, bool pierceDontQuery) { if(t_sstorage.throttle.shouldThrottle(d_now.tv_sec, boost::make_tuple(remoteIP, "", 0))) { LOG(prefix<& records, const std::vector >& signatures) +vState SyncRes::validateRecordsWithSigs(unsigned int depth, const DNSName& qname, const QType qtype, const DNSName& name, const QType type, const std::vector& records, const std::vector >& signatures) { skeyset_t keys; if (!signatures.empty()) { @@ -2818,7 +2818,7 @@ static bool allowAdditionalEntry(std::unordered_set& allowedAdditionals } } -void SyncRes::sanitizeRecords(const std::string& prefix, LWResult& lwr, const DNSName& qname, const QType& qtype, const DNSName& auth, bool wasForwarded, bool rdQuery) +void SyncRes::sanitizeRecords(const std::string& prefix, LWResult& lwr, const DNSName& qname, const QType qtype, const DNSName& auth, bool wasForwarded, bool rdQuery) { const bool wasForwardRecurse = wasForwarded && rdQuery; /* list of names for which we will allow A and AAAA records in the additional section @@ -2945,7 +2945,7 @@ void SyncRes::sanitizeRecords(const std::string& prefix, LWResult& lwr, const DN } } -RCode::rcodes_ SyncRes::updateCacheFromRecords(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType& qtype, const DNSName& auth, bool wasForwarded, const boost::optional ednsmask, vState& state, bool& needWildcardProof, bool& gatherWildcardProof, unsigned int& wildcardLabelsCount, bool rdQuery, const ComboAddress& remoteIP) +RCode::rcodes_ SyncRes::updateCacheFromRecords(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType qtype, const DNSName& auth, bool wasForwarded, const boost::optional ednsmask, vState& state, bool& needWildcardProof, bool& gatherWildcardProof, unsigned int& wildcardLabelsCount, bool rdQuery, const ComboAddress& remoteIP) { bool wasForwardRecurse = wasForwarded && rdQuery; tcache_t tcache; @@ -3330,7 +3330,7 @@ dState SyncRes::getDenialValidationState(const NegCache::NegCacheEntry& ne, cons return getDenial(csp, ne.d_name, ne.d_qtype.getCode(), referralToUnsigned, expectedState == dState::NXQTYPE); } -bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, const QType& qtype, const DNSName& auth, LWResult& lwr, const bool sendRDQuery, vector& ret, set& nsset, DNSName& newtarget, DNSName& newauth, bool& realreferral, bool& negindic, vState& state, const bool needWildcardProof, const bool gatherWildcardProof, const unsigned int wildcardLabelsCount, int& rcode, unsigned int depth) +bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, const QType qtype, const DNSName& auth, LWResult& lwr, const bool sendRDQuery, vector& ret, set& nsset, DNSName& newtarget, DNSName& newauth, bool& realreferral, bool& negindic, vState& state, const bool needWildcardProof, const bool gatherWildcardProof, const unsigned int wildcardLabelsCount, int& rcode, unsigned int depth) { bool done = false; DNSName dnameTarget, dnameOwner; @@ -3600,7 +3600,7 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co return done; } -bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, const QType& qtype, LWResult& lwr, boost::optional& ednsmask, const DNSName& auth, bool const sendRDQuery, const bool wasForwarded, const DNSName& nsName, const ComboAddress& remoteIP, bool doTCP, bool& truncated, bool& spoofed) +bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, const QType qtype, LWResult& lwr, boost::optional& ednsmask, const DNSName& auth, bool const sendRDQuery, const bool wasForwarded, const DNSName& nsName, const ComboAddress& remoteIP, bool doTCP, bool& truncated, bool& spoofed) { bool chained = false; LWResult::Result resolveret = LWResult::Result::Success; @@ -3779,7 +3779,7 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, return true; } -void SyncRes::handleNewTarget(const std::string& prefix, const DNSName& qname, const DNSName& newtarget, QType qtype, std::vector& ret, int& rcode, int depth, const std::vector& recordsFromAnswer, vState& state) +void SyncRes::handleNewTarget(const std::string& prefix, const DNSName& qname, const DNSName& newtarget, const QType qtype, std::vector& ret, int& rcode, int depth, const std::vector& recordsFromAnswer, vState& state) { if (newtarget == qname) { LOG(prefix< ednsmask, bool sendRDQuery, NsSet &nameservers, std::vector& ret, const DNSFilterEngine& dfe, bool* gotNewServers, int* rcode, vState& state, const ComboAddress& remoteIP) +bool SyncRes::processAnswer(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType qtype, DNSName& auth, bool wasForwarded, const boost::optional ednsmask, bool sendRDQuery, NsSet &nameservers, std::vector& ret, const DNSFilterEngine& dfe, bool* gotNewServers, int* rcode, vState& state, const ComboAddress& remoteIP) { string prefix; if(doLog()) { @@ -3951,7 +3951,7 @@ bool SyncRes::processAnswer(unsigned int depth, LWResult& lwr, const DNSName& qn * -1 in case of no results * rcode otherwise */ -int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, const DNSName &qname, QType qtype, +int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, const DNSName &qname, const QType qtype, vector&ret, unsigned int depth, set&beenthere, vState& state, StopAtDelegation* stopAtDelegation) { @@ -4217,7 +4217,7 @@ void SyncRes::parseEDNSSubnetAddFor(const std::string& subnetlist) } // used by PowerDNSLua - note that this neglects to add the packet count & statistics back to pdns_ercursor.cc -int directResolve(const DNSName& qname, const QType& qtype, int qclass, vector& ret) +int directResolve(const DNSName& qname, const QType qtype, int qclass, vector& ret) { struct timeval now; gettimeofday(&now, 0); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 58dca42d0e..a8705b32c3 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -812,8 +812,8 @@ private: int doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, const DNSName &qname, QType qtype, vector&ret, unsigned int depth, set&beenthere, vState& state, StopAtDelegation* stopAtDelegation); - bool doResolveAtThisIP(const std::string& prefix, const DNSName& qname, const QType& qtype, LWResult& lwr, boost::optional& ednsmask, const DNSName& auth, bool const sendRDQuery, const bool wasForwarded, const DNSName& nsName, const ComboAddress& remoteIP, bool doTCP, bool& truncated, bool& spoofed); - bool processAnswer(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType& qtype, DNSName& auth, bool wasForwarded, const boost::optional ednsmask, bool sendRDQuery, NsSet &nameservers, std::vector& ret, const DNSFilterEngine& dfe, bool* gotNewServers, int* rcode, vState& state, const ComboAddress& remoteIP); + bool doResolveAtThisIP(const std::string& prefix, const DNSName& qname, const QType qtype, LWResult& lwr, boost::optional& ednsmask, const DNSName& auth, bool const sendRDQuery, const bool wasForwarded, const DNSName& nsName, const ComboAddress& remoteIP, bool doTCP, bool& truncated, bool& spoofed); + bool processAnswer(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType qtype, DNSName& auth, bool wasForwarded, const boost::optional ednsmask, bool sendRDQuery, NsSet &nameservers, std::vector& ret, const DNSFilterEngine& dfe, bool* gotNewServers, int* rcode, vState& state, const ComboAddress& remoteIP); int doResolve(const DNSName &qname, QType qtype, vector&ret, unsigned int depth, set& beenthere, vState& state); int doResolveNoQNameMinimization(const DNSName &qname, QType qtype, vector&ret, unsigned int depth, set& beenthere, vState& state, bool* fromCache = NULL, StopAtDelegation* stopAtDelegation = NULL, bool considerforwards = true); @@ -833,13 +833,13 @@ private: bool nameserversBlockedByRPZ(const DNSFilterEngine& dfe, const NsSet& nameservers); bool nameserverIPBlockedByRPZ(const DNSFilterEngine& dfe, const ComboAddress&); - bool throttledOrBlocked(const std::string& prefix, const ComboAddress& remoteIP, const DNSName& qname, const QType& qtype, bool pierceDontQuery); + bool throttledOrBlocked(const std::string& prefix, const ComboAddress& remoteIP, const DNSName& qname, QType qtype, bool pierceDontQuery); vector retrieveAddressesForNS(const std::string& prefix, const DNSName& qname, vector>::const_iterator& tns, const unsigned int depth, set& beenthere, const vector>& rnameservers, NsSet& nameservers, bool& sendRDQuery, bool& pierceDontQuery, bool& flawedNSSet, bool cacheOnly, unsigned int& addressQueriesForNS); - void sanitizeRecords(const std::string& prefix, LWResult& lwr, const DNSName& qname, const QType& qtype, const DNSName& auth, bool wasForwarded, bool rdQuery); - RCode::rcodes_ updateCacheFromRecords(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType& qtype, const DNSName& auth, bool wasForwarded, const boost::optional, vState& state, bool& needWildcardProof, bool& gatherWildcardProof, unsigned int& wildcardLabelsCount, bool sendRDQuery, const ComboAddress& remoteIP); - bool processRecords(const std::string& prefix, const DNSName& qname, const QType& qtype, const DNSName& auth, LWResult& lwr, const bool sendRDQuery, vector& ret, set& nsset, DNSName& newtarget, DNSName& newauth, bool& realreferral, bool& negindic, vState& state, const bool needWildcardProof, const bool gatherwildcardProof, const unsigned int wildcardLabelsCount, int& rcode, unsigned int depth); + void sanitizeRecords(const std::string& prefix, LWResult& lwr, const DNSName& qname, const QType qtype, const DNSName& auth, bool wasForwarded, bool rdQuery); + RCode::rcodes_ updateCacheFromRecords(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType qtype, const DNSName& auth, bool wasForwarded, const boost::optional, vState& state, bool& needWildcardProof, bool& gatherWildcardProof, unsigned int& wildcardLabelsCount, bool sendRDQuery, const ComboAddress& remoteIP); + bool processRecords(const std::string& prefix, const DNSName& qname, const QType qtype, const DNSName& auth, LWResult& lwr, const bool sendRDQuery, vector& ret, set& nsset, DNSName& newtarget, DNSName& newauth, bool& realreferral, bool& negindic, vState& state, const bool needWildcardProof, const bool gatherwildcardProof, const unsigned int wildcardLabelsCount, int& rcode, unsigned int depth); bool doSpecialNamesResolve(const DNSName &qname, QType qtype, const uint16_t qclass, vector &ret); @@ -850,23 +850,23 @@ private: bool validationEnabled() const; uint32_t computeLowestTTD(const std::vector& records, const std::vector >& signatures, uint32_t signaturesTTL, const std::vector>& authorityRecs) const; void updateValidationState(vState& state, const vState stateUpdate); - vState validateRecordsWithSigs(unsigned int depth, const DNSName& qname, const QType& qtype, const DNSName& name, const QType& type, const std::vector& records, const std::vector >& signatures); + vState validateRecordsWithSigs(unsigned int depth, const DNSName& qname, const QType qtype, const DNSName& name, const QType type, const std::vector& records, const std::vector >& signatures); vState validateDNSKeys(const DNSName& zone, const std::vector& dnskeys, const std::vector >& signatures, unsigned int depth); vState getDNSKeys(const DNSName& signer, skeyset_t& keys, unsigned int depth); dState getDenialValidationState(const NegCache::NegCacheEntry& ne, const vState state, const dState expectedState, bool referralToUnsigned); void updateDenialValidationState(vState& neValidationState, const DNSName& neName, vState& state, const dState denialState, const dState expectedState, bool allowOptOut); - void computeNegCacheValidationStatus(const NegCache::NegCacheEntry& ne, const DNSName& qname, const QType& qtype, const int res, vState& state, unsigned int depth); + void computeNegCacheValidationStatus(const NegCache::NegCacheEntry& ne, const DNSName& qname, QType qtype, const int res, vState& state, unsigned int depth); vState getTA(const DNSName& zone, dsmap_t& ds); bool haveExactValidationStatus(const DNSName& domain); vState getValidationStatus(const DNSName& subdomain, bool allowIndeterminate=true); - void updateValidationStatusInCache(const DNSName &qname, const QType& qt, bool aa, vState newState) const; + void updateValidationStatusInCache(const DNSName &qname, QType qt, bool aa, vState newState) const; bool lookForCut(const DNSName& qname, unsigned int depth, const vState existingState, vState& newState); void computeZoneCuts(const DNSName& begin, const DNSName& end, unsigned int depth); void handleNewTarget(const std::string& prefix, const DNSName& qname, const DNSName& newtarget, QType qtype, std::vector& ret, int& rcode, int depth, const std::vector& recordsFromAnswer, vState& state); - void handlePolicyHit(const std::string& prefix, const DNSName& qname, const QType& qtype, vector& ret, bool& done, int& rcode, unsigned int depth); + void handlePolicyHit(const std::string& prefix, const DNSName& qname, QType qtype, vector& ret, bool& done, int& rcode, unsigned int depth); void setUpdatingRootNS() { @@ -1093,8 +1093,8 @@ typedef boost::function pipefunc_t; void broadcastFunction(const pipefunc_t& func); void distributeAsyncFunction(const std::string& question, const pipefunc_t& func); -int directResolve(const DNSName& qname, const QType& qtype, int qclass, vector& ret); -int followCNAMERecords(std::vector& ret, const QType& qtype, int oldret); +int directResolve(const DNSName& qname, const QType qtype, int qclass, vector& ret); +int followCNAMERecords(std::vector& ret, const QType qtype, int oldret); int getFakeAAAARecords(const DNSName& qname, ComboAddress prefix, vector& ret); int getFakePTRRecords(const DNSName& qname, vector& ret);