]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
clean up unused API
authorEvan Hunt <each@isc.org>
Wed, 25 May 2022 19:02:18 +0000 (12:02 -0700)
committerEvan Hunt <each@isc.org>
Thu, 7 Jul 2022 02:36:54 +0000 (19:36 -0700)
the dns_adb_dumpfind() function was only used inside adb.c and
can be static. dns_view_dumpdbtostream() was not used anywhere.

lib/dns/adb.c
lib/dns/include/dns/adb.h
lib/dns/include/dns/view.h
lib/dns/view.c

index 92fd72418f7ea22eb19d5d613484cdefbd5344f3..7d549aa5eea03baf20c3e3bd1202dd3215364469 100644 (file)
@@ -2880,8 +2880,8 @@ dump_entry(FILE *f, dns_adb_t *adb, dns_adbentry_t *entry, bool debug,
        }
 }
 
-void
-dns_adb_dumpfind(dns_adbfind_t *find, FILE *f) {
+static void
+dumpfind(dns_adbfind_t *find, FILE *f) {
        char tmp[512];
        const char *tmpp = NULL;
        dns_adbaddrinfo_t *ai = NULL;
@@ -2971,7 +2971,7 @@ print_find_list(FILE *f, dns_adbname_t *name) {
 
        find = ISC_LIST_HEAD(name->finds);
        while (find != NULL) {
-               dns_adb_dumpfind(find, f);
+               dumpfind(find, f);
                find = ISC_LIST_NEXT(find, plink);
        }
 }
index 05b9c91b2949d158d4e91ad5a12ac35463f71096..4bfe6d0a42f030331468f267d28fb1af324ad2e3 100644 (file)
@@ -454,29 +454,15 @@ dns_adb_destroyfind(dns_adbfind_t **find);
 void
 dns_adb_dump(dns_adb_t *adb, FILE *f);
 /*%<
- * This function is only used for debugging.  It will dump as much of the
- * state of the running system as possible.
+ * Used by "rndc dumpdb": Dump the state of the running ADB.
  *
  * Requires:
  *
- *\li  adb be valid.
+ *\li  adb is valid.
  *
  *\li  f != NULL, and is a file open for writing.
  */
 
-void
-dns_adb_dumpfind(dns_adbfind_t *find, FILE *f);
-/*%<
- * This function is only used for debugging.  Dump the data associated
- * with a find.
- *
- * Requires:
- *
- *\li  find is valid.
- *
- * \li f != NULL, and is a file open for writing.
- */
-
 isc_result_t
 dns_adb_marklame(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
                 const dns_name_t *qname, dns_rdatatype_t type,
index 5d78999941d2e7bc9ad8e97b6c87b3fbe682380c..7a9a48c26927bf77368c02f8798846fa9d1ac9f4 100644 (file)
@@ -868,28 +868,6 @@ dns_view_dialup(dns_view_t *view);
  * Perform dialup-time maintenance on the zones of 'view'.
  */
 
-isc_result_t
-dns_view_dumpdbtostream(dns_view_t *view, FILE *fp);
-/*%<
- * 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:
- *
- *\li  'view' is valid.
- *
- *\li  'fp' refers to a file open for writing.
- *
- * Returns:
- * \li ISC_R_SUCCESS   The cache was successfully dumped.
- * \li others          An error occurred (see dns_master_dump)
- */
-
 isc_result_t
 dns_view_flushcache(dns_view_t *view, bool fixuponly);
 /*%<
index 4200eeb8c5fbc8a25c280d9cca2a9b08fa9a1105..3a00a0a46ce1994c5d7ca9844fc04094c9387128 100644 (file)
@@ -1472,25 +1472,6 @@ dns_view_checksig(dns_view_t *view, isc_buffer_t *source, dns_message_t *msg) {
                                view->dynamickeys));
 }
 
-isc_result_t
-dns_view_dumpdbtostream(dns_view_t *view, FILE *fp) {
-       isc_result_t result;
-
-       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_cache,
-                                        dns_masterformat_text, NULL, fp);
-       if (result != ISC_R_SUCCESS) {
-               return (result);
-       }
-       dns_adb_dump(view->adb, fp);
-       dns_resolver_printbadcache(view->resolver, fp);
-       dns_badcache_print(view->failcache, "SERVFAIL cache", fp);
-       return (ISC_R_SUCCESS);
-}
-
 isc_result_t
 dns_view_flushcache(dns_view_t *view, bool fixuponly) {
        isc_result_t result;