Commit fd20f10d authored by Evan Hunt's avatar Evan Hunt

name change from "hook modules" to "plugins"

- "hook" is now used only for hook points and hook actions
- the "hook" statement in named.conf is now "plugin"
- ns_module and ns_modlist are now ns_plugin and ns_plugins
- ns_module_load is renamed ns_plugin_register
- the mandatory functions in plugin modules (hook_register,
  hook_check, hook_version, hook_destroy) have been renamed
parent 8da0c0e7
......@@ -12,7 +12,7 @@ VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen \
@NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ hooks tests
@NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ plugins tests
TARGETS =
@BIND9_MAKE_RULES@
......@@ -46,7 +46,7 @@
static const char *program = "named-checkconf";
static bool loadhooks = true;
static bool loadplugins = true;
isc_log_t *logc = NULL;
......@@ -590,7 +590,7 @@ main(int argc, char **argv) {
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != EOF) {
switch (c) {
case 'c':
loadhooks = false;
loadplugins = false;
break;
case 'd':
......@@ -683,7 +683,7 @@ main(int argc, char **argv) {
ISC_R_SUCCESS)
exit(1);
result = bind9_check_namedconf(config, loadhooks, logc, mctx);
result = bind9_check_namedconf(config, loadplugins, logc, mctx);
if (result != ISC_R_SUCCESS) {
exit_status = 1;
}
......
......@@ -119,8 +119,8 @@
<listitem>
<para>
Check "core" configuration only. This suppresses the loading
of hook modules, and causes all parameters to
<command>hook</command> statements to be ignored.
of plugin modules, and causes all parameters to
<command>plugin</command> statements to be ignored.
</para>
</listitem>
</varlistentry>
......
......@@ -1537,35 +1537,35 @@ configure_dyndb(const cfg_obj_t *dyndb, isc_mem_t *mctx,
}
static isc_result_t
configure_hook(dns_view_t *view, const cfg_obj_t *hook,
const cfg_obj_t *config)
configure_plugin(dns_view_t *view, const cfg_obj_t *plugin,
const cfg_obj_t *config)
{
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *obj;
const char *type, *library;
const char *parameters = NULL;
/* Get the path to the hook module. */
obj = cfg_tuple_get(hook, "type");
/* Get the path to the plugin module. */
obj = cfg_tuple_get(plugin, "type");
type = cfg_obj_asstring(obj);
/* Only query hooks are supported currently. */
/* Only query plugins are supported currently. */
if (strcasecmp(type, "query") != 0) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR,
"unsupported hook type");
"unsupported plugin type");
return (ISC_R_FAILURE);
}
library = cfg_obj_asstring(cfg_tuple_get(hook, "library"));
library = cfg_obj_asstring(cfg_tuple_get(plugin, "library"));
obj = cfg_tuple_get(hook, "parameters");
obj = cfg_tuple_get(plugin, "parameters");
if (obj != NULL && cfg_obj_isstring(obj)) {
parameters = cfg_obj_asstring(obj);
}
result = ns_module_load(library, parameters,
config, cfg_obj_file(obj), cfg_obj_line(obj),
named_g_mctx, named_g_lctx, named_g_aclconfctx,
view);
result = ns_plugin_register(library, parameters, config,
cfg_obj_file(obj), cfg_obj_line(obj),
named_g_mctx, named_g_lctx,
named_g_aclconfctx, view);
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
......@@ -3714,7 +3714,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
const cfg_obj_t *dlvobj = NULL;
unsigned int dlzargc;
char **dlzargv;
const cfg_obj_t *dyndb_list, *hook_list;
const cfg_obj_t *dyndb_list, *plugin_list;
const cfg_obj_t *disabled;
const cfg_obj_t *obj, *obj2;
const cfg_listelt_t *element;
......@@ -5296,33 +5296,33 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
#endif
/*
* Load hook modules.
* Load plugins.
*/
hook_list = NULL;
plugin_list = NULL;
if (voptions != NULL) {
(void)cfg_map_get(voptions, "hook", &hook_list);
(void)cfg_map_get(voptions, "plugin", &plugin_list);
} else {
(void)cfg_map_get(config, "hook", &hook_list);
(void)cfg_map_get(config, "plugin", &plugin_list);
}
#ifdef HAVE_DLOPEN
if (hook_list != NULL) {
if (plugin_list != NULL) {
INSIST(view->hooktable == NULL);
CHECK(ns_hooktable_create(view->mctx,
(ns_hooktable_t **) &view->hooktable));
view->hooktable_free = ns_hooktable_free;
ns_modlist_create(view->mctx, (ns_modlist_t **)&view->modlist);
view->modlist_free = ns_modlist_free;
ns_plugins_create(view->mctx, (ns_plugins_t **)&view->plugins);
view->plugins_free = ns_plugins_free;
}
for (element = cfg_list_first(hook_list);
for (element = cfg_list_first(plugin_list);
element != NULL;
element = cfg_list_next(element))
{
const cfg_obj_t *hook = cfg_listelt_value(element);
const cfg_obj_t *plugin = cfg_listelt_value(element);
CHECK(configure_hook(view, hook, config));
CHECK(configure_plugin(view, plugin, config));
}
#endif
......@@ -8097,7 +8097,7 @@ load_configuration(const char *filename, named_server_t *server,
/*
* Check the validity of the configuration.
*
* (Ignore hook module parameters for now; they will be
* (Ignore plugin parameters for now; they will be
* checked later when the modules are actually loaded and
* registered.)
*/
......
......@@ -78,7 +78,7 @@ typedef struct filter_data {
} filter_data_t;
typedef struct filter_instance {
ns_module_t *module;
ns_plugin_t *module;
isc_mem_t *mctx;
/*
......@@ -337,22 +337,23 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
}
/**
** Mandatory hook API functions:
** Mandatory plugin API functions:
**
** - hook_destroy
** - hook_register
** - hook_version
** - plugin_destroy
** - plugin_register
** - plugin_version
** - plugin_check
**/
/*
* Called by ns_module_load() to register hook functions into
* a hook table.
* Called by ns_plugin_register() to initialize the plugin and
* register hook functions into the view hook table.
*/
isc_result_t
hook_register(const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
ns_hooktable_t *hooktable, void **instp)
plugin_register(const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
ns_hooktable_t *hooktable, void **instp)
{
filter_instance_t *inst = NULL;
isc_result_t result;
......@@ -399,16 +400,16 @@ hook_register(const char *parameters,
cleanup:
if (result != ISC_R_SUCCESS && inst != NULL) {
hook_destroy((void **) &inst);
plugin_destroy((void **) &inst);
}
return (result);
}
isc_result_t
hook_check(const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx)
plugin_check(const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, isc_log_t *lctx, void *actx)
{
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
......@@ -435,11 +436,11 @@ hook_check(const char *parameters,
}
/*
* Called by ns_module_unload(); frees memory allocated by
* Called by ns_plugins_free(); frees memory allocated by
* the module when it was registered.
*/
void
hook_destroy(void **instp) {
plugin_destroy(void **instp) {
filter_instance_t *inst = (filter_instance_t *) *instp;
if (inst->ht != NULL) {
......@@ -462,8 +463,8 @@ hook_destroy(void **instp) {
* Returns hook module API version for compatibility checks.
*/
int
hook_version(void) {
return (NS_HOOK_VERSION);
plugin_version(void) {
return (NS_PLUGIN_VERSION);
}
/**
......
......@@ -38,14 +38,14 @@
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>hook query "filter-aaaa.so"</command>
<command>plugin query "filter-aaaa.so"</command>
<arg choice="opt" rep="norepeat"><replaceable class="parameter">{ parameters }</replaceable></arg>;
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para>
<command>filter-aaaa.so</command> is a query hook module for
<command>filter-aaaa.so</command> is a query plugin module for
<command>named</command>, enabling <command>named</command>
to omit some IPv6 addresses when responding to clients.
</para>
......@@ -57,10 +57,10 @@
<command>filter-aaaa-on-v6</command> options. These options are
now deprecated in <filename>named.conf</filename>, but can be
passed as parameters to the <command>filter-aaaa.so</command>
hook module, for example:
plugin, for example:
</para>
<programlisting>
hook query "/usr/local/lib/filter-aaaa.so" {
plugin query "/usr/local/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa-on-v6 yes;
filter-aaaa { 192.0.2.1; 2001:db8:2::1; };
......
......@@ -9,7 +9,7 @@
* information regarding copyright ownership.
*/
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa { none; };
};
......@@ -9,7 +9,7 @@
* information regarding copyright ownership.
*/
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
/*
* While this matches the defaults, it is not a good configuration
* to have in named.conf as the two options contradict each other
......
......@@ -10,7 +10,7 @@
*/
view myview {
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 no;
filter-aaaa { any; };
};
......
......@@ -10,7 +10,7 @@
*/
view myview {
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa { none; };
};
......
......@@ -9,6 +9,6 @@
* information regarding copyright ownership.
*/
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
};
......@@ -9,6 +9,6 @@
* information regarding copyright ownership.
*/
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 break-dnssec;
};
......@@ -9,7 +9,7 @@
* information regarding copyright ownership.
*/
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 break-dnssec;
filter-aaaa { 1.0.0.0/8; };
};
......@@ -9,7 +9,7 @@
* information regarding copyright ownership.
*/
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa { 1.0.0.0/8; };
};
......@@ -10,7 +10,7 @@
*/
view myview {
hook query "../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa { 1.0.0.0/8; };
};
......
......@@ -25,7 +25,7 @@ options {
acl filterees { 10.53.0.1; };
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa { filterees; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v6 yes;
filter-aaaa { fd92:7065:b8e:ffff::1; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 yes;
filter-aaaa { 10.53.0.2; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v6 yes;
filter-aaaa { fd92:7065:b8e:ffff::2; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 break-dnssec;
filter-aaaa { 10.53.0.3; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v6 break-dnssec;
filter-aaaa { fd92:7065:b8e:ffff::3; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 break-dnssec;
filter-aaaa { 10.53.0.4; };
};
......
......@@ -23,7 +23,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v6 break-dnssec;
filter-aaaa { fd92:7065:b8e:ffff::4; };
};
......
......@@ -28,7 +28,7 @@ options {
minimal-responses no;
};
hook query "../../../../hooks/lib/filter-aaaa.so" {
plugin query "../../../../plugins/lib/filter-aaaa.so" {
filter-aaaa-on-v4 break-dnssec;
filter-aaaa { any; };
};
......
......@@ -21548,7 +21548,7 @@ ac_config_commands="$ac_config_commands chmod"
# elsewhere if there's a good reason for doing so.
#
ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/hooks/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/pthreads/Makefile lib/isc/pthreads/include/Makefile lib/isc/pthreads/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccc/tests/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/unittest.sh fuzz/Makefile"
ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/pthreads/Makefile lib/isc/pthreads/include/Makefile lib/isc/pthreads/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/nls/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccc/tests/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/unittest.sh fuzz/Makefile"
#
......@@ -22558,11 +22558,11 @@ do
"bin/delv/Makefile") CONFIG_FILES="$CONFIG_FILES bin/delv/Makefile" ;;
"bin/dig/Makefile") CONFIG_FILES="$CONFIG_FILES bin/dig/Makefile" ;;
"bin/dnssec/Makefile") CONFIG_FILES="$CONFIG_FILES bin/dnssec/Makefile" ;;
"bin/hooks/Makefile") CONFIG_FILES="$CONFIG_FILES bin/hooks/Makefile" ;;
"bin/named/Makefile") CONFIG_FILES="$CONFIG_FILES bin/named/Makefile" ;;
"bin/named/unix/Makefile") CONFIG_FILES="$CONFIG_FILES bin/named/unix/Makefile" ;;
"bin/nsupdate/Makefile") CONFIG_FILES="$CONFIG_FILES bin/nsupdate/Makefile" ;;
"bin/pkcs11/Makefile") CONFIG_FILES="$CONFIG_FILES bin/pkcs11/Makefile" ;;
"bin/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES bin/plugins/Makefile" ;;
"bin/python/Makefile") CONFIG_FILES="$CONFIG_FILES bin/python/Makefile" ;;
"bin/python/isc/Makefile") CONFIG_FILES="$CONFIG_FILES bin/python/isc/Makefile" ;;
"bin/python/isc/utils.py") CONFIG_FILES="$CONFIG_FILES bin/python/isc/utils.py" ;;
......
......@@ -2957,11 +2957,11 @@ AC_CONFIG_FILES([
bin/delv/Makefile
bin/dig/Makefile
bin/dnssec/Makefile
bin/hooks/Makefile
bin/named/Makefile
bin/named/unix/Makefile
bin/nsupdate/Makefile
bin/pkcs11/Makefile
bin/plugins/Makefile
bin/python/Makefile
bin/python/isc/Makefile
bin/python/isc/utils.py
......
......@@ -18276,7 +18276,7 @@ allow-query { !{ !10/8; any; }; key example; };
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/dnssec/dnssec-signzone.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/dnssec/dnssec-verify.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/tools/dnstap-read.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/hooks/filter-aaaa.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/plugins/filter-aaaa.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/dig/host.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/tools/mdig.docbook"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../bin/check/named-checkconf.docbook"/>
......
......@@ -3351,7 +3351,7 @@ check_rpz_catz(const char *rpz_catz, const cfg_obj_t *rpz_obj,
static isc_result_t
check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
const char *viewname, dns_rdataclass_t vclass,
isc_symtab_t *files, bool checkhooks, isc_symtab_t *inview,
isc_symtab_t *files, bool check_plugins, isc_symtab_t *inview,
isc_log_t *logctx, isc_mem_t *mctx)
{
const cfg_obj_t *zones = NULL;
......@@ -3367,7 +3367,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
const cfg_obj_t *obj;
const cfg_obj_t *options = NULL;
const cfg_obj_t *opts = NULL;
const cfg_obj_t *hook_list = NULL;
const cfg_obj_t *plugin_list = NULL;
bool enablednssec, enablevalidation;
const char *valstr = "no";
unsigned int tflags, mflags;
......@@ -3666,44 +3666,44 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
result = tresult;
/*
* Load hook modules.
* Load plugins.
*/
if (checkhooks) {
if (check_plugins) {
if (voptions != NULL) {
(void)cfg_map_get(voptions, "hook", &hook_list);
(void)cfg_map_get(voptions, "plugin", &plugin_list);
} else {
(void)cfg_map_get(config, "hook", &hook_list);
(void)cfg_map_get(config, "plugin", &plugin_list);
}
}
#ifdef HAVE_DLOPEN
for (element = cfg_list_first(hook_list);
for (element = cfg_list_first(plugin_list);
element != NULL;
element = cfg_list_next(element))
{
const cfg_obj_t *hook = cfg_listelt_value(element);
const cfg_obj_t *plugin = cfg_listelt_value(element);
const char *type, *library;
const char *parameters = NULL;
/* Get the path to the hook module. */
obj = cfg_tuple_get(hook, "type");
/* Get the path to the plugin module. */
obj = cfg_tuple_get(plugin, "type");
type = cfg_obj_asstring(obj);
/* Only query hooks are supported currently. */
/* Only query plugins are supported currently. */
if (strcasecmp(type, "query") != 0) {
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
"unsupported hook type");
"unsupported plugin type");
return (ISC_R_FAILURE);
}
library = cfg_obj_asstring(cfg_tuple_get(hook, "library"));
library = cfg_obj_asstring(cfg_tuple_get(plugin, "library"));
obj = cfg_tuple_get(hook, "parameters");
obj = cfg_tuple_get(plugin, "parameters");
if (obj != NULL && cfg_obj_isstring(obj)) {
parameters = cfg_obj_asstring(obj);
}
tresult = ns_module_check(library, parameters, config,
tresult = ns_plugin_check(library, parameters, config,
cfg_obj_file(obj), cfg_obj_line(obj),
mctx, logctx, actx);
if (tresult != ISC_R_SUCCESS) {
......@@ -3969,7 +3969,7 @@ bind9_check_controls(const cfg_obj_t *config, isc_log_t *logctx,
}
isc_result_t
bind9_check_namedconf(const cfg_obj_t *config, bool hooks,
bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
isc_log_t *logctx, isc_mem_t *mctx)
{
const cfg_obj_t *options = NULL;
......@@ -4028,13 +4028,13 @@ bind9_check_namedconf(const cfg_obj_t *config, bool hooks,
if (views == NULL) {
tresult = check_viewconf(config, NULL, NULL,
dns_rdataclass_in, files,
hooks, inview, logctx, mctx);
check_plugins, inview, logctx, mctx);
if (result == ISC_R_SUCCESS && tresult != ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
}
} else {
const cfg_obj_t *zones = NULL;
const cfg_obj_t *hooks = NULL;
const cfg_obj_t *plugins = NULL;
(void)cfg_map_get(config, "zone", &zones);
if (zones != NULL) {
......@@ -4044,11 +4044,11 @@ bind9_check_namedconf(const cfg_obj_t *config, bool hooks,
result = ISC_R_FAILURE;
}
(void)cfg_map_get(config, "hook", &hooks);
if (hooks != NULL) {
cfg_obj_log(hooks, logctx, ISC_LOG_ERROR,
(void)cfg_map_get(config, "plugin", &plugins);
if (plugins != NULL) {
cfg_obj_log(plugins, logctx, ISC_LOG_ERROR,
"when using 'view' statements, "
"all hooks must be defined in views");
"all plugins must be defined in views");
result = ISC_R_FAILURE;
}
}
......@@ -4115,7 +4115,7 @@ bind9_check_namedconf(const cfg_obj_t *config, bool hooks,
}
if (tresult == ISC_R_SUCCESS)
tresult = check_viewconf(config, voptions, key,
vclass, files, hooks,
vclass, files, check_plugins,
inview, logctx, mctx);
if (tresult != ISC_R_SUCCESS)
result = ISC_R_FAILURE;
......
......@@ -35,13 +35,13 @@
ISC_LANG_BEGINDECLS
isc_result_t
bind9_check_namedconf(const cfg_obj_t *config, bool check_hooks,
bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
isc_log_t *logctx, isc_mem_t *mctx);
/*%<
* Check the syntactic validity of a configuration parse tree generated from
* a named.conf file.
*
* If 'check_hooks' is true, load hook modules and check the validity of their
* If 'check_plugins' is true, load plugins and check the validity of their
* parameters as well.
*
* Requires:
......
......@@ -237,8 +237,8 @@ struct dns_view {
to log */
/* Registered module instances */
void *modlist;
void (*modlist_free)(isc_mem_t *, void **);
void *plugins;
void (*plugins_free)(isc_mem_t *, void **);
/* Hook table */
void *hooktable; /* ns_hooktable */
......
......@@ -256,8 +256,8 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
view->dtenv = NULL;
view->dttypes = 0;
view->modlist = NULL;
view->modlist_free = NULL;
view->plugins = NULL;
view->plugins_free = NULL;
view->hooktable = NULL;
view->hooktable_free = NULL;
......@@ -553,8 +553,8 @@ destroy(dns_view_t *view) {
if (view->hooktable != NULL && view->hooktable_free != NULL) {
view->hooktable_free(view->mctx, &view->hooktable);
}
if (view->modlist != NULL && view->modlist_free != NULL) {
view->modlist_free(view->mctx, &view->modlist);
if (view->plugins != NULL && view->plugins_free != NULL) {
view->plugins_free(view->mctx, &view->plugins);
}