mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-21 14:17:27 -04:00
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
This commit is contained in:
parent
8da0c0e7d5
commit
fd20f10d52
42 changed files with 309 additions and 296 deletions
|
|
@ -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; };
|
||||
};
|
||||
|
|
|
|||
4
configure
vendored
4
configure
vendored
|
|
@ -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);
|
||||
}
|
||||
isc_mem_putanddetach(&view->mctx, view, sizeof(*view));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ static cfg_type_t cfg_type_dlz;
|
|||
static cfg_type_t cfg_type_dnstap;
|
||||
static cfg_type_t cfg_type_dnstapoutput;
|
||||
static cfg_type_t cfg_type_dyndb;
|
||||
static cfg_type_t cfg_type_hook;
|
||||
static cfg_type_t cfg_type_plugin;
|
||||
static cfg_type_t cfg_type_ixfrdifftype;
|
||||
static cfg_type_t cfg_type_key;
|
||||
static cfg_type_t cfg_type_logfile;
|
||||
|
|
@ -996,7 +996,7 @@ namedconf_or_view_clauses[] = {
|
|||
{ "dyndb", &cfg_type_dyndb, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "managed-keys", &cfg_type_managedkeys, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "hook", &cfg_type_hook, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "plugin", &cfg_type_plugin, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "trusted-keys", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI },
|
||||
{ "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
|
||||
|
|
@ -2385,26 +2385,26 @@ static cfg_type_t cfg_type_dyndb = {
|
|||
};
|
||||
|
||||
/*%
|
||||
* The "hook" statement syntax.
|
||||
* Currently only one hook type is supported: query.
|
||||
* The "plugin" statement syntax.
|
||||
* Currently only one plugin type is supported: query.
|
||||
*/
|
||||
|
||||
static const char *hook_enums[] = {
|
||||
static const char *plugin_enums[] = {
|
||||
"query", NULL
|
||||
};
|
||||
static cfg_type_t cfg_type_hooktype = {
|
||||
"hooktype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
|
||||
&cfg_rep_string, hook_enums
|
||||
static cfg_type_t cfg_type_plugintype = {
|
||||
"plugintype", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum,
|
||||
&cfg_rep_string, plugin_enums
|
||||
};
|
||||
static cfg_tuplefielddef_t hook_fields[] = {
|
||||
{ "type", &cfg_type_hooktype, 0 },
|
||||
static cfg_tuplefielddef_t plugin_fields[] = {
|
||||
{ "type", &cfg_type_plugintype, 0 },
|
||||
{ "library", &cfg_type_astring, 0 },
|
||||
{ "parameters", &cfg_type_optional_bracketed_text, 0 },
|
||||
{ NULL, NULL, 0 }
|
||||
};
|
||||
static cfg_type_t cfg_type_hook = {
|
||||
"hook", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
|
||||
&cfg_rep_tuple, hook_fields
|
||||
static cfg_type_t cfg_type_plugin = {
|
||||
"plugin", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
|
||||
&cfg_rep_tuple, plugin_fields
|
||||
};
|
||||
|
||||
/*%
|
||||
|
|
|
|||
260
lib/ns/hooks.c
260
lib/ns/hooks.c
|
|
@ -44,15 +44,15 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
struct ns_module {
|
||||
struct ns_plugin {
|
||||
isc_mem_t *mctx;
|
||||
void *handle;
|
||||
void *inst;
|
||||
char *modpath;
|
||||
ns_hook_check_t *check_func;
|
||||
ns_hook_register_t *register_func;
|
||||
ns_hook_destroy_t *destroy_func;
|
||||
LINK(ns_module_t) link;
|
||||
ns_plugin_check_t *check_func;
|
||||
ns_plugin_register_t *register_func;
|
||||
ns_plugin_destroy_t *destroy_func;
|
||||
LINK(ns_plugin_t) link;
|
||||
};
|
||||
|
||||
static ns_hooklist_t default_hooktable[NS_HOOKPOINTS_COUNT];
|
||||
|
|
@ -85,7 +85,7 @@ load_symbol(void *handle, const char *modpath,
|
|||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"failed to look up symbol %s in "
|
||||
"hook module '%s': %s",
|
||||
"plugin '%s': %s",
|
||||
symbol_name, modpath, errmsg);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
|
@ -96,17 +96,17 @@ load_symbol(void *handle, const char *modpath,
|
|||
}
|
||||
|
||||
static isc_result_t
|
||||
load_library(isc_mem_t *mctx, const char *modpath, ns_module_t **hmodp) {
|
||||
load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
||||
isc_result_t result;
|
||||
void *handle = NULL;
|
||||
ns_module_t *hmod = NULL;
|
||||
ns_hook_check_t *check_func = NULL;
|
||||
ns_hook_register_t *register_func = NULL;
|
||||
ns_hook_destroy_t *destroy_func = NULL;
|
||||
ns_hook_version_t *version_func = NULL;
|
||||
ns_plugin_t *plugin = NULL;
|
||||
ns_plugin_check_t *check_func = NULL;
|
||||
ns_plugin_register_t *register_func = NULL;
|
||||
ns_plugin_destroy_t *destroy_func = NULL;
|
||||
ns_plugin_version_t *version_func = NULL;
|
||||
int version, flags;
|
||||
|
||||
REQUIRE(hmodp != NULL && *hmodp == NULL);
|
||||
REQUIRE(pluginp != NULL && *pluginp == NULL);
|
||||
|
||||
flags = RTLD_LAZY | RTLD_LOCAL;
|
||||
#ifdef RTLD_DEEPBIND
|
||||
|
|
@ -121,56 +121,57 @@ load_library(isc_mem_t *mctx, const char *modpath, ns_module_t **hmodp) {
|
|||
}
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"failed to dlopen() hook module '%s': %s",
|
||||
"failed to dlopen() plugin '%s': %s",
|
||||
modpath, errmsg);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
CHECK(load_symbol(handle, modpath, "hook_version",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_version",
|
||||
(void **)&version_func));
|
||||
|
||||
version = version_func();
|
||||
if (version < (NS_HOOK_VERSION - NS_HOOK_AGE) ||
|
||||
version > NS_HOOK_VERSION)
|
||||
if (version < (NS_PLUGIN_VERSION - NS_PLUGIN_AGE) ||
|
||||
version > NS_PLUGIN_VERSION)
|
||||
{
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"hook API version mismatch: %d/%d",
|
||||
version, NS_HOOK_VERSION);
|
||||
"plugin API version mismatch: %d/%d",
|
||||
version, NS_PLUGIN_VERSION);
|
||||
CHECK(ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
CHECK(load_symbol(handle, modpath, "hook_check",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_check",
|
||||
(void **)&check_func));
|
||||
CHECK(load_symbol(handle, modpath, "hook_register",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_register",
|
||||
(void **)®ister_func));
|
||||
CHECK(load_symbol(handle, modpath, "hook_destroy",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_destroy",
|
||||
(void **)&destroy_func));
|
||||
|
||||
hmod = isc_mem_get(mctx, sizeof(*hmod));
|
||||
memset(hmod, 0, sizeof(*hmod));
|
||||
isc_mem_attach(mctx, &hmod->mctx);
|
||||
hmod->handle = handle;
|
||||
hmod->modpath = isc_mem_strdup(hmod->mctx, modpath);
|
||||
hmod->check_func = check_func;
|
||||
hmod->register_func = register_func;
|
||||
hmod->destroy_func = destroy_func;
|
||||
plugin = isc_mem_get(mctx, sizeof(*plugin));
|
||||
memset(plugin, 0, sizeof(*plugin));
|
||||
isc_mem_attach(mctx, &plugin->mctx);
|
||||
plugin->handle = handle;
|
||||
plugin->modpath = isc_mem_strdup(plugin->mctx, modpath);
|
||||
plugin->check_func = check_func;
|
||||
plugin->register_func = register_func;
|
||||
plugin->destroy_func = destroy_func;
|
||||
|
||||
ISC_LINK_INIT(hmod, link);
|
||||
ISC_LINK_INIT(plugin, link);
|
||||
|
||||
*hmodp = hmod;
|
||||
hmod = NULL;
|
||||
*pluginp = plugin;
|
||||
plugin = NULL;
|
||||
|
||||
cleanup:
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"failed to dynamically load "
|
||||
"module '%s': %s", modpath,
|
||||
"plugin '%s': %s", modpath,
|
||||
isc_result_totext(result));
|
||||
|
||||
if (hmod != NULL) {
|
||||
isc_mem_putanddetach(&hmod->mctx, hmod, sizeof(*hmod));
|
||||
if (plugin != NULL) {
|
||||
isc_mem_putanddetach(&plugin->mctx, plugin,
|
||||
sizeof(*plugin));
|
||||
}
|
||||
|
||||
if (handle != NULL) {
|
||||
|
|
@ -182,29 +183,29 @@ cleanup:
|
|||
}
|
||||
|
||||
static void
|
||||
unload_library(ns_module_t **hmodp) {
|
||||
ns_module_t *hmod = NULL;
|
||||
unload_plugin(ns_plugin_t **pluginp) {
|
||||
ns_plugin_t *plugin = NULL;
|
||||
|
||||
REQUIRE(hmodp != NULL && *hmodp != NULL);
|
||||
REQUIRE(pluginp != NULL && *pluginp != NULL);
|
||||
|
||||
hmod = *hmodp;
|
||||
*hmodp = NULL;
|
||||
plugin = *pluginp;
|
||||
*pluginp = NULL;
|
||||
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
|
||||
"unloading module '%s'", hmod->modpath);
|
||||
"unloading plugin '%s'", plugin->modpath);
|
||||
|
||||
if (hmod->inst != NULL) {
|
||||
hmod->destroy_func(&hmod->inst);
|
||||
if (plugin->inst != NULL) {
|
||||
plugin->destroy_func(&plugin->inst);
|
||||
}
|
||||
if (hmod->handle != NULL) {
|
||||
(void) dlclose(hmod->handle);
|
||||
if (plugin->handle != NULL) {
|
||||
(void) dlclose(plugin->handle);
|
||||
}
|
||||
if (hmod->modpath != NULL) {
|
||||
isc_mem_free(hmod->mctx, hmod->modpath);
|
||||
if (plugin->modpath != NULL) {
|
||||
isc_mem_free(plugin->mctx, plugin->modpath);
|
||||
}
|
||||
|
||||
isc_mem_putanddetach(&hmod->mctx, hmod, sizeof(*hmod));
|
||||
isc_mem_putanddetach(&plugin->mctx, plugin, sizeof(*plugin));
|
||||
}
|
||||
#elif _WIN32
|
||||
static isc_result_t
|
||||
|
|
@ -222,7 +223,7 @@ load_symbol(HMODULE handle, const char *modpath,
|
|||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"failed to look up symbol %s in "
|
||||
"module '%s': %d",
|
||||
"plugin '%s': %d",
|
||||
symbol_name, modpath, errstatus);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
|
@ -233,64 +234,65 @@ load_symbol(HMODULE handle, const char *modpath,
|
|||
}
|
||||
|
||||
static isc_result_t
|
||||
load_library(isc_mem_t *mctx, const char *modpath, ns_module_t **hmodp) {
|
||||
load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
||||
isc_result_t result;
|
||||
HMODULE handle;
|
||||
ns_module_t *hmod = NULL;
|
||||
ns_hook_register_t *register_func = NULL;
|
||||
ns_hook_destroy_t *destroy_func = NULL;
|
||||
ns_hook_version_t *version_func = NULL;
|
||||
ns_plugin_t *plugin = NULL;
|
||||
ns_plugin_register_t *register_func = NULL;
|
||||
ns_plugin_destroy_t *destroy_func = NULL;
|
||||
ns_plugin_version_t *version_func = NULL;
|
||||
int version;
|
||||
|
||||
REQUIRE(hmodp != NULL && *hmodp == NULL);
|
||||
REQUIRE(pluginp != NULL && *pluginp == NULL);
|
||||
|
||||
handle = LoadLibraryA(modpath);
|
||||
if (handle == NULL) {
|
||||
CHECK(ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
CHECK(load_symbol(handle, modpath, "hook_version",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_version",
|
||||
(void **)&version_func));
|
||||
|
||||
version = version_func(NULL);
|
||||
if (version < (NS_HOOK_VERSION - NS_HOOK_AGE) ||
|
||||
version > NS_HOOK_VERSION)
|
||||
if (version < (NS_PLUGIN_VERSION - NS_PLUGIN_AGE) ||
|
||||
version > NS_PLUGIN_VERSION)
|
||||
{
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"hook API version mismatch: %d/%d",
|
||||
version, NS_HOOK_VERSION);
|
||||
"plugin API version mismatch: %d/%d",
|
||||
version, NS_PLUGIN_VERSION);
|
||||
CHECK(ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
CHECK(load_symbol(handle, modpath, "hook_register",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_register",
|
||||
(void **)®ister_func));
|
||||
CHECK(load_symbol(handle, modpath, "hook_destroy",
|
||||
CHECK(load_symbol(handle, modpath, "plugin_destroy",
|
||||
(void **)&destroy_func));
|
||||
|
||||
hmod = isc_mem_get(mctx, sizeof(*hmod));
|
||||
memset(hmod, 0, sizeof(*hmod));
|
||||
isc_mem_attach(mctx, &hmod->mctx);
|
||||
hmod->handle = handle;
|
||||
hmod->modpath = isc_mem_strdup(hmod->mctx, modpath);
|
||||
hmod->register_func = register_func;
|
||||
hmod->destroy_func = destroy_func;
|
||||
plugin = isc_mem_get(mctx, sizeof(*plugin));
|
||||
memset(plugin, 0, sizeof(*plugin));
|
||||
isc_mem_attach(mctx, &plugin->mctx);
|
||||
plugin->handle = handle;
|
||||
plugin->modpath = isc_mem_strdup(plugin->mctx, modpath);
|
||||
plugin->register_func = register_func;
|
||||
plugin->destroy_func = destroy_func;
|
||||
|
||||
ISC_LINK_INIT(hmod, link);
|
||||
ISC_LINK_INIT(plugin, link);
|
||||
|
||||
*hmodp = hmod;
|
||||
hmod = NULL;
|
||||
*pluginp = plugin;
|
||||
plugin = NULL;
|
||||
|
||||
cleanup:
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"failed to dynamically load "
|
||||
"hook module '%s': %d (%s)", modpath,
|
||||
"plugin '%s': %d (%s)", modpath,
|
||||
GetLastError(), isc_result_totext(result));
|
||||
|
||||
if (hmod != NULL) {
|
||||
isc_mem_putanddetach(&hmod->mctx, hmod, sizeof(*hmod));
|
||||
if (plugin != NULL) {
|
||||
isc_mem_putanddetach(&plugin->mctx, plugin,
|
||||
sizeof(*plugin));
|
||||
}
|
||||
|
||||
if (handle != NULL) {
|
||||
|
|
@ -302,58 +304,60 @@ cleanup:
|
|||
}
|
||||
|
||||
static void
|
||||
unload_library(ns_module_t **hmodp) {
|
||||
ns_module_t *hmod = NULL;
|
||||
unload_plugin(ns_plugin_t **pluginp) {
|
||||
ns_plugin_t *plugin = NULL;
|
||||
|
||||
REQUIRE(hmodp != NULL && *hmodp != NULL);
|
||||
REQUIRE(pluginp != NULL && *pluginp != NULL);
|
||||
|
||||
hmod = *hmodp;
|
||||
*hmodp = NULL;
|
||||
plugin = *pluginp;
|
||||
*pluginp = NULL;
|
||||
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
|
||||
"unloading module '%s'", hmod->modpath);
|
||||
"unloading plugin '%s'", plugin->modpath);
|
||||
|
||||
if (hmod->inst != NULL) {
|
||||
hmod->destroy_func(&hmod->inst);
|
||||
if (plugin->inst != NULL) {
|
||||
plugin->destroy_func(&plugin->inst);
|
||||
}
|
||||
if (hmod->handle != NULL) {
|
||||
FreeLibrary(hmod->handle);
|
||||
if (plugin->handle != NULL) {
|
||||
FreeLibrary(plugin->handle);
|
||||
}
|
||||
|
||||
if (hmod->modpath != NULL) {
|
||||
isc_mem_free(hmod->mctx, hmod->modpath);
|
||||
if (plugin->modpath != NULL) {
|
||||
isc_mem_free(plugin->mctx, plugin->modpath);
|
||||
}
|
||||
|
||||
isc_mem_putanddetach(&hmod->mctx, hmod, sizeof(*hmod));
|
||||
isc_mem_putanddetach(&plugin->mctx, plugin, sizeof(*plugin));
|
||||
}
|
||||
#else /* HAVE_DLFCN_H || _WIN32 */
|
||||
static isc_result_t
|
||||
load_library(isc_mem_t *mctx, const char *modpath, ns_module_t **hmodp) {
|
||||
load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
||||
UNUSED(mctx);
|
||||
UNUSED(modpath);
|
||||
UNUSED(hmodp);
|
||||
UNUSED(pluginp);
|
||||
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_ERROR,
|
||||
"hook module support is not implemented");
|
||||
"plugin support is not implemented");
|
||||
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
static void
|
||||
unload_library(ns_module_t **hmodp) {
|
||||
UNUSED(hmodp);
|
||||
unload_plugin(ns_plugin_t **pluginp) {
|
||||
UNUSED(pluginp);
|
||||
}
|
||||
#endif /* HAVE_DLFCN_H */
|
||||
|
||||
isc_result_t
|
||||
ns_module_load(const char *modpath, const char *parameters, const void *cfg,
|
||||
const char *cfg_file, unsigned long cfg_line, isc_mem_t *mctx,
|
||||
isc_log_t *lctx, void *actx, dns_view_t *view)
|
||||
ns_plugin_register(const char *modpath, const char *parameters,
|
||||
const void *cfg, const char *cfg_file,
|
||||
unsigned long cfg_line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
|
||||
dns_view_t *view)
|
||||
{
|
||||
isc_result_t result;
|
||||
ns_module_t *hmod = NULL;
|
||||
ns_plugin_t *plugin = NULL;
|
||||
|
||||
REQUIRE(mctx != NULL);
|
||||
REQUIRE(lctx != NULL);
|
||||
|
|
@ -361,44 +365,44 @@ ns_module_load(const char *modpath, const char *parameters, const void *cfg,
|
|||
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
|
||||
"loading module '%s'", modpath);
|
||||
"loading plugin '%s'", modpath);
|
||||
|
||||
CHECK(load_library(mctx, modpath, &hmod));
|
||||
CHECK(load_plugin(mctx, modpath, &plugin));
|
||||
|
||||
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL,
|
||||
NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
|
||||
"registering module '%s'", modpath);
|
||||
"registering plugin '%s'", modpath);
|
||||
|
||||
CHECK(hmod->register_func(parameters, cfg, cfg_file, cfg_line,
|
||||
mctx, lctx, actx, view->hooktable,
|
||||
&hmod->inst));
|
||||
CHECK(plugin->register_func(parameters, cfg, cfg_file, cfg_line,
|
||||
mctx, lctx, actx, view->hooktable,
|
||||
&plugin->inst));
|
||||
|
||||
ISC_LIST_APPEND(*(ns_modlist_t *)view->modlist, hmod, link);
|
||||
ISC_LIST_APPEND(*(ns_plugins_t *)view->plugins, plugin, link);
|
||||
|
||||
cleanup:
|
||||
if (result != ISC_R_SUCCESS && hmod != NULL) {
|
||||
unload_library(&hmod);
|
||||
if (result != ISC_R_SUCCESS && plugin != NULL) {
|
||||
unload_plugin(&plugin);
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
ns_module_check(const char *modpath, const char *parameters,
|
||||
ns_plugin_check(const char *modpath, 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;
|
||||
ns_module_t *hmod = NULL;
|
||||
ns_plugin_t *plugin = NULL;
|
||||
|
||||
CHECK(load_library(mctx, modpath, &hmod));
|
||||
CHECK(load_plugin(mctx, modpath, &plugin));
|
||||
|
||||
result = hmod->check_func(parameters, cfg, cfg_file, cfg_line,
|
||||
result = plugin->check_func(parameters, cfg, cfg_file, cfg_line,
|
||||
mctx, lctx, actx);
|
||||
|
||||
cleanup:
|
||||
if (hmod != NULL) {
|
||||
unload_library(&hmod);
|
||||
if (plugin != NULL) {
|
||||
unload_plugin(&plugin);
|
||||
}
|
||||
|
||||
return (result);
|
||||
|
|
@ -479,35 +483,35 @@ ns_hook_add(ns_hooktable_t *hooktable, isc_mem_t *mctx,
|
|||
}
|
||||
|
||||
void
|
||||
ns_modlist_create(isc_mem_t *mctx, ns_modlist_t **listp) {
|
||||
ns_modlist_t *modlist = NULL;
|
||||
ns_plugins_create(isc_mem_t *mctx, ns_plugins_t **listp) {
|
||||
ns_plugins_t *plugins = NULL;
|
||||
|
||||
REQUIRE(listp != NULL && *listp == NULL);
|
||||
|
||||
modlist = isc_mem_get(mctx, sizeof(*modlist));
|
||||
memset(modlist, 0, sizeof(*modlist));
|
||||
ISC_LIST_INIT(*modlist);
|
||||
plugins = isc_mem_get(mctx, sizeof(*plugins));
|
||||
memset(plugins, 0, sizeof(*plugins));
|
||||
ISC_LIST_INIT(*plugins);
|
||||
|
||||
*listp = modlist;
|
||||
*listp = plugins;
|
||||
}
|
||||
|
||||
void
|
||||
ns_modlist_free(isc_mem_t *mctx, void **listp) {
|
||||
ns_modlist_t *list = NULL;
|
||||
ns_module_t *hmod = NULL, *next = NULL;
|
||||
ns_plugins_free(isc_mem_t *mctx, void **listp) {
|
||||
ns_plugins_t *list = NULL;
|
||||
ns_plugin_t *plugin = NULL, *next = NULL;
|
||||
|
||||
REQUIRE(listp != NULL && *listp != NULL);
|
||||
|
||||
list = *listp;
|
||||
*listp = NULL;
|
||||
|
||||
for (hmod = ISC_LIST_HEAD(*list);
|
||||
hmod != NULL;
|
||||
hmod = next)
|
||||
for (plugin = ISC_LIST_HEAD(*list);
|
||||
plugin != NULL;
|
||||
plugin = next)
|
||||
{
|
||||
next = ISC_LIST_NEXT(hmod, link);
|
||||
ISC_LIST_UNLINK(*list, hmod, link);
|
||||
unload_library(&hmod);
|
||||
next = ISC_LIST_NEXT(plugin, link);
|
||||
ISC_LIST_UNLINK(*list, plugin, link);
|
||||
unload_plugin(&plugin);
|
||||
}
|
||||
|
||||
isc_mem_put(mctx, list, sizeof(*list));
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ void
|
|||
ns_client_putrdataset(ns_client_t *client, dns_rdataset_t **rdatasetp);
|
||||
/*%<
|
||||
* Get and release temporary rdatasets in the client message;
|
||||
* used in query.c and in hook modules.
|
||||
* used in query.c and in plugins.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
|
|
|
|||
|
|
@ -223,27 +223,27 @@ typedef ns_hooklist_t ns_hooktable_t[NS_HOOKPOINTS_COUNT];
|
|||
LIBNS_EXTERNAL_DATA extern ns_hooktable_t *ns__hook_table;
|
||||
|
||||
/*
|
||||
* API version
|
||||
* Plugin API version
|
||||
*
|
||||
* When the API changes, increment NS_HOOK_VERSION. If the
|
||||
* When the API changes, increment NS_PLUGIN_VERSION. If the
|
||||
* change is backward-compatible (e.g., adding a new function call
|
||||
* but not changing or removing an old one), increment NS_HOOK_AGE
|
||||
* as well; if not, set NS_HOOK_AGE to 0.
|
||||
* but not changing or removing an old one), increment NS_PLUGIN_AGE
|
||||
* as well; if not, set NS_PLUGIN_AGE to 0.
|
||||
*/
|
||||
#ifndef NS_HOOK_VERSION
|
||||
#define NS_HOOK_VERSION 1
|
||||
#define NS_HOOK_AGE 0
|
||||
#ifndef NS_PLUGIN_VERSION
|
||||
#define NS_PLUGIN_VERSION 1
|
||||
#define NS_PLUGIN_AGE 0
|
||||
#endif
|
||||
|
||||
typedef isc_result_t
|
||||
ns_hook_register_t(const char *parameters,
|
||||
const void *cfg, const char *file, unsigned long line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
|
||||
ns_hooktable_t *hooktable, void **instp);
|
||||
ns_plugin_register_t(const char *parameters,
|
||||
const void *cfg, const char *file, unsigned long line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
|
||||
ns_hooktable_t *hooktable, void **instp);
|
||||
/*%<
|
||||
* Called when registering a new module.
|
||||
* Called when registering a new plugin.
|
||||
*
|
||||
* 'parameters' contains the module configuration text.
|
||||
* 'parameters' contains the plugin configuration text.
|
||||
*
|
||||
* '*instp' will be set to the module instance handle if the function
|
||||
* is successful.
|
||||
|
|
@ -255,79 +255,80 @@ ns_hook_register_t(const char *parameters,
|
|||
*/
|
||||
|
||||
typedef void
|
||||
ns_hook_destroy_t(void **instp);
|
||||
ns_plugin_destroy_t(void **instp);
|
||||
/*%<
|
||||
* Destroy a module instance.
|
||||
* Destroy a plugin instance.
|
||||
*
|
||||
* '*instp' must be set to NULL by the function before it returns.
|
||||
*/
|
||||
|
||||
typedef isc_result_t
|
||||
ns_hook_check_t(const char *parameters,
|
||||
const void *cfg, const char *file, unsigned long line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx);
|
||||
ns_plugin_check_t(const char *parameters,
|
||||
const void *cfg, const char *file, unsigned long line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx);
|
||||
/*%<
|
||||
* Check the validity of 'parameters'.
|
||||
*/
|
||||
|
||||
typedef int
|
||||
ns_hook_version_t(void);
|
||||
ns_plugin_version_t(void);
|
||||
/*%<
|
||||
* Return the API version number a hook module was compiled with.
|
||||
* Return the API version number a plugin was compiled with.
|
||||
*
|
||||
* If the returned version number is no greater than
|
||||
* NS_HOOK_VERSION, and no less than NS_HOOK_VERSION - NS_HOOK_AGE,
|
||||
* NS_PLUGIN_VERSION, and no less than NS_PLUGIN_VERSION - NS_PLUGIN_AGE,
|
||||
* then the module is API-compatible with named.
|
||||
*/
|
||||
|
||||
/*%
|
||||
* Prototypes for API functions to be defined in each module.
|
||||
*/
|
||||
ns_hook_check_t hook_check;
|
||||
ns_hook_destroy_t hook_destroy;
|
||||
ns_hook_register_t hook_register;
|
||||
ns_hook_version_t hook_version;
|
||||
ns_plugin_check_t plugin_check;
|
||||
ns_plugin_destroy_t plugin_destroy;
|
||||
ns_plugin_register_t plugin_register;
|
||||
ns_plugin_version_t plugin_version;
|
||||
|
||||
isc_result_t
|
||||
ns_module_load(const char *modpath, const char *parameters,
|
||||
const void *cfg, const char *cfg_file, unsigned long cfg_line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
|
||||
dns_view_t *view);
|
||||
ns_plugin_register(const char *modpath, const char *parameters,
|
||||
const void *cfg, const char *cfg_file,
|
||||
unsigned long cfg_line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx,
|
||||
dns_view_t *view);
|
||||
/*%<
|
||||
* Load the module specified from the file 'modpath', and
|
||||
* Load the plugin module specified from the file 'modpath', and
|
||||
* register an instance using 'parameters'.
|
||||
*
|
||||
* 'cfg_file' and 'cfg_line' specify the location of the hook module
|
||||
* 'cfg_file' and 'cfg_line' specify the location of the plugin
|
||||
* declaration in the configuration file.
|
||||
*
|
||||
* 'cfg' and 'actx' are the configuration context and ACL configuration
|
||||
* context, respectively; they are passed as void * here in order to
|
||||
* prevent this library from having a dependency on libisccfg).
|
||||
*
|
||||
* 'instp' will be left pointing to the instance of the module
|
||||
* created by the module's hook_register function.
|
||||
* 'instp' will be left pointing to the instance of the plugin
|
||||
* created by the module's plugin_register function.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
ns_module_check(const char *modpath, const char *parameters,
|
||||
ns_plugin_check(const char *modpath, const char *parameters,
|
||||
const void *cfg, const char *cfg_file, unsigned long cfg_line,
|
||||
isc_mem_t *mctx, isc_log_t *lctx, void *actx);
|
||||
/*%<
|
||||
* Open the module at 'modpath' and check the validity of
|
||||
* Open the plugin module at 'modpath' and check the validity of
|
||||
* 'parameters', logging any errors or warnings found, then
|
||||
* close it without configuring it.
|
||||
*/
|
||||
|
||||
void
|
||||
ns_modlist_create(isc_mem_t *mctx, ns_modlist_t **listp);
|
||||
ns_plugins_create(isc_mem_t *mctx, ns_plugins_t **listp);
|
||||
/*%<
|
||||
* Create and initialize a module list.
|
||||
* Create and initialize a plugin list.
|
||||
*/
|
||||
|
||||
void
|
||||
ns_modlist_free(isc_mem_t *mctx, void **listp);
|
||||
ns_plugins_free(isc_mem_t *mctx, void **listp);
|
||||
/*%<
|
||||
* Close each module in a module list, then free the list object.
|
||||
* Close each plugin module in a plugin list, then free the list object.
|
||||
*/
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ typedef struct ns_altsecret ns_altsecret_t;
|
|||
typedef ISC_LIST(ns_altsecret_t) ns_altsecretlist_t;
|
||||
typedef struct ns_client ns_client_t;
|
||||
typedef struct ns_clientmgr ns_clientmgr_t;
|
||||
typedef struct ns_module ns_module_t;
|
||||
typedef ISC_LIST(ns_module_t) ns_modlist_t;
|
||||
typedef struct ns_plugin ns_plugin_t;
|
||||
typedef ISC_LIST(ns_plugin_t) ns_plugins_t;
|
||||
typedef struct ns_interface ns_interface_t;
|
||||
typedef struct ns_interfacemgr ns_interfacemgr_t;
|
||||
typedef struct ns_query ns_query_t;
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ get_hooktab(query_ctx_t *qctx) {
|
|||
*
|
||||
* (XXX: This description omits several special cases including
|
||||
* DNS64, RPZ, RRL, and the SERVFAIL cache. It also doesn't discuss
|
||||
* query hook modules.)
|
||||
* plugins.)
|
||||
*/
|
||||
|
||||
static void
|
||||
|
|
@ -7112,9 +7112,9 @@ query_respond(query_ctx_t *qctx) {
|
|||
* XXX: This hook is meant to be at the top of this function,
|
||||
* but is postponed until after DNS64 in order to avoid an
|
||||
* assertion if the hook causes recursion. (When DNS64 also
|
||||
* becomes a hook module, it will be necessary to find some
|
||||
* becomes a plugin, it will be necessary to find some
|
||||
* other way to prevent that assertion, since the order in
|
||||
* which hook modules are configured can't be enforced.)
|
||||
* which plugins are configured can't be enforced.)
|
||||
*/
|
||||
CALL_HOOK(NS_QUERY_RESPOND_BEGIN, qctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ ns_listenlist_default
|
|||
ns_listenlist_detach
|
||||
ns_log_init
|
||||
ns_log_setcontext
|
||||
ns_modlist_create
|
||||
ns_modlist_free
|
||||
ns_module_check
|
||||
ns_module_load
|
||||
ns_notify_start
|
||||
ns_plugin_check
|
||||
ns_plugin_register
|
||||
ns_plugins_create
|
||||
ns_plugins_free
|
||||
ns_query_cancel
|
||||
ns_query_done
|
||||
ns_query_free
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@
|
|||
./bin/dnssec/win32/verify.vcxproj.filters.in X 2013,2015,2018
|
||||
./bin/dnssec/win32/verify.vcxproj.in X 2013,2014,2015,2016,2017,2018
|
||||
./bin/dnssec/win32/verify.vcxproj.user X 2013,2018
|
||||
./bin/named/Makefile.in MAKE 1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
|
||||
./bin/named/bind9.xsl SGML 2006,2007,2008,2009,2012,2013,2014,2015,2016,2017,2018
|
||||
./bin/named/bind9.xsl.h X 2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018
|
||||
./bin/named/builtin.c C 2001,2002,2003,2004,2005,2007,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
|
||||
|
|
@ -239,6 +240,10 @@
|
|||
./bin/pkcs11/win32/pk11tokens.vcxproj.filters.in X 2014,2015,2018
|
||||
./bin/pkcs11/win32/pk11tokens.vcxproj.in X 2014,2015,2016,2017,2018
|
||||
./bin/pkcs11/win32/pk11tokens.vcxproj.user X 2014,2018
|
||||
./bin/plugins/filter-aaaa.8 MAN DOCBOOK
|
||||
./bin/plugins/filter-aaaa.c C 2018
|
||||
./bin/plugins/filter-aaaa.docbook SGML 2018
|
||||
./bin/plugins/filter-aaaa.html HTML DOCBOOK
|
||||
./bin/python/dnssec-checkds.8 MAN DOCBOOK
|
||||
./bin/python/dnssec-checkds.docbook SGML 2012,2013,2014,2015,2016,2017,2018
|
||||
./bin/python/dnssec-checkds.html HTML DOCBOOK
|
||||
|
|
@ -622,6 +627,7 @@
|
|||
./bin/tests/system/filter-aaaa/clean.sh SH 2010,2012,2014,2016,2018
|
||||
./bin/tests/system/filter-aaaa/ns1/sign.sh SH 2010,2012,2014,2016,2018
|
||||
./bin/tests/system/filter-aaaa/ns4/sign.sh SH 2010,2012,2014,2016,2018
|
||||
./bin/tests/system/filter-aaaa/prereq.sh SH 2018
|
||||
./bin/tests/system/filter-aaaa/setup.sh SH 2010,2012,2014,2016,2017,2018
|
||||
./bin/tests/system/filter-aaaa/tests.sh SH 2010,2012,2015,2016,2018
|
||||
./bin/tests/system/formerr/clean.sh SH 2013,2014,2015,2016,2018
|
||||
|
|
@ -1469,6 +1475,7 @@
|
|||
./doc/arm/man.dnssec-signzone.html X 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
|
||||
./doc/arm/man.dnssec-verify.html X 2012,2013,2014,2015,2016,2017,2018
|
||||
./doc/arm/man.dnstap-read.html X 2015,2016,2017,2018
|
||||
./doc/arm/man.filter-aaaa.html X 2018
|
||||
./doc/arm/man.host.html X 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
|
||||
./doc/arm/man.mdig.html X 2016,2017,2018
|
||||
./doc/arm/man.named-checkconf.html X 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018
|
||||
|
|
|
|||
Loading…
Reference in a new issue