]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove unused functions in dns_master
authorEvan Hunt <each@isc.org>
Mon, 2 Oct 2023 20:52:58 +0000 (13:52 -0700)
committerEvan Hunt <each@isc.org>
Thu, 7 Dec 2023 01:31:38 +0000 (17:31 -0800)
dns_master_dumpnode() and dns_master_dumpnodetostream() were
never used and can be removed.

lib/dns/include/dns/masterdump.h
lib/dns/masterdump.c

index 973f31fafd8c82dfac25afa88c70ba492980bd1a..a030924e73677eaffc40ba94f2340a2dd890b31d 100644 (file)
@@ -336,17 +336,6 @@ dns_master_questiontotext(const dns_name_t    *owner_name,
                          const dns_master_style_t *style,
                          isc_buffer_t             *target);
 
-isc_result_t
-dns_master_dumpnodetostream(isc_mem_t *mctx, dns_db_t *db,
-                           dns_dbversion_t *version, dns_dbnode_t *node,
-                           const dns_name_t         *name,
-                           const dns_master_style_t *style, FILE *f);
-
-isc_result_t
-dns_master_dumpnode(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
-                   dns_dbnode_t *node, const dns_name_t *name,
-                   const dns_master_style_t *style, const char *filename);
-
 dns_masterstyle_flags_t
 dns_master_styleflags(const dns_master_style_t *style);
 
index 32b13b630fdc775dd5eb0526dfb795ffbc80c62b..6418420dc5e2a22a090ad8554b16bc73d5461a4a 100644 (file)
@@ -1908,93 +1908,6 @@ cleanup:
        return (result);
 }
 
-/*
- * Dump a database node into a master file.
- * XXX: this function assumes the text format.
- */
-isc_result_t
-dns_master_dumpnodetostream(isc_mem_t *mctx, dns_db_t *db,
-                           dns_dbversion_t *version, dns_dbnode_t *node,
-                           const dns_name_t *name,
-                           const dns_master_style_t *style, FILE *f) {
-       isc_result_t result;
-       isc_buffer_t buffer;
-       char *bufmem;
-       isc_stdtime_t now = isc_stdtime_now();
-       dns_totext_ctx_t ctx;
-       dns_rdatasetiter_t *rdsiter = NULL;
-       unsigned int options = DNS_DB_STALEOK;
-
-       if ((style->flags & DNS_STYLEFLAG_EXPIRED) != 0) {
-               options |= DNS_DB_EXPIREDOK;
-       }
-
-       result = totext_ctx_init(style, NULL, &ctx);
-       if (result != ISC_R_SUCCESS) {
-               UNEXPECTED_ERROR("could not set master file style");
-               return (ISC_R_UNEXPECTED);
-       }
-
-       bufmem = isc_mem_get(mctx, initial_buffer_length);
-
-       isc_buffer_init(&buffer, bufmem, initial_buffer_length);
-
-       result = dns_db_allrdatasets(db, node, version, options, now, &rdsiter);
-       if (result != ISC_R_SUCCESS) {
-               goto failure;
-       }
-       result = dump_rdatasets_text(mctx, name, rdsiter, &ctx, &buffer, f);
-       if (result != ISC_R_SUCCESS) {
-               goto failure;
-       }
-       dns_rdatasetiter_destroy(&rdsiter);
-
-       result = ISC_R_SUCCESS;
-
-failure:
-       isc_mem_put(mctx, buffer.base, buffer.length);
-       return (result);
-}
-
-isc_result_t
-dns_master_dumpnode(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
-                   dns_dbnode_t *node, const dns_name_t *name,
-                   const dns_master_style_t *style, const char *filename) {
-       FILE *f = NULL;
-       isc_result_t result;
-
-       result = isc_stdio_open(filename, "w", &f);
-       if (result != ISC_R_SUCCESS) {
-               isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL,
-                             DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
-                             "dumping node to file: %s: open: %s", filename,
-                             isc_result_totext(result));
-               return (ISC_R_UNEXPECTED);
-       }
-
-       result = dns_master_dumpnodetostream(mctx, db, version, node, name,
-                                            style, f);
-       if (result != ISC_R_SUCCESS) {
-               isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL,
-                             DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
-                             "dumping master file: %s: dump: %s", filename,
-                             isc_result_totext(result));
-               (void)isc_stdio_close(f);
-               return (ISC_R_UNEXPECTED);
-       }
-
-       result = isc_stdio_close(f);
-       if (result != ISC_R_SUCCESS) {
-               isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL,
-                             DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR,
-                             "dumping master file: %s: close: %s", filename,
-                             isc_result_totext(result));
-               return (ISC_R_UNEXPECTED);
-       }
-
-       return (result);
-}
-
 dns_masterstyle_flags_t
 dns_master_styleflags(const dns_master_style_t *style) {
        REQUIRE(style != NULL);