]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1576] added log messages for findNSEC3
authorJINMEI Tatuya <jinmei@isc.org>
Wed, 8 Feb 2012 05:34:27 +0000 (21:34 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 8 Feb 2012 05:34:27 +0000 (21:34 -0800)
src/lib/datasrc/datasrc_messages.mes
src/lib/datasrc/memory_datasrc.cc

index f05ff21c607f9ccc5b167486c18a8c4518ff1ea6..d8ad07ba6112eb6a460caef5e959feb0e2f04ccc 100644 (file)
@@ -332,6 +332,30 @@ should be followed. The requested domain is an apex of some zone.
 % DATASRC_MEM_FIND find '%1/%2'
 Debug information. A search for the requested RRset is being started.
 
+% DATASRC_MEM_FINDNSEC3 finding NSEC3 for %1, mode %2
+Debug information. A search in an in-memory data source for NSEC3 that
+matches or covers the given name is being started.
+
+% DATASRC_MEM_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_MEM_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_MEM_FINDNSEC3_TRYHASH).
+The found NSEC3 RRset is also displayed.
+
+% DATASRC_MEM_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_MEM_FIND_ZONE looking for zone '%1'
 Debug information. A zone object for this zone is being searched for in the
 in-memory data source.
index e368b5354b3fbbbf3a9da2794fd7a2a28e2645fd..5137727a409e3b28fcca6c51850e58ed3cbfa8fb 100644 (file)
@@ -882,6 +882,9 @@ InMemoryZoneFinder::findAll(const Name& name,
 
 ZoneFinder::FindNSEC3Result
 InMemoryZoneFinder::findNSEC3(const Name& name, bool recursive) {
+    LOG_DEBUG(logger, DBG_TRACE_BASIC, DATASRC_MEM_FINDNSEC3).arg(name).
+        arg(recursive ? "recursive" : "non-recursive");
+
     if (!impl_->zone_data_->nsec3_data_) {
         isc_throw(DataSourceError,
                   "findNSEC3 attempt for non NSEC3 signed zone: " <<
@@ -914,6 +917,8 @@ InMemoryZoneFinder::findNSEC3(const Name& name, bool recursive) {
         const string hlabel = nsec3hash.calculate(
             labels == qlabels ? name : name.split(qlabels - labels, labels));
         NSEC3Map::const_iterator found = map.lower_bound(hlabel);
+        LOG_DEBUG(logger, DBG_TRACE_BASIC, DATASRC_MEM_FINDNSEC3_TRYHASH).
+            arg(name).arg(labels).arg(hlabel);
 
         // If the given hash is larger than the largest stored hash or
         // the first label doesn't match the target, identify the "previous"
@@ -932,10 +937,16 @@ InMemoryZoneFinder::findNSEC3(const Name& name, bool recursive) {
                 covering_proof = (--found)->second;
             }
             if (!recursive) {   // in non recursive mode, we are done.
+                LOG_DEBUG(logger, DBG_TRACE_BASIC,
+                          DATASRC_MEM_FINDNSEC3_COVER).
+                    arg(name).arg(*covering_proof);
                 return (FindNSEC3Result(false, labels, covering_proof,
                                         ConstRRsetPtr()));
             }
         } else {                // found an exact match.
+                LOG_DEBUG(logger, DBG_TRACE_BASIC,
+                          DATASRC_MEM_FINDNSEC3_MATCH).arg(name).arg(labels).
+                    arg(*found->second);
             return (FindNSEC3Result(true, labels, found->second,
                                     covering_proof));
         }