db_userblacklist.h File Reference

Database support for modules. More...

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

Include dependency graph for db_userblacklist.h:

This graph shows which files directly or indirectly include this file:

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_tuserblacklist_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


Detailed Description

Database support for modules.

Database support functions for modules.

Definition in file db_userblacklist.h.


Define Documentation

#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.


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

Definition at line 47 of file db_userblacklist.c.

Definition at line 44 of file db_userblacklist.c.

Definition at line 45 of file db_userblacklist.c.

Referenced by db_reload_source().

Definition at line 41 of file db_userblacklist.c.

const unsigned int globalblacklist_version

Definition at line 50 of file db_userblacklist.c.

Referenced by userblacklist_db_init().

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

Definition at line 34 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().

Definition at line 32 of file db_userblacklist.c.

Definition at line 35 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().

Definition at line 29 of file db_userblacklist.c.

Referenced by check_user_blacklist().

Definition at line 33 of file db_userblacklist.c.

Referenced by db_build_userbl_tree().

const unsigned int userblacklist_version

Definition at line 39 of file db_userblacklist.c.

Referenced by userblacklist_db_init().

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