2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Cleanup the dns_catz unit API

1. Change the _new, _add and _copy functions to return the new object
   instead of returning 'void' (or always ISC_R_SUCCESS)

2. Cleanup the isc_ht_find() + isc_ht_add() usage - the code is always
   locked with catzs->lock (mutex), so when isc_ht_find() returns
   ISC_R_NOTFOUND, the isc_ht_add() must always succeed.

3. Instead of returning direct iterator for the catalog zone entries,
   add dns_catz_zone_for_each_entry2() function that calls callback
   for each catalog zone entry and passes two extra arguments to the
   callback.  This will allow changing the internal storage for the
   catalog zone entries.

4. Cleanup the naming - dns_catz_<fn>_<obj> -> dns_catz_<obj>_<fn>, as an
   example dns_catz_new_zone() gets renamed to dns_catz_zone_new().
This commit is contained in:
Ondřej Surý
2023-07-12 09:22:11 +02:00
parent aad9fda87d
commit 48714a9c1d
6 changed files with 189 additions and 251 deletions

View File

@@ -286,8 +286,8 @@ destroy(dns_view_t *view) {
dns_rpz_detach_rpzs(&view->rpzs);
}
if (view->catzs != NULL) {
dns_catz_shutdown_catzs(view->catzs);
dns_catz_detach_catzs(&view->catzs);
dns_catz_zones_shutdown(view->catzs);
dns_catz_zones_detach(&view->catzs);
}
for (dlzdb = ISC_LIST_HEAD(view->dlz_searched); dlzdb != NULL;
dlzdb = ISC_LIST_HEAD(view->dlz_searched))
@@ -514,8 +514,8 @@ dns_view_detach(dns_view_t **viewp) {
}
}
if (view->catzs != NULL) {
dns_catz_shutdown_catzs(view->catzs);
dns_catz_detach_catzs(&view->catzs);
dns_catz_zones_shutdown(view->catzs);
dns_catz_zones_detach(&view->catzs);
}
if (view->ntatable_priv != NULL) {
dns_ntatable_shutdown(view->ntatable_priv);