db_userblacklist.c File Reference

Database support for modules. More...

#include "db_userblacklist.h"

Include dependency graph for db_userblacklist.c:

Go to the source code of this file.

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_init("description")
str globalblacklist_id_col = str_init("id")
str globalblacklist_prefix_col = str_init("prefix")
str globalblacklist_table = str_init("globalblacklist")
const unsigned int globalblacklist_version = 1
str globalblacklist_whitelist_col = str_init("whitelist")
db_func_t userblacklist_dbf
db_con_tuserblacklist_dbh = NULL
str userblacklist_domain_col = str_init("domain")
str userblacklist_id_col = str_init("id")
str userblacklist_prefix_col = str_init("prefix")
str userblacklist_table = str_init("userblacklist")
str userblacklist_username_col = str_init("username")
const unsigned int userblacklist_version = 1
str userblacklist_whitelist_col = str_init("whitelist")


Detailed Description

Database support for modules.

Database support functions for modules.

Definition in file db_userblacklist.c.


Function Documentation

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.

Returns:
0 means ok, -1 means an error occured.

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.

Returns:
0 means ok, -1 means an error occured.

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().


Variable Documentation

str globalblacklist_description_col = str_init("description")

Definition at line 47 of file db_userblacklist.c.

str globalblacklist_id_col = str_init("id")

Definition at line 44 of file db_userblacklist.c.

str globalblacklist_prefix_col = str_init("prefix")

Definition at line 45 of file db_userblacklist.c.

Referenced by db_reload_source().

str globalblacklist_table = str_init("globalblacklist")

Definition at line 41 of file db_userblacklist.c.

const unsigned int globalblacklist_version = 1

Definition at line 50 of file db_userblacklist.c.

Referenced by userblacklist_db_init().

str globalblacklist_whitelist_col = str_init("whitelist")

Definition at line 46 of file db_userblacklist.c.

Referenced by db_reload_source().

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().

str userblacklist_domain_col = str_init("domain")

Definition at line 34 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().

str userblacklist_id_col = str_init("id")

Definition at line 32 of file db_userblacklist.c.

str userblacklist_prefix_col = str_init("prefix")

Definition at line 35 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().

str userblacklist_table = str_init("userblacklist")

Definition at line 29 of file db_userblacklist.c.

Referenced by check_user_blacklist().

str userblacklist_username_col = str_init("username")

Definition at line 33 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().

const unsigned int userblacklist_version = 1

Definition at line 39 of file db_userblacklist.c.

Referenced by userblacklist_db_init().

str userblacklist_whitelist_col = str_init("whitelist")

Definition at line 36 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().


Generated on Tue May 22 14:00:35 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6