#include <stdlib.h>#include <string.h>#include "../../mem/mem.h"#include "../../mem/shm_mem.h"#include "../../db/db.h"#include "../../dprint.h"#include "avpops_parse.h"#include "avpops_db.h"

Go to the source code of this file.
Functions | |
| int | avp_add_db_scheme (modparam_t type, void *val) |
| struct db_scheme * | avp_get_db_scheme (str *name) |
| int | avpops_db_bind (const str *db_url) |
| int | avpops_db_init (const str *db_url, const str *db_table, str **db_cols) |
| void | db_close_query (db_res_t *res) |
| int | db_delete_avp (str *uuid, str *username, str *domain, char *attr, const str *table) |
| db_res_t * | db_load_avp (str *uuid, str *username, str *domain, char *attr, const str *table, struct db_scheme *scheme) |
| int | db_query_avp (struct sip_msg *msg, char *query, pvname_list_t *dest) |
| int | db_store_avp (db_key_t *keys, db_val_t *vals, int n, const str *table) |
| static int | prepare_selection (str *uuid, str *username, str *domain, char *attr, struct db_scheme *scheme) |
| static int | set_table (const str *table, char *func) |
Variables | |
| static db_func_t | avpops_dbf |
| static str ** | db_columns |
| static db_con_t * | db_hdl = 0 |
| static struct db_scheme * | db_scheme_list = 0 |
| static str | def_table |
| static db_key_t | keys_cmp [3] |
| static db_val_t | vals_cmp [3] |
| int avp_add_db_scheme | ( | modparam_t | type, | |
| void * | val | |||
| ) |
Definition at line 102 of file avpops_db.c.
References avp_get_db_scheme(), db_scheme::db_flags, db_scheme::domain_col, _str::len, LM_DBG, LM_ERR, db_scheme::name, db_scheme::next, parse_avp_db_scheme(), pkg_malloc, _str::s, db_scheme::table, db_scheme::username_col, db_scheme::uuid_col, and db_scheme::value_col.
Definition at line 149 of file avpops_db.c.
References _str::len, db_scheme::name, db_scheme::next, and _str::s.
Referenced by avp_add_db_scheme(), and parse_avp_db().
| int avpops_db_bind | ( | const str * | db_url | ) |
Definition at line 52 of file avpops_db.c.
References db_bind_mod(), DB_CAP_ALL, DB_CAPABILITY, and LM_CRIT.
Referenced by avpops_init().
Definition at line 73 of file avpops_db.c.
References db_func::close, db_func::init, _str::len, LM_ERR, _str::s, and db_func::use_table.
Referenced by avpops_child_init().
| void db_close_query | ( | db_res_t * | res | ) |
Definition at line 269 of file avpops_db.c.
References db_func::free_result, and LM_DBG.
Referenced by db_query_avp(), and ops_dbload_avps().
Definition at line 293 of file avpops_db.c.
References db_func::delete, prepare_selection(), and set_table().
Referenced by ops_dbdelete_avps().
| db_res_t* db_load_avp | ( | str * | uuid, | |
| str * | username, | |||
| str * | domain, | |||
| char * | attr, | |||
| const str * | table, | |||
| struct db_scheme * | scheme | |||
| ) |
Definition at line 232 of file avpops_db.c.
References NULL, prepare_selection(), db_func::query, _str::s, set_table(), db_scheme::table, and db_scheme::value_col.
Referenced by ops_dbload_avps().
| int db_query_avp | ( | struct sip_msg * | msg, | |
| char * | query, | |||
| pvname_list_t * | dest | |||
| ) |
Definition at line 312 of file avpops_db.c.
References add_avp(), AVP_VAL_STR, DB_BITMAP, DB_BLOB, db_close_query(), DB_DATETIME, DB_INT, DB_STR, DB_STRING, _str::len, LM_DBG, LM_ERR, int_str::n, _pvname_list::next, NULL, pv_get_avp_name(), _pv_spec::pvp, db_func::raw_query, RES_COL_N, RES_ROW_N, RES_ROWS, int_str::s, _str::s, and _pvname_list::sname.
Referenced by ops_dbquery_avps().
Definition at line 276 of file avpops_db.c.
References db_func::insert, LM_ERR, and set_table().
Referenced by ops_dbstore_avps().
| static int prepare_selection | ( | str * | uuid, | |
| str * | username, | |||
| str * | domain, | |||
| char * | attr, | |||
| struct db_scheme * | scheme | |||
| ) | [inline, static] |
Definition at line 182 of file avpops_db.c.
References DB_STR, DB_STRING, db_scheme::domain_col, db_val_t::nul, _str::s, db_val_t::str_val, db_val_t::string_val, db_val_t::type, db_scheme::username_col, db_scheme::uuid_col, and db_val_t::val.
Referenced by db_delete_avp(), and db_load_avp().
| static int set_table | ( | const str * | table, | |
| char * | func | |||
| ) | [inline, static] |
Definition at line 161 of file avpops_db.c.
References _str::len, LM_ERR, _str::s, and db_func::use_table.
Referenced by db_delete_avp(), db_load_avp(), and db_store_avp().
db_func_t avpops_dbf [static] |
Definition at line 41 of file avpops_db.c.
str** db_columns [static] |
Definition at line 43 of file avpops_db.c.
Definition at line 40 of file avpops_db.c.
struct db_scheme* db_scheme_list = 0 [static] |
Definition at line 49 of file avpops_db.c.
Definition at line 42 of file avpops_db.c.
Definition at line 46 of file avpops_db.c.
1.5.6