[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3846 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Tue Aug 31 16:23:05 CEST 2010


Author: matthijs
Date: 2010-08-31 16:23:05 +0200 (Tue, 31 Aug 2010)
New Revision: 3846

Modified:
   trunk/OpenDNSSEC/signer/src/signer/rrset.c
   trunk/OpenDNSSEC/signer/src/signer/rrset.h
Log:
adding and removing RRs is now considered heavy debugging (6 v's)
added function: recover rr from backup



Modified: trunk/OpenDNSSEC/signer/src/signer/rrset.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/rrset.c	2010-08-31 14:19:24 UTC (rev 3845)
+++ trunk/OpenDNSSEC/signer/src/signer/rrset.c	2010-08-31 14:23:05 UTC (rev 3846)
@@ -143,8 +143,10 @@
         se_log_info("%s %s", pre?pre:"", str?str:"(null)");
     } else if (level == 4) {
         se_log_verbose("%s %s", pre?pre:"", str?str:"(null)");
+    } else if (level == 5) {
+        se_log_debug("%s %s", pre?pre:"", str?str:"(null)");
     } else {
-        se_log_debug("%s %s", pre?pre:"", str?str:"(null)");
+        se_log_deeebug("%s %s", pre?pre:"", str?str:"(null)");
     }
     se_free((void*)str);
     return;
@@ -167,7 +169,7 @@
     if (!rrset->rrs->rr) {
         rrset->rrs->rr = rr;
         rrset->rr_count += 1;
-        rrset_log_rr(rr, "+RR", 5);
+        rrset_log_rr(rr, "+RR", 6);
         return LDNS_STATUS_OK;
     } else {
         status = util_dnssec_rrs_add_rr(rrset->rrs, rr);
@@ -184,7 +186,7 @@
                 return status;
             }
         }
-        rrset_log_rr(rr, "+RR", 5);
+        rrset_log_rr(rr, "+RR", 6);
         rrset->rr_count += 1;
         return LDNS_STATUS_OK;
     }
@@ -214,7 +216,7 @@
             }
             ldns_rr_free(rrs->rr);
             se_free((void*)rrs);
-            rrset_log_rr(rr, "-RR", 5);
+            rrset_log_rr(rr, "-RR", 6);
             return 1;
         }
         prev_rrs = rrs;
@@ -225,6 +227,17 @@
 
 
 /**
+ * Recover RR from backup.
+ *
+ */
+int
+rrset_recover_rr_from_backup(rrset_type* rrset, ldns_rr* rr)
+{
+    return (rrset_add_pending_rr(rrset, rr) == LDNS_STATUS_OK);
+}
+
+
+/**
  * Add RR to RRset.
  *
  */
@@ -304,7 +317,7 @@
 
     if (!rrset->add->rr) {
         rrset->add->rr = rr;
-        rrset_log_rr(rr, "+rr", 5);
+        rrset_log_rr(rr, "+rr", 6);
     } else {
         status = util_dnssec_rrs_add_rr(rrset->add, rr);
         if (status != LDNS_STATUS_OK) {
@@ -320,7 +333,7 @@
                 return 1;
             }
         }
-        rrset_log_rr(rr, "+rr", 5);
+        rrset_log_rr(rr, "+rr", 6);
     }
     return 0;
 }
@@ -345,7 +358,7 @@
 
     if (!rrset->del->rr) {
         rrset->del->rr = rr;
-        rrset_log_rr(rr, "-rr", 5);
+        rrset_log_rr(rr, "-rr", 6);
     } else {
         status = util_dnssec_rrs_add_rr(rrset->del, rr);
         if (status != LDNS_STATUS_OK) {
@@ -361,7 +374,7 @@
                 return 1;
             }
         }
-        rrset_log_rr(rr, "-rr", 5);
+        rrset_log_rr(rr, "-rr", 6);
     }
     return 0;
 }
@@ -413,14 +426,14 @@
             } else {
                 rrset->rrsigs = rrs->next;
             }
-            rrset_log_rr(rrs->rr, "-RRSIG", 5);
+            rrset_log_rr(rrs->rr, "-RRSIG", 6);
             rrset->rrsig_count -= 1;
             ldns_rr_free(rrs->rr);
             se_free((void*)rrs);
         } else {
             se_log_debug("keep signature for RRset[%i] (refresh=%u, "
                 "expiration=%u)", rrset->rr_type, refresh, expiration);
-            rrset_log_rr(rrs->rr, "*RRSIG", 5);
+            rrset_log_rr(rrs->rr, "*RRSIG", 6);
             *reusedsigs += 1;
             prev_rrs = rrs;
         }
@@ -563,7 +576,7 @@
                 }
                 if (!rrset->rrsigs->rr) {
                     rrset->rrsigs->rr = rrsig;
-                    rrset_log_rr(rrsig, "+RRSIG", 5);
+                    rrset_log_rr(rrsig, "+RRSIG", 6);
                     rrset->rrsig_count += 1;
                     newsigs++;
                 } else {
@@ -582,7 +595,7 @@
                             return 1;
                         }
                     } else {
-                        rrset_log_rr(rrsig, "+RRSIG", 5);
+                        rrset_log_rr(rrsig, "+RRSIG", 6);
                         rrset->rrsig_count += 1;
                         newsigs++;
                     }

Modified: trunk/OpenDNSSEC/signer/src/signer/rrset.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/rrset.h	2010-08-31 14:19:24 UTC (rev 3845)
+++ trunk/OpenDNSSEC/signer/src/signer/rrset.h	2010-08-31 14:23:05 UTC (rev 3846)
@@ -99,6 +99,15 @@
 int rrset_del_rr(rrset_type* rrset, ldns_rr* rr);
 
 /**
+ * Recover RR from backup.
+ * \param[in] rrset RRset
+ * \param[in] rr RR
+ * \return 0 on success, 1 on error
+ *
+ */
+int rrset_recover_rr_from_backup(rrset_type* rrset, ldns_rr* rr);
+
+/**
  * Sign RRset.
  * \param[in] ctx HSM context
  * \param[in] rrset RRset




More information about the Opendnssec-commits mailing list