diff options
Diffstat (limited to 'util/module.h')
| -rw-r--r-- | util/module.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/util/module.h b/util/module.h index c9df74624918..5bdb622a2515 100644 --- a/util/module.h +++ b/util/module.h @@ -143,7 +143,7 @@ * also contain an rcode that is nonzero, but in this case additional * information (query, additional) can be passed along. * - * The rcode and dns_msg are used to pass the result from the the rightmost + * The rcode and dns_msg are used to pass the result from the rightmost * module towards the leftmost modules and then towards the user. * * If you want to avoid recursion-cycles where queries need other queries @@ -712,8 +712,29 @@ struct module_func_block { /** text string name of module */ const char* name; - /** - * init the module. Called once for the global state. + /** + * Set up the module for start. This is called only once at startup. + * Privileged operations like opening device files may be done here. + * The function ptr can be NULL, if it is not used. + * @param env: module environment. + * @param id: module id number. + * return: 0 on error + */ + int (*startup)(struct module_env* env, int id); + + /** + * Close down the module for stop. This is called only once before + * shutdown to free resources allocated during startup(). + * Closing privileged ports or files must be done here. + * The function ptr can be NULL, if it is not used. + * @param env: module environment. + * @param id: module id number. + */ + void (*destartup)(struct module_env* env, int id); + + /** + * Initialise the module. Called when restarting or reloading the + * daemon. * This is the place to apply settings from the config file. * @param env: module environment. * @param id: module id number. @@ -722,7 +743,8 @@ struct module_func_block { int (*init)(struct module_env* env, int id); /** - * de-init, delete, the module. Called once for the global state. + * Deinitialise the module, undo stuff done during init(). + * Called before reloading the daemon. * @param env: module environment. * @param id: module id number. */ |
