2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

refactor dns_catz to use loop callbacks

catz events are now scheduled using isc_task_async() instead
of isc_task_send().
This commit is contained in:
Evan Hunt
2022-10-29 03:53:47 -07:00
committed by Ondřej Surý
parent 9bdf982ea6
commit a9f9041fe6
4 changed files with 99 additions and 136 deletions

View File

@@ -313,14 +313,20 @@ typedef struct {
named_server_t *server;
} catz_cb_data_t;
typedef struct catz_chgzone_event {
ISC_EVENT_COMMON(struct catz_chgzone_event);
typedef struct catz_chgzone {
isc_mem_t *mctx;
dns_catz_entry_t *entry;
dns_catz_zone_t *origin;
dns_view_t *view;
catz_cb_data_t *cbd;
bool mod;
} catz_chgzone_event_t;
} catz_chgzone_t;
typedef enum {
CATZ_ADDZONE,
CATZ_MODZONE,
CATZ_DELZONE,
} catz_type_t;
typedef struct {
unsigned int magic;
@@ -2659,23 +2665,21 @@ configure_rpz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t **maps,
}
static void
catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
catz_chgzone_event_t *ev = (catz_chgzone_event_t *)event0;
catz_addmodzone_cb(void *arg) {
catz_chgzone_t *cz = (catz_chgzone_t *)arg;
isc_result_t result;
dns_forwarders_t *dnsforwarders = NULL;
dns_name_t *name = NULL;
isc_buffer_t namebuf;
isc_buffer_t *confbuf;
isc_buffer_t *confbuf = NULL;
char nameb[DNS_NAME_FORMATSIZE];
const cfg_obj_t *zlist = NULL;
cfg_obj_t *zoneconf = NULL;
cfg_obj_t *zoneobj = NULL;
ns_cfgctx_t *cfg;
ns_cfgctx_t *cfg = NULL;
dns_zone_t *zone = NULL;
UNUSED(task);
cfg = (ns_cfgctx_t *)ev->view->new_zone_config;
cfg = (ns_cfgctx_t *)cz->view->new_zone_config;
if (cfg == NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
@@ -2684,29 +2688,29 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
goto cleanup;
}
name = dns_catz_entry_getname(ev->entry);
name = dns_catz_entry_getname(cz->entry);
isc_buffer_init(&namebuf, nameb, DNS_NAME_FORMATSIZE);
dns_name_totext(name, true, &namebuf);
isc_buffer_putuint8(&namebuf, 0);
result = dns_fwdtable_find(ev->view->fwdtable, name, NULL,
result = dns_fwdtable_find(cz->view->fwdtable, name, NULL,
&dnsforwarders);
if (result == ISC_R_SUCCESS &&
dnsforwarders->fwdpolicy == dns_fwdpolicy_only)
{
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_addmodzone_taskaction: "
"catz: catz_addmodzone_cb: "
"zone '%s' will not be processed because of the "
"explicitly configured forwarding for that zone",
nameb);
goto cleanup;
}
result = dns_zt_find(ev->view->zonetable, name, 0, NULL, &zone);
result = dns_zt_find(cz->view->zonetable, name, 0, NULL, &zone);
if (ev->mod) {
if (cz->mod) {
dns_catz_zone_t *parentcatz;
if (result != ISC_R_SUCCESS) {
@@ -2721,7 +2725,7 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
if (!dns_zone_getadded(zone)) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_addmodzone_taskaction: "
"catz: catz_addmodzone_cb: "
"zone '%s' is not a dynamically "
"added zone",
nameb);
@@ -2733,16 +2737,16 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
if (parentcatz == NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_addmodzone_taskaction: "
"catz: catz_addmodzone_cb: "
"zone '%s' exists and is not added by "
"a catalog zone, so won't be modified",
nameb);
goto cleanup;
}
if (parentcatz != ev->origin) {
if (parentcatz != cz->origin) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_addmodzone_taskaction: "
"catz: catz_addmodzone_cb: "
"zone '%s' exists in multiple "
"catalog zones",
nameb);
@@ -2758,7 +2762,7 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: "
"catz_addmodzone_taskaction: "
"catz_addmodzone_cb: "
"zone '%s' will not be added "
"because it is an explicitly "
"configured zone",
@@ -2768,7 +2772,7 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: "
"catz_addmodzone_taskaction: "
"catz_addmodzone_cb: "
"zone '%s' will not be added "
"because another catalog zone "
"already contains an entry with "
@@ -2794,7 +2798,7 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
RUNTIME_CHECK(zone == NULL);
/* Create a config for new zone */
confbuf = NULL;
result = dns_catz_generate_zonecfg(ev->origin, ev->entry, &confbuf);
result = dns_catz_generate_zonecfg(cz->origin, cz->entry, &confbuf);
if (result == ISC_R_SUCCESS) {
cfg_parser_reset(cfg->add_parser);
result = cfg_parse_buffer(cfg->add_parser, confbuf, "catz", 0,
@@ -2824,12 +2828,12 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
/* Mark view unfrozen so that zone can be added */
isc_loopmgr_pause(named_g_loopmgr);
dns_view_thaw(ev->view);
result = configure_zone(cfg->config, zoneobj, cfg->vconfig, ev->view,
&ev->cbd->server->viewlist,
&ev->cbd->server->kasplist, cfg->actx, true,
false, ev->mod);
dns_view_freeze(ev->view);
dns_view_thaw(cz->view);
result = configure_zone(cfg->config, zoneobj, cfg->vconfig, cz->view,
&cz->cbd->server->viewlist,
&cz->cbd->server->kasplist, cfg->actx, true,
false, cz->mod);
dns_view_freeze(cz->view);
isc_loopmgr_resume(named_g_loopmgr);
if (result != ISC_R_SUCCESS) {
@@ -2841,7 +2845,7 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
}
/* Is it there yet? */
CHECK(dns_zt_find(ev->view->zonetable, name, 0, NULL, &zone));
CHECK(dns_zt_find(cz->view->zonetable, name, 0, NULL, &zone));
/*
* Load the zone from the master file. If this fails, we'll
@@ -2863,13 +2867,13 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
}
/* Remove the zone from the zone table */
dns_zt_unmount(ev->view->zonetable, zone);
dns_zt_unmount(cz->view->zonetable, zone);
goto cleanup;
}
/* Flag the zone as having been added at runtime */
dns_zone_setadded(zone, true);
dns_zone_set_parentcatz(zone, ev->origin);
dns_zone_set_parentcatz(zone, cz->origin);
cleanup:
if (zone != NULL) {
@@ -2878,33 +2882,31 @@ cleanup:
if (zoneconf != NULL) {
cfg_obj_destroy(cfg->add_parser, &zoneconf);
}
dns_catz_entry_detach(ev->origin, &ev->entry);
dns_catz_zone_detach(&ev->origin);
dns_view_detach(&ev->view);
isc_event_free(ISC_EVENT_PTR(&ev));
dns_catz_entry_detach(cz->origin, &cz->entry);
dns_catz_zone_detach(&cz->origin);
dns_view_detach(&cz->view);
isc_mem_putanddetach(&cz->mctx, cz, sizeof(*cz));
}
static void
catz_delzone_taskaction(isc_task_t *task, isc_event_t *event0) {
catz_chgzone_event_t *ev = (catz_chgzone_event_t *)event0;
catz_delzone_cb(void *arg) {
catz_chgzone_t *cz = (catz_chgzone_t *)arg;
isc_result_t result;
dns_zone_t *zone = NULL;
dns_db_t *dbp = NULL;
char cname[DNS_NAME_FORMATSIZE];
const char *file;
UNUSED(task);
const char *file = NULL;
isc_loopmgr_pause(named_g_loopmgr);
dns_name_format(dns_catz_entry_getname(ev->entry), cname,
dns_name_format(dns_catz_entry_getname(cz->entry), cname,
DNS_NAME_FORMATSIZE);
result = dns_zt_find(ev->view->zonetable,
dns_catz_entry_getname(ev->entry), 0, NULL, &zone);
result = dns_zt_find(cz->view->zonetable,
dns_catz_entry_getname(cz->entry), 0, NULL, &zone);
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_delzone_taskaction: "
"catz: catz_delzone_cb: "
"zone '%s' not found",
cname);
goto cleanup;
@@ -2913,16 +2915,16 @@ catz_delzone_taskaction(isc_task_t *task, isc_event_t *event0) {
if (!dns_zone_getadded(zone)) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_delzone_taskaction: "
"catz: catz_delzone_cb: "
"zone '%s' is not a dynamically added zone",
cname);
goto cleanup;
}
if (dns_zone_get_parentcatz(zone) != ev->origin) {
if (dns_zone_get_parentcatz(zone) != cz->origin) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_delzone_taskaction: zone "
"catz: catz_delzone_cb: zone "
"'%s' exists in multiple catalog zones",
cname);
goto cleanup;
@@ -2934,7 +2936,7 @@ catz_delzone_taskaction(isc_task_t *task, isc_event_t *event0) {
dns_zone_unload(zone);
}
CHECK(dns_zt_unmount(ev->view->zonetable, zone));
CHECK(dns_zt_unmount(cz->view->zonetable, zone));
file = dns_zone_getfile(zone);
if (file != NULL) {
isc_file_remove(file);
@@ -2946,7 +2948,7 @@ catz_delzone_taskaction(isc_task_t *task, isc_event_t *event0) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"catz: catz_delzone_taskaction: "
"catz: catz_delzone_cb: "
"zone '%s' deleted",
cname);
cleanup:
@@ -2954,77 +2956,63 @@ cleanup:
if (zone != NULL) {
dns_zone_detach(&zone);
}
dns_catz_entry_detach(ev->origin, &ev->entry);
dns_catz_zone_detach(&ev->origin);
dns_view_detach(&ev->view);
isc_event_free(ISC_EVENT_PTR(&ev));
dns_catz_entry_detach(cz->origin, &cz->entry);
dns_catz_zone_detach(&cz->origin);
dns_view_detach(&cz->view);
isc_mem_putanddetach(&cz->mctx, cz, sizeof(*cz));
}
static isc_result_t
catz_create_chg_task(dns_catz_entry_t *entry, dns_catz_zone_t *origin,
dns_view_t *view, isc_taskmgr_t *taskmgr, void *udata,
isc_eventtype_t type) {
catz_chgzone_event_t *event = NULL;
isc_task_t *task = NULL;
isc_result_t result;
isc_taskaction_t action = NULL;
result = isc_taskmgr_excltask(taskmgr, &task);
if (result != ISC_R_SUCCESS) {
return (result);
}
catz_run(dns_catz_entry_t *entry, dns_catz_zone_t *origin, dns_view_t *view,
void *udata, catz_type_t type) {
catz_chgzone_t *cz = NULL;
isc_job_cb action = NULL;
switch (type) {
case DNS_EVENT_CATZADDZONE:
case DNS_EVENT_CATZMODZONE:
action = catz_addmodzone_taskaction;
case CATZ_ADDZONE:
case CATZ_MODZONE:
action = catz_addmodzone_cb;
break;
case DNS_EVENT_CATZDELZONE:
action = catz_delzone_taskaction;
case CATZ_DELZONE:
action = catz_delzone_cb;
break;
default:
REQUIRE(0);
UNREACHABLE();
}
event = (catz_chgzone_event_t *)isc_event_allocate(
view->mctx, origin, type, action, NULL, sizeof(*event));
cz = isc_mem_get(view->mctx, sizeof(*cz));
*cz = (catz_chgzone_t){
.cbd = (catz_cb_data_t *)udata,
.mod = (type == CATZ_MODZONE),
};
isc_mem_attach(view->mctx, &cz->mctx);
event->cbd = (catz_cb_data_t *)udata;
event->entry = NULL;
event->origin = NULL;
event->view = NULL;
event->mod = (type == DNS_EVENT_CATZMODZONE);
dns_catz_entry_attach(entry, &cz->entry);
dns_catz_zone_attach(origin, &cz->origin);
dns_view_attach(view, &cz->view);
dns_catz_entry_attach(entry, &event->entry);
dns_catz_zone_attach(origin, &event->origin);
dns_view_attach(view, &event->view);
isc_task_send(task, ISC_EVENT_PTR(&event));
isc_task_detach(&task);
isc_async_run(named_g_mainloop, action, cz);
return (ISC_R_SUCCESS);
}
static isc_result_t
catz_addzone(dns_catz_entry_t *entry, dns_catz_zone_t *origin, dns_view_t *view,
isc_taskmgr_t *taskmgr, void *udata) {
return (catz_create_chg_task(entry, origin, view, taskmgr, udata,
DNS_EVENT_CATZADDZONE));
void *udata) {
return (catz_run(entry, origin, view, udata, CATZ_ADDZONE));
}
static isc_result_t
catz_delzone(dns_catz_entry_t *entry, dns_catz_zone_t *origin, dns_view_t *view,
isc_taskmgr_t *taskmgr, void *udata) {
return (catz_create_chg_task(entry, origin, view, taskmgr, udata,
DNS_EVENT_CATZDELZONE));
void *udata) {
return (catz_run(entry, origin, view, udata, CATZ_DELZONE));
}
static isc_result_t
catz_modzone(dns_catz_entry_t *entry, dns_catz_zone_t *origin, dns_view_t *view,
isc_taskmgr_t *taskmgr, void *udata) {
return (catz_create_chg_task(entry, origin, view, taskmgr, udata,
DNS_EVENT_CATZMODZONE));
void *udata) {
return (catz_run(entry, origin, view, udata, CATZ_MODZONE));
}
static isc_result_t
@@ -3177,8 +3165,8 @@ configure_catz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t *config,
return (ISC_R_SUCCESS);
}
CHECK(dns_catz_new_zones(&view->catzs, &ns_catz_zonemodmethods,
view->mctx, named_g_taskmgr, named_g_loopmgr));
dns_catz_new_zones(&view->catzs, &ns_catz_zonemodmethods, view->mctx,
named_g_loopmgr);
if (pview != NULL) {
old = pview->catzs;

View File

@@ -520,7 +520,7 @@ status=$((status+ret))
n=$((n+1))
echo_i "checking that unpermitted change of ownership did not happen ($n)"
ret=0
wait_for_message ns2/named.run "catz_addmodzone_taskaction: zone 'dom2.example' will not be added because another catalog zone already contains an entry with that zone" || ret=1
wait_for_message ns2/named.run "catz_addmodzone_cb: zone 'dom2.example' will not be added because another catalog zone already contains an entry with that zone" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@@ -642,7 +642,7 @@ status=$((status+ret))
n=$((n+1))
echo_i "checking that the change of ownership did not happen because version '1' catalog2 zone does not support the 'coo' property ($n)"
ret=0
wait_for_message ns2/named.run "catz_addmodzone_taskaction: zone 'dom2.example' will not be added because another catalog zone already contains an entry with that zone" || ret=1
wait_for_message ns2/named.run "catz_addmodzone_cb: zone 'dom2.example' will not be added because another catalog zone already contains an entry with that zone" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@@ -714,7 +714,7 @@ n=$((n+1))
echo_i "waiting for secondary to sync up ($n)"
ret=0
wait_for_message ns2/named.run "catz: adding zone 'dom-existing.example' from catalog 'catalog1.example'" &&
wait_for_message ns2/named.run "catz_addmodzone_taskaction: zone 'dom-existing.example' will not be added because it is an explicitly configured zone" || ret=1
wait_for_message ns2/named.run "catz_addmodzone_cb: zone 'dom-existing.example' will not be added because it is an explicitly configured zone" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@@ -760,7 +760,7 @@ n=$((n+1))
echo_i "waiting for secondary to sync up ($n)"
ret=0
wait_for_message ns2/named.run "catz: adding zone 'dom-existing-forward.example' from catalog 'catalog1.example'" &&
wait_for_message ns2/named.run "catz_addmodzone_taskaction: zone 'dom-existing-forward.example' will not be processed because of the explicitly configured forwarding for that zone" || ret=1
wait_for_message ns2/named.run "catz_addmodzone_cb: zone 'dom-existing-forward.example' will not be processed because of the explicitly configured forwarding for that zone" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))

View File

@@ -23,7 +23,6 @@
#include <isc/mem.h>
#include <isc/parseint.h>
#include <isc/result.h>
#include <isc/task.h>
#include <isc/util.h>
#include <dns/catz.h>
@@ -124,10 +123,9 @@ struct dns_catz_zones {
isc_refcount_t refs;
isc_mutex_t lock;
dns_catz_zonemodmethods_t *zmm;
isc_taskmgr_t *taskmgr;
isc_loopmgr_t *loopmgr;
dns_view_t *view;
isc_task_t *updater;
isc_loop_t *loop;
};
void
@@ -566,7 +564,6 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
zname, pczname, czname);
result = delzone(nentry, parentcatz,
parentcatz->catzs->view,
parentcatz->catzs->taskmgr,
parentcatz->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER,
@@ -657,7 +654,6 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
result = delzone(entry, target, target->catzs->view,
target->catzs->taskmgr,
target->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO,
@@ -679,7 +675,6 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
result = addzone(entry, target, target->catzs->view,
target->catzs->taskmgr,
target->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO,
@@ -696,7 +691,6 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
dns_name_format(&entry->name, zname, DNS_NAME_FORMATSIZE);
result = modzone(entry, target, target->catzs->view,
target->catzs->taskmgr,
target->catzs->zmm->udata);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_MASTER, ISC_LOG_INFO,
@@ -745,12 +739,10 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
return (result);
}
isc_result_t
void
dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm,
isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
isc_loopmgr_t *loopmgr) {
dns_catz_zones_t *new_zones;
isc_result_t result;
isc_mem_t *mctx, isc_loopmgr_t *loopmgr) {
dns_catz_zones_t *new_zones = NULL;
REQUIRE(catzsp != NULL && *catzsp == NULL);
REQUIRE(zmm != NULL);
@@ -766,24 +758,11 @@ dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm,
isc_mem_attach(mctx, &new_zones->mctx);
new_zones->zmm = zmm;
new_zones->loopmgr = loopmgr;
new_zones->taskmgr = taskmgr;
new_zones->loop = isc_loop_get(new_zones->loopmgr, 0);
result = isc_task_create(taskmgr, &new_zones->updater, 0);
if (result != ISC_R_SUCCESS) {
goto cleanup_ht;
}
new_zones->magic = DNS_CATZ_ZONES_MAGIC;
*catzsp = new_zones;
return (ISC_R_SUCCESS);
cleanup_ht:
isc_ht_destroy(&new_zones->zones);
isc_refcount_destroy(&new_zones->refs);
isc_mutex_destroy(&new_zones->lock);
isc_mem_put(mctx, new_zones, sizeof(*new_zones));
return (result);
}
void
@@ -854,7 +833,7 @@ catz_timer_start(dns_catz_zone_t *zone) {
}
isc_timer_create(isc_loop_current(zone->catzs->loopmgr),
dns_catz_update_taskaction, zone, &zone->updatetimer);
dns_catz_update_action, zone, &zone->updatetimer);
isc_timer_start(zone->updatetimer, isc_timertype_once, &interval);
}
@@ -1011,7 +990,6 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
if (isc_refcount_decrement(&catzs->refs) == 1) {
catzs->magic = 0;
isc_task_detach(&catzs->updater);
isc_mutex_destroy(&catzs->lock);
if (catzs->zones != NULL) {
isc_ht_iter_t *iter = NULL;
@@ -2024,7 +2002,7 @@ cleanup:
}
void
dns_catz_update_taskaction(void *arg) {
dns_catz_update_action(void *arg) {
isc_result_t result;
dns_catz_zone_t *zone = arg;

View File

@@ -309,9 +309,7 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *zone, dns_catz_entry_t *entry,
/* xxxwpk TODO config! */
typedef isc_result_t (*dns_catz_zoneop_fn_t)(dns_catz_entry_t *entry,
dns_catz_zone_t *origin,
dns_view_t *view,
isc_taskmgr_t *taskmgr,
void *udata);
dns_view_t *view, void *udata);
struct dns_catz_zonemodmethods {
dns_catz_zoneop_fn_t addzone;
dns_catz_zoneop_fn_t modzone;
@@ -319,10 +317,9 @@ struct dns_catz_zonemodmethods {
void *udata;
};
isc_result_t
void
dns_catz_new_zones(dns_catz_zones_t **catzsp, dns_catz_zonemodmethods_t *zmm,
isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
isc_loopmgr_t *loopmgr);
isc_mem_t *mctx, isc_loopmgr_t *loopmgr);
/*%<
* Allocate a new catz_zones object, a collection storing all catalog zones
* for a view.
@@ -390,8 +387,8 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg);
/*%<
* Callback for update of catalog zone database.
* If there was no catalog zone update recently it launches an
* update_taskaction immediately.
* If there was an update recently it schedules update_taskaction for some time
* update action immediately.
* If there was an update recently it schedules update for some time
* in the future.
* If there is an update scheduled it replaces old db version with a new one.
*
@@ -401,7 +398,7 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg);
*/
void
dns_catz_update_taskaction(void *arg);
dns_catz_update_action(void *arg);
/*%<
* Task that launches dns_catz_update_from_db.
*