#include "../../db/db.h"
#include "../../str.h"
#include "../../ut.h"
#include <string.h>


Go to the source code of this file.
Defines | |
| #define | globalblacklist_DB_COLS |
| #define | globalblacklist_DB_TABLE { "globalblacklist_table", STR_PARAM, &userblacklist_table.s }, |
| #define | userblacklist_DB_COLS |
| #define | userblacklist_DB_TABLE { "userblacklist_table", STR_PARAM, &userblacklist_table.s }, |
| #define | userblacklist_DB_URL { "db_url", STR_PARAM, &userblacklist_db_url.s }, |
Functions | |
| void | userblacklist_db_close (void) |
| int | userblacklist_db_init (void) |
| int | userblacklist_db_open (void) |
| void | userblacklist_db_vars (void) |
Variables | |
| str | globalblacklist_description_col |
| str | globalblacklist_id_col |
| str | globalblacklist_prefix_col |
| str | globalblacklist_table |
| const unsigned int | globalblacklist_version |
| str | globalblacklist_whitelist_col |
| str | userblacklist_db_url |
| db_func_t | userblacklist_dbf |
| db_con_t * | userblacklist_dbh |
| str | userblacklist_domain_col |
| str | userblacklist_id_col |
| str | userblacklist_prefix_col |
| str | userblacklist_table |
| str | userblacklist_username_col |
| const unsigned int | userblacklist_version |
| str | userblacklist_whitelist_col |
Database support functions for modules.
Definition in file db_userblacklist.h.
| #define globalblacklist_DB_COLS |
Value:
{ "globalblacklist_id_col", STR_PARAM, &globalblacklist_id_col.s }, \
{ "globalblacklist_prefix_col", STR_PARAM, &globalblacklist_prefix_col.s }, \
{ "globalblacklist_whitelist_col", STR_PARAM, &globalblacklist_whitelist_col.s }, \
{ "globalblacklist_description_col", STR_PARAM, &globalblacklist_description_col.s }, \
Definition at line 69 of file db_userblacklist.h.
| #define globalblacklist_DB_TABLE { "globalblacklist_table", STR_PARAM, &userblacklist_table.s }, |
Definition at line 60 of file db_userblacklist.h.
| #define userblacklist_DB_COLS |
Value:
{ "userblacklist_id_col", STR_PARAM, &userblacklist_id_col.s }, \
{ "userblacklist_username_col", STR_PARAM, &userblacklist_username_col.s }, \
{ "userblacklist_domain_col", STR_PARAM, &userblacklist_domain_col.s }, \
{ "userblacklist_prefix_col", STR_PARAM, &userblacklist_prefix_col.s }, \
{ "userblacklist_whitelist_col", STR_PARAM, &userblacklist_whitelist_col.s }, \
Definition at line 50 of file db_userblacklist.h.
| #define userblacklist_DB_TABLE { "userblacklist_table", STR_PARAM, &userblacklist_table.s }, |
Definition at line 40 of file db_userblacklist.h.
| #define userblacklist_DB_URL { "db_url", STR_PARAM, &userblacklist_db_url.s }, |
Definition at line 38 of file db_userblacklist.h.
| void userblacklist_db_close | ( | void | ) |
Definition at line 56 of file db_userblacklist.c.
References db_func::close, and NULL.
Referenced by mod_destroy(), and userblacklist_db_init().
| int userblacklist_db_init | ( | void | ) |
Initialises the DB API, check the table version and closes the connection. This should be called from the mod_init function.
Definition at line 70 of file db_userblacklist.c.
References db_bind_mod(), db_check_table_version(), globalblacklist_version, db_func::init, _str::len, LM_ERR, NULL, _str::s, userblacklist_db_close(), userblacklist_db_url, and userblacklist_version.
Referenced by mod_init().
| int userblacklist_db_open | ( | void | ) |
Initialize the DB connection without checking the table version and DB URL. This should be called from child_init. An already existing database connection will be closed, and a new one created.
Definition at line 103 of file db_userblacklist.c.
References db_func::close, db_func::init, LM_ERR, NULL, and userblacklist_db_url.
Referenced by child_init(), and mi_child_init().
| void userblacklist_db_vars | ( | void | ) |
Update the variable length after eventual assignments from the config script. This is necessary because we're using the 'str' type.
Definition at line 119 of file db_userblacklist.c.
References _str::len, _str::s, and userblacklist_db_url.
Referenced by mod_init().
Definition at line 47 of file db_userblacklist.c.
Definition at line 44 of file db_userblacklist.c.
Definition at line 41 of file db_userblacklist.c.
| const unsigned int globalblacklist_version |
Definition at line 75 of file userblacklist.c.
Referenced by userblacklist_db_init(), userblacklist_db_open(), and userblacklist_db_vars().
Definition at line 27 of file db_userblacklist.c.
Referenced by db_build_userbl_tree(), and db_reload_source().
Definition at line 26 of file db_userblacklist.c.
Referenced by db_build_userbl_tree(), and db_reload_source().
Definition at line 32 of file db_userblacklist.c.
| const unsigned int userblacklist_version |
1.5.6