Module functionality block. More...
#include <module.h>
Data Fields | |
const char * | name |
text string name of module | |
int(* | init )(struct module_env *env, int id) |
init the module. | |
void(* | deinit )(struct module_env *env, int id) |
de-init, delete, the module. | |
void(* | operate )(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound) |
accept a new query, or work further on existing query. | |
void(* | inform_super )(struct module_qstate *qstate, int id, struct module_qstate *super) |
inform super querystate about the results from this subquerystate. | |
void(* | clear )(struct module_qstate *qstate, int id) |
clear module specific data | |
size_t(* | get_mem )(struct module_env *env, int id) |
How much memory is the module specific data using. |
Module functionality block.
int(* module_func_block::init)(struct module_env *env, int id) |
init the module.
Called once for the global state. This is the place to apply settings from the config file.
env,: | module environment. | |
id,: | module id number. return: 0 on error |
Referenced by check_mod(), and modstack_setup().
void(* module_func_block::deinit)(struct module_env *env, int id) |
de-init, delete, the module.
Called once for the global state.
env,: | module environment. | |
id,: | module id number. |
Referenced by check_mod(), and modstack_desetup().
void(* module_func_block::operate)(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound) |
accept a new query, or work further on existing query.
Changes the qstate->ext_state to be correct on exit.
ev,: | event that causes the module state machine to (re-)activate. | |
qstate,: | the query state. Note that this method is not allowed to change the query state 'identity', that is query info, qflags, and priming status. Attach a subquery to get results to a different query. | |
id,: | module id number that operate() is called on. | |
outbound,: | if not NULL this event is due to the reply/timeout or error on this outbound query. |
Referenced by mesh_run().
void(* module_func_block::inform_super)(struct module_qstate *qstate, int id, struct module_qstate *super) |
inform super querystate about the results from this subquerystate.
Is called when the querystate is finished.
qstate,: | the query state that is finished. Examine return_rcode and return_reply in the qstate. | |
id,: | module id for this module. This coincides with the current module for the super qstate. | |
super,: | the super querystate that needs to be informed. |
Referenced by mesh_walk_supers().
size_t(* module_func_block::get_mem)(struct module_env *env, int id) |
How much memory is the module specific data using.
env,: | module environment. | |
id,: | the module id. |
Referenced by print_mem(), and worker_mem_report().