]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/recursor_cache.cc
rec: Dump RRSIGs from record cache
[thirdparty/pdns.git] / pdns / recursor_cache.cc
index d3178beb3ea55dc878a6ae76e58152d754d5a55f..30417546a164c523baabfdbfdeb82f1ee0e50046 100644 (file)
@@ -295,6 +295,15 @@ uint64_t MemRecursorCache::doDump(int fd)
         fprintf(fp, "; error printing '%s'\n", i->d_qname.empty() ? "EMPTY" : i->d_qname.toString().c_str());
       }
     }
+    for(const auto &sig : i->d_signatures) {
+      count++;
+      try {
+        fprintf(fp, "%s %" PRId64 " IN RRSIG %s ; %s\n", i->d_qname.toString().c_str(), static_cast<int64_t>(i->d_ttd - now), sig->getZoneRepresentation().c_str(), i->d_netmask.empty() ? "" : i->d_netmask.toString().c_str());
+      }
+      catch(...) {
+        fprintf(fp, "; error printing '%s'\n", i->d_qname.empty() ? "EMPTY" : i->d_qname.toString().c_str());
+      }
+    }
   }
   fclose(fp);
   return count;