|
unbound 0.1
|
Python module for unbound. More...
#include "config.h"#include "sldns/sbuffer.h"#include <Python.h>#include "pythonmod/pythonmod.h"#include "util/module.h"#include "util/config_file.h"#include "pythonmod_utils.h"#include "pythonmod/interface.h"Data Structures | |
| struct | pythonmod_env |
| Global state for the module. More... | |
| struct | pythonmod_qstate |
| Per query state for the iterator module. More... | |
Functions | |
| static void | clean_python_function_objects (PyObject *dict) |
| static void | log_py_err (void) |
| log python error | |
| static void | pythonmod_atexit (void) |
| int | pythonmod_init (struct module_env *env, int id) |
| python module init | |
| void | pythonmod_deinit (struct module_env *env, int id) |
| python module deinit | |
| void | pythonmod_inform_super (struct module_qstate *qstate, int id, struct module_qstate *super) |
| python module | |
| void | pythonmod_operate (struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *ATTR_UNUSED(outbound)) |
| void | pythonmod_clear (struct module_qstate *qstate, int id) |
| python module cleanup query state | |
| size_t | pythonmod_get_mem (struct module_env *env, int id) |
| python module alloc size routine | |
| struct module_func_block * | pythonmod_get_funcblock (void) |
| Get the module function block. | |
Variables | |
| int | py_mod_count = 0 |
| counter for python module instances incremented by pythonmod_init(...) | |
| PyThreadState * | mainthr |
| Python main thread. | |
| static struct module_func_block | pythonmod_block |
| The module function block. | |
Python module for unbound.
Calls python script.
|
static |
log python error
References log_err(), and log_py_err().
Referenced by log_py_err(), pythonmod_deinit(), pythonmod_inform_super(), and pythonmod_init().
| int pythonmod_init | ( | struct module_env * | env, |
| int | id ) |
python module init
References module_env::cfg, pythonmod_env::data, pythonmod_env::dict, config_file::directory, pythonmod_env::fname, pythonmod_env::func_deinit, pythonmod_env::func_inform, pythonmod_env::func_init, pythonmod_env::func_operate, log_err(), log_py_err(), mainthr, module_env::modinfo, pythonmod_env::module, config_strlist::next, py_mod_count, config_file::python_script, pythonmod_init(), and config_strlist::str.
Referenced by fptr_whitelist_mod_init(), and pythonmod_init().
| void pythonmod_deinit | ( | struct module_env * | env, |
| int | id ) |
python module deinit
References pythonmod_env::data, pythonmod_env::dict, pythonmod_env::fname, pythonmod_env::func_deinit, pythonmod_env::func_inform, pythonmod_env::func_init, pythonmod_env::func_operate, inplace_cb_delete(), log_err(), log_py_err(), module_env::modinfo, pythonmod_env::module, py_mod_count, and pythonmod_deinit().
Referenced by fptr_whitelist_mod_deinit(), and pythonmod_deinit().
| void pythonmod_inform_super | ( | struct module_qstate * | qstate, |
| int | id, | ||
| struct module_qstate * | super ) |
python module
References pythonmod_qstate::data, module_qstate::env, module_qstate::ext_state, pythonmod_env::func_inform, log_err(), log_py_err(), log_query_info(), module_qstate::minfo, module_env::modinfo, module_error, pythonmod_inform_super(), module_qstate::qinfo, pythonmod_env::qstate, and VERB_ALGO.
Referenced by fptr_whitelist_mod_inform_super(), pythonmod_inform_super(), and pythonmod_operate().
| void pythonmod_clear | ( | struct module_qstate * | qstate, |
| int | id ) |
python module cleanup query state
References pythonmod_qstate::data, module_qstate::minfo, pythonmod_clear(), VERB_ALGO, and verbose().
Referenced by fptr_whitelist_mod_clear(), pythonmod_clear(), and pythonmod_operate().
| size_t pythonmod_get_mem | ( | struct module_env * | env, |
| int | id ) |
python module alloc size routine
References module_env::modinfo, pythonmod_get_mem(), VERB_ALGO, and verbose().
Referenced by fptr_whitelist_mod_get_mem(), pythonmod_get_mem(), and pythonmod_operate().
| struct module_func_block * pythonmod_get_funcblock | ( | void | ) |
Get the module function block.
References pythonmod_block, and pythonmod_get_funcblock().
Referenced by checkconf(), module_funcs_avail(), and pythonmod_get_funcblock().
| int py_mod_count = 0 |
counter for python module instances incremented by pythonmod_init(...)
Referenced by pythonmod_deinit(), and pythonmod_init().
| PyThreadState* mainthr |
Python main thread.
Referenced by pythonmod_init().
|
static |
The module function block.
Referenced by pythonmod_get_funcblock().