CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, ¶m_obj));
- CHECK(check_syntax(param_obj, cfg, mctx, aclctx));
-
CHECK(parse_filter_a_on(param_obj, "filter-a-on-v6", &inst->v6_a));
CHECK(parse_filter_a_on(param_obj, "filter-a-on-v4", &inst->v4_a));
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
- unsigned long cfg_line, isc_mem_t *mctx, void *aclctx) {
+ unsigned long cfg_line, isc_mem_t *mctx, void *aclctx,
+ ns_hooksource_t source ISC_ATTR_UNUSED) {
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, ¶m_obj));
- CHECK(check_syntax(param_obj, cfg, mctx, aclctx));
-
CHECK(parse_filter_aaaa_on(param_obj, "filter-aaaa-on-v4",
&inst->v4_aaaa));
CHECK(parse_filter_aaaa_on(param_obj, "filter-aaaa-on-v6",
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
- unsigned long cfg_line, isc_mem_t *mctx, void *aclctx) {
+ unsigned long cfg_line, isc_mem_t *mctx, void *aclctx,
+ ns_hooksource_t source ISC_ATTR_UNUSED) {
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
- unsigned long cfg_line, isc_mem_t *mctx, void *aclctx) {
+ unsigned long cfg_line, isc_mem_t *mctx, void *aclctx,
+ ns_hooksource_t source) {
UNUSED(parameters);
UNUSED(cfg);
UNUSED(cfg_file);
UNUSED(cfg_line);
UNUSED(mctx);
UNUSED(aclctx);
+ UNUSED(source);
return ISC_R_SUCCESS;
}
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfgfile,
- unsigned long cfgline, isc_mem_t *mctx, void *aclctx) {
+ unsigned long cfgline, isc_mem_t *mctx, void *aclctx,
+ ns_hooksource_t source) {
UNUSED(parameters);
UNUSED(cfg);
UNUSED(cfgfile);
UNUSED(cfgline);
UNUSED(mctx);
UNUSED(aclctx);
+ UNUSED(source);
return ISC_R_SUCCESS;
}
struct check_one_plugin_data {
isc_mem_t *mctx;
cfg_aclconfctx_t *aclctx;
+ ns_hooksource_t source;
isc_result_t *check_result;
};
result = ns_plugin_check(full_path, parameters, config,
cfg_obj_file(obj), cfg_obj_line(obj),
- data->mctx, data->aclctx);
+ data->mctx, data->aclctx, data->source);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, ISC_LOG_ERROR, "%s: plugin check failed: %s",
full_path, isc_result_totext(result));
static isc_result_t
check_plugins(const cfg_obj_t *plugins, const cfg_obj_t *config,
- cfg_aclconfctx_t *aclctx, isc_mem_t *mctx) {
+ cfg_aclconfctx_t *aclctx, ns_hooksource_t source,
+ isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
struct check_one_plugin_data check_one_plugin_data = {
.mctx = mctx,
.aclctx = aclctx,
+ .source = source,
.check_result = &result,
};
const cfg_obj_t *plugins = NULL;
(void)cfg_map_get(zoptions, "plugin", &plugins);
- tresult = check_plugins(plugins, config, aclctx, mctx);
+ tresult = check_plugins(plugins, config, aclctx,
+ NS_HOOKSOURCE_ZONE, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
(void)cfg_map_get(config, "plugin", &plugins);
}
- tresult = check_plugins(plugins, config, aclctx, mctx);
+ tresult = check_plugins(plugins, config, aclctx,
+ NS_HOOKSOURCE_VIEW, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
"registering plugin '%s'", modpath);
INSIST(hookdata->source != NS_HOOKSOURCE_UNDEFINED);
+
+ CHECK(plugin->check_func(parameters, cfg, cfg_file, cfg_line, mctx,
+ aclctx, hookdata->source));
CHECK(plugin->register_func(parameters, cfg, cfg_file, cfg_line, mctx,
aclctx, hookdata->hooktable,
hookdata->source, &plugin->inst));
isc_result_t
ns_plugin_check(const char *modpath, const char *parameters, const void *cfg,
const char *cfg_file, unsigned long cfg_line, isc_mem_t *mctx,
- void *aclctx) {
+ void *aclctx, ns_hooksource_t source) {
isc_result_t result;
ns_plugin_t *plugin = NULL;
CHECK(load_plugin(mctx, modpath, &plugin));
result = plugin->check_func(parameters, cfg, cfg_file, cfg_line, mctx,
- aclctx);
+ aclctx, source);
cleanup:
if (plugin != NULL) {
* as well; if not, set NS_PLUGIN_AGE to 0.
*/
#ifndef NS_PLUGIN_VERSION
-#define NS_PLUGIN_VERSION 2
+#define NS_PLUGIN_VERSION 3
#define NS_PLUGIN_AGE 0
#endif /* ifndef NS_PLUGIN_VERSION */
typedef isc_result_t
ns_plugin_check_t(const char *parameters, const void *cfg, const char *file,
- unsigned long line, isc_mem_t *mctx, void *aclctx);
+ unsigned long line, isc_mem_t *mctx, void *aclctx,
+ ns_hooksource_t source);
/*%<
* Check the validity of 'parameters'.
*/
isc_result_t
ns_plugin_check(const char *modpath, const char *parameters, const void *cfg,
const char *cfg_file, unsigned long cfg_line, isc_mem_t *mctx,
- void *aclctx);
+ void *aclctx, ns_hooksource_t source);
/*%<
* Open the plugin module at 'modpath' and check the validity of
* 'parameters', logging any errors or warnings found, then