avpops_db.c File Reference

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

Include dependency graph for avpops_db.c:

Go to the source code of this file.

Functions

int avp_add_db_scheme (modparam_t type, void *val)
struct db_schemeavp_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_tdb_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_tdb_hdl = 0
static struct db_schemedb_scheme_list = 0
static str def_table
static db_key_t keys_cmp [3]
static db_val_t vals_cmp [3]


Function Documentation

int avp_add_db_scheme ( modparam_t  type,
void *  val 
)

struct db_scheme* avp_get_db_scheme ( str name  )  [read]

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

int avpops_db_init ( const str db_url,
const str db_table,
str **  db_cols 
)

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

int db_delete_avp ( str uuid,
str username,
str domain,
char *  attr,
const str table 
)

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 
)

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 
)

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]

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


Variable Documentation

Definition at line 41 of file avpops_db.c.

str** db_columns [static]

Definition at line 43 of file avpops_db.c.

db_con_t* db_hdl = 0 [static]

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.

str def_table [static]

Definition at line 42 of file avpops_db.c.

db_key_t keys_cmp[3] [static]

Definition at line 45 of file avpops_db.c.

Referenced by get_user_script().

db_val_t vals_cmp[3] [static]

Definition at line 46 of file avpops_db.c.


Generated on Thu May 17 12:00:35 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6