From: Michal 'vorner' Vaner Date: Thu, 12 Apr 2012 12:36:45 +0000 (+0200) Subject: [1577] Logging for findNSEC3 X-Git-Tag: trac2351_base~226^2~116^2~34^2^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7130e28820b2e9e603f64546deebf12b410b897d;p=thirdparty%2Fkea.git [1577] Logging for findNSEC3 --- diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc index f7b2f22d31..a57e3d10f4 100644 --- a/src/lib/datasrc/database.cc +++ b/src/lib/datasrc/database.cc @@ -941,7 +941,9 @@ DatabaseClient::Finder::findInternal(const Name& name, const RRType& type, ZoneFinder::FindNSEC3Result DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) { - // TODO: Some logging. + LOG_DEBUG(logger, DBG_TRACE_BASIC, DATASRC_DATABASE_FINDNSEC3).arg(name). + arg(recursive ? "recursive" : "non-recursive"); + // First, validate the input const NameComparisonResult cmp_result(name.compare(getOrigin())); @@ -980,6 +982,8 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) { const string hash(calculator->calculate(labels == qlabels ? name : name.split(qlabels - labels, labels))); + LOG_DEBUG(logger, DBG_TRACE_BASIC, DATASRC_DATABASE_FINDNSEC3_TRYHASH). + arg(name).arg(labels).arg(hash); DatabaseAccessor::IteratorContextPtr context(accessor_->getNSEC3Records(hash, zone_id_)); @@ -999,10 +1003,16 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) { "exists, but no NSEC3 there"); } + LOG_DEBUG(logger, DBG_TRACE_BASIC, + DATASRC_DATABASE_FINDNSEC3_MATCH).arg(name).arg(labels). + arg(*it->second); return (FindNSEC3Result(true, labels, it->second, covering_proof)); } else { const string prevHash(accessor_->findPreviousNSEC3Hash(zone_id_, hash)); + LOG_DEBUG(logger, DBG_TRACE_BASIC, + DATASRC_DATABASE_FINDNSEC3_TRYHASH_PREV).arg(name). + arg(labels).arg(prevHash); context = accessor_->getNSEC3Records(prevHash, zone_id_); const FoundRRsets prev_nsec3(getRRsets(prevHash + "." + otext, NSEC3_TYPES(), false, NULL, @@ -1021,6 +1031,9 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) { covering_proof = prev_it->second; if (!recursive) { + LOG_DEBUG(logger, DBG_TRACE_BASIC, + DATASRC_DATABASE_FINDNSEC3_COVER).arg(name). + arg(labels).arg(*covering_proof); return (FindNSEC3Result(false, labels, covering_proof, ConstRRsetPtr())); } diff --git a/src/lib/datasrc/datasrc_messages.mes b/src/lib/datasrc/datasrc_messages.mes index ef46cb5f09..88cf185f61 100644 --- a/src/lib/datasrc/datasrc_messages.mes +++ b/src/lib/datasrc/datasrc_messages.mes @@ -75,6 +75,35 @@ The datasource tried to provide an NSEC proof that the named domain does not exist, but the database backend doesn't support DNSSEC. No proof is included in the answer as a result. +% DATASRC_DATABASE_FINDNSEC3 Looking for NSEC3 for %1 in % mode +Debug information. A search in an database data source for NSEC3 that +matches or covers the given name is being started. + +% DATASRC_DATABASE_FINDNSEC3_COVER found a covering NSEC3 for %1: %2 +Debug information. An NSEC3 that covers the given name is found and +being returned. The found NSEC3 RRset is also displayed. + +% DATASRC_DATABASE_FINDNSEC3_MATCH found a matching NSEC3 for %1 at label count %2: %3 +Debug information. An NSEC3 that matches (a possibly superdomain of) +the given name is found and being returned. When the shown label +count is smaller than that of the given name, the matching NSEC3 is +for a superdomain of the given name (see DATASRC_DATABSE_FINDNSEC3_TRYHASH). +The found NSEC3 RRset is also displayed. + +% DATASRC_DATABASE_FINDNSEC3_TRYHASH looking for NSEC3 for %1 at label count %2 (hash %3) +Debug information. In an attempt of finding an NSEC3 for the give name, +(a possibly superdomain of) the name is hashed and searched for in the +NSEC3 name space. When the shown label count is smaller than that of the +shown name, the search tries the superdomain name that share the shown +(higher) label count of the shown name (e.g., for +www.example.com. with shown label count of 3, example.com. is being +tried). + +% DATASRC_DATABASE_FINDNSEC3_TRYHASH_PREV looking for previous NSEC3 for %1 at label count %2 (hash %3) +Debug information. An exact match on hash (see +DATASRC_DATABASE_FINDNSEC3_TRYHASH) was unsuccessful. We get the previous hash +to that one instead. + % DATASRC_DATABASE_FIND_RECORDS looking in datasource %1 for record %2/%3/%4 Debug information. The database data source is looking up records with the given name and type in the database.