]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
renamed dns_view_dumpcachetostream() to dns_view_dumpdbtostream()
authorAndreas Gustafsson <source@isc.org>
Fri, 15 Dec 2000 21:11:38 +0000 (21:11 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 15 Dec 2000 21:11:38 +0000 (21:11 +0000)
and changed header comments to make it clear that it is for debugging/analysis purposes and may
dump other stuff in addition to the cache in the future.  Also changed the dump style to the
'explict TTL' one, which makes more sense than usin  when dumping cache files since the TTLs
tend to be different in each rrset, and added a comment banner at the top of each cache dump
containing the view name.

bin/named/server.c
lib/dns/include/dns/view.h
lib/dns/view.c

index 1c1c08eb7fdd66ac3885f0f6e4bb114df57e2323..c1c7f0d4c8cc14460bb1749c1ab73b5e4f15aa0b 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.275 2000/12/15 19:38:07 gson Exp $ */
+/* $Id: server.c,v 1.276 2000/12/15 21:11:38 gson Exp $ */
 
 #include <config.h>
 
@@ -2414,8 +2414,8 @@ ns_server_dumpdb(ns_server_t *server) {
             view = ISC_LIST_NEXT(view, link))
        {
                if (view->cachedb != NULL)
-                       CHECKM(dns_view_dumpcachetostream(view, fp),
-                              "could not dump cache");
+                       CHECKM(dns_view_dumpdbtostream(view, fp),
+                              "could not dump view databases");
        }
  cleanup:
        if (fp != NULL)
index aae31e6179f97b955f92b5d042ae9ec271e8ce05..5f30b7b3b7e8b40c417b7f3afa8181fc34785cff 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: view.h,v 1.58 2000/12/13 21:28:38 bwelling Exp $ */
+/* $Id: view.h,v 1.59 2000/12/15 21:11:36 gson Exp $ */
 
 #ifndef DNS_VIEW_H
 #define DNS_VIEW_H 1
@@ -631,20 +631,37 @@ dns_view_dialup(dns_view_t *view);
 
 isc_result_t
 dns_view_dumpcache(dns_view_t *view);
+/*
+ * Dump the view's cache to the the view's cache file.
+ *
+ * Requires:
+ *     
+ *     'view' is valid.
+ *
+ * Returns:
+ *     ISC_R_SUCCESS   The cache was successfully dumped.
+ *     ISC_R_IGNORE    No cachefile was specified.
+ *     others          An error occurred (see dns_master_dump)
+ */
 
 isc_result_t
-dns_view_dumpcachetostream(dns_view_t *view, FILE *fp);
+dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
 /*
- * Dump the cache to the specified cache file (if there is one) or stream.
+ * Dump the current state of the view 'view' to the stream 'fp'
+ * for purposes of analysis or debugging.
+ *
+ * Currently the dumped state includes the view's cache; in the future
+ * it may also include other state such as the address database.
+ * It will not not include authoritative data since it is voluminous and
+ * easily obtainable by other means.
  *
  * Requires:
  *     
  *     'view' is valid.
  *
- *     'fp' is an open file.
+ *     'fp' refers to a file open for writing.
  *
  * Returns:
- * 
  *     ISC_R_SUCCESS   The cache was successfully dumped.
  *     ISC_R_IGNORE    No cachefile was specified.
  *     others          An error occurred (see dns_master_dump)
index 294c2429ea482d35f77a366809b27023dc677967..fedc7587833621777886476df6f88d212b0ab94f 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: view.c,v 1.86 2000/12/12 21:33:14 bwelling Exp $ */
+/* $Id: view.c,v 1.87 2000/12/15 21:11:35 gson Exp $ */
 
 #include <config.h>
 
@@ -1068,11 +1068,18 @@ dns_view_dumpcache(dns_view_t *view) {
 }
 
 isc_result_t
-dns_view_dumpcachetostream(dns_view_t *view, FILE *fp) {
-       REQUIRE(DNS_VIEW_VALID(view));
+dns_view_dumpdbtostream(dns_view_t *view, FILE *fp) {
+       isc_result_t result;
 
-       return (dns_master_dumptostream(view->mctx, view->cachedb, NULL,
-                               &dns_master_style_default, fp));
+       REQUIRE(DNS_VIEW_VALID(view));
 
+       (void)fprintf(fp, ";\n; Cache dump of view '%s'\n;\n", view->name);
+       result = dns_master_dumptostream(view->mctx, view->cachedb, NULL,
+                                         &dns_master_style_explicitttl, fp);
+       if (result != ISC_R_SUCCESS)
+               return (result);
+#ifdef notyet /* clean up adb dump format first */
+       dns_adb_dump(view->adb, fp);
+#endif
+       return (ISC_R_SUCCESS);
 }
-