From 97b64f49702312250b5cd0c58cf68862224604fc Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Fri, 16 Dec 2022 11:27:01 +0000 Subject: [PATCH 1/2] Remove deprecated dns_db_rpz_*() methods As well as the function wrappers, their slots have been removed from the dns_dbmethods table. --- bin/tests/system/dyndb/driver/db.c | 2 -- lib/dns/db.c | 22 ---------------------- lib/dns/dnsrps.c | 2 -- lib/dns/include/dns/db.h | 16 ---------------- lib/dns/include/dns/rpz.h | 1 - lib/dns/rbtdb.c | 4 ---- lib/dns/sdb.c | 2 -- lib/dns/sdlz.c | 2 -- 8 files changed, 51 deletions(-) diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c index f7b052fbba..54c6a808e0 100644 --- a/bin/tests/system/dyndb/driver/db.c +++ b/bin/tests/system/dyndb/driver/db.c @@ -575,8 +575,6 @@ static dns_dbmethods_t sampledb_methods = { getoriginnode, transfernode, getnsec3parameters, findnsec3node, setsigningtime, getsigningtime, resigned, isdnssec, getrrsetstats, - NULL, /* rpz_attach */ - NULL, /* rpz_ready */ findnodeext, findext, setcachestats, hashsize, NULL, /* nodefullname */ NULL, /* getsize */ diff --git a/lib/dns/db.c b/lib/dns/db.c index 87549bbcb4..0a10c39418 100644 --- a/lib/dns/db.c +++ b/lib/dns/db.c @@ -975,28 +975,6 @@ dns_db_resigned(dns_db_t *db, dns_rdataset_t *rdataset, } } -/* - * Attach a database to policy zone databases. - * This should only happen when the caller has already ensured that - * it is dealing with a database that understands response policy zones. - */ -void -dns_db_rpz_attach(dns_db_t *db, void *rpzs, uint8_t rpz_num) { - REQUIRE(db->methods->rpz_attach != NULL); - (db->methods->rpz_attach)(db, rpzs, rpz_num); -} - -/* - * Finish loading a response policy zone. - */ -isc_result_t -dns_db_rpz_ready(dns_db_t *db) { - if (db->methods->rpz_ready == NULL) { - return (ISC_R_SUCCESS); - } - return ((db->methods->rpz_ready)(db)); -} - /* * Attach a notify-on-update function the database */ diff --git a/lib/dns/dnsrps.c b/lib/dns/dnsrps.c index a78c8f2013..341c116f23 100644 --- a/lib/dns/dnsrps.c +++ b/lib/dns/dnsrps.c @@ -967,8 +967,6 @@ static dns_dbmethods_t rpsdb_db_methods = { NULL, /* resigned */ NULL, /* isdnssec */ NULL, /* getrrsetstats */ - NULL, /* rpz_attach */ - NULL, /* rpz_ready */ NULL, /* findnodeext */ NULL, /* findext */ NULL, /* setcachestats */ diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index b15279c9ee..e48833fe39 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -50,7 +50,6 @@ #include #include -#include #include #include #include @@ -159,8 +158,6 @@ typedef struct dns_dbmethods { dns_dbversion_t *version); bool (*isdnssec)(dns_db_t *db); dns_stats_t *(*getrrsetstats)(dns_db_t *db); - void (*rpz_attach)(dns_db_t *db, void *rpzs, uint8_t rpz_num); - isc_result_t (*rpz_ready)(dns_db_t *db); isc_result_t (*findnodeext)(dns_db_t *db, const dns_name_t *name, bool create, dns_clientinfomethods_t *methods, @@ -1626,19 +1623,6 @@ dns_db_setcachestats(dns_db_t *db, isc_stats_t *stats); * dns_rdatasetstats_create(); otherwise NULL. */ -void -dns_db_rpz_attach(dns_db_t *db, void *rpzs, uint8_t rpz_num) ISC_DEPRECATED; -/*%< - * Attach the response policy information for a view to a database for a - * zone for the view. - */ - -isc_result_t -dns_db_rpz_ready(dns_db_t *db) ISC_DEPRECATED; -/*%< - * Finish loading a response policy zone. - */ - isc_result_t dns_db_updatenotify_register(dns_db_t *db, dns_dbupdate_callback_t fn, void *fn_arg); diff --git a/lib/dns/include/dns/rpz.h b/lib/dns/include/dns/rpz.h index 6ccb0242ef..a11dd1c63a 100644 --- a/lib/dns/include/dns/rpz.h +++ b/lib/dns/include/dns/rpz.h @@ -21,7 +21,6 @@ #include #include -#include #include #include #include diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index a416ab66f7..73c86615cc 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -8138,8 +8138,6 @@ static dns_dbmethods_t zone_methods = { attach, resigned, isdnssec, NULL, /* getrrsetstats */ - NULL, /* rpz_attach */ - NULL, /* rpz_ready */ NULL, /* findnodeext */ NULL, /* findext */ NULL, /* setcachestats */ @@ -8188,8 +8186,6 @@ static dns_dbmethods_t cache_methods = { attach, NULL, /* resigned */ isdnssec, getrrsetstats, - NULL, /* rpz_attach */ - NULL, /* rpz_ready */ NULL, /* findnodeext */ NULL, /* findext */ setcachestats, diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index 65701a0647..c20670eb1f 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -1289,8 +1289,6 @@ static dns_dbmethods_t sdb_methods = { NULL, /* resigned */ NULL, /* isdnssec */ NULL, /* getrrsetstats */ - NULL, /* rpz_attach */ - NULL, /* rpz_ready */ findnodeext, findext, NULL, /* setcachestats */ NULL, /* hashsize */ diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index fbe4b60244..e2e77f2f09 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -1247,8 +1247,6 @@ static dns_dbmethods_t sdlzdb_methods = { NULL, /* resigned */ NULL, /* isdnssec */ NULL, /* getrrsetstats */ - NULL, /* rpz_attach */ - NULL, /* rpz_ready */ findnodeext, findext, NULL, /* setcachestats */ NULL, /* hashsize */ NULL, /* nodefullname */ From 75f7a85a39c7f9a8a27a34ed341a346290606807 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Fri, 16 Dec 2022 11:31:08 +0000 Subject: [PATCH 2/2] Deprecate We refactor more freely these days. --- CHANGES | 4 ++++ lib/isc/Makefile.am | 1 - lib/isc/include/isc/deprecated.h | 20 -------------------- lib/isc/include/isc/util.h | 5 ----- 4 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 lib/isc/include/isc/deprecated.h diff --git a/CHANGES b/CHANGES index b673261f55..270f9c7cb0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +6100. [cleanup] Deprecate , because obsolete + functions are now deleted instead of marked with + an attribute. [GL !7466] + 6099. [performance] Change the internal read-write lock to modified C-RW-WP algorithm that is more reader-writer fair and has better performance for our workloads. [GL #1609] diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index b532587cf2..8bc44fc864 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -21,7 +21,6 @@ libisc_la_HEADERS = \ include/isc/condition.h \ include/isc/counter.h \ include/isc/crc64.h \ - include/isc/deprecated.h \ include/isc/dir.h \ include/isc/dnsstream.h \ include/isc/endian.h \ diff --git a/lib/isc/include/isc/deprecated.h b/lib/isc/include/isc/deprecated.h deleted file mode 100644 index c83508d45f..0000000000 --- a/lib/isc/include/isc/deprecated.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * SPDX-License-Identifier: MPL-2.0 - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -#pragma once - -#if (__GNUC__ + 0) > 3 -#define ISC_DEPRECATED __attribute__((deprecated)) -#else /* if (__GNUC__ + 0) > 3 */ -#define ISC_DEPRECATED /* none */ -#endif /* __GNUC__ > 3*/ diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 35d9050158..65835920b6 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -387,11 +387,6 @@ mock_assert(const int result, const char *const expression, #define ISC_ALIGN(x, a) (((x) + (a)-1) & ~((uintmax_t)(a)-1)) #endif /* ifdef __GNUC__ */ -/*% - * Misc - */ -#include - /*% * Swap */