dp_db.c File Reference

#include <stdlib.h>
#include <string.h>
#include "../../dprint.h"
#include "../../ut.h"
#include "../../db/db.h"
#include "../../re.h"
#include "dp_db.h"
#include "dialplan.h"

Include dependency graph for dp_db.c:

Go to the source code of this file.

Defines

#define GET_STR_VALUE(_res, _values, _index)

Functions

int add_rule2hash (dpl_node_t *, int)
dpl_node_tbuild_rule (db_val_t *values)
void destroy_data (void)
void destroy_hash (int)
void destroy_rule (dpl_node_t *rule)
int dp_connect_db (void)
void dp_disconnect_db (void)
int dp_load_db (void)
int init_data (void)
int init_db_data (void)
void list_hash (int h_index)
void list_rule (dpl_node_t *)
static pcre * reg_ex_comp (const char *pattern, int *cap_cnt)
dpl_id_p select_dpid (int id)
int str_to_shm (str src, str *dest)

Variables

str attrs_column = str_init(ATTRS_COL)
int * crt_idx
static db_con_tdp_db_handle = 0
str dp_db_url = {DEFAULT_RODB_URL, DEFAULT_RODB_URL_LEN}
static db_func_t dp_dbf
int dp_fetch_rows
str dp_table_name = str_init(DP_TABLE_NAME)
str dpid_column = str_init(DPID_COL)
str match_exp_column = str_init(MATCH_EXP_COL)
str match_len_column = str_init(MATCH_LEN_COL)
str match_op_column = str_init(MATCH_OP_COL)
int * next_idx
str pr_column = str_init(PR_COL)
str repl_exp_column = str_init(REPL_EXP_COL)
dpl_id_prules_hash = NULL
str subst_exp_column = str_init(SUBST_EXP_COL)


Define Documentation

#define GET_STR_VALUE ( _res,
_values,
_index   ) 

Value:

do{\
      (_res).s = VAL_STR((_values)+ (_index)).s;\
      (_res).len = strlen(VAL_STR((_values)+ (_index)).s);\
   }while(0);

Definition at line 54 of file dp_db.c.


Function Documentation

int add_rule2hash ( dpl_node_t rule,
int  h_index 
)

dpl_node_t * build_rule ( db_val_t values  ) 

void destroy_data ( void   ) 

Definition at line 165 of file dp_db.c.

References crt_idx, destroy_hash(), and shm_free.

Referenced by mod_destroy().

void destroy_hash ( int  index  ) 

void destroy_rule ( dpl_node_t rule  ) 

int dp_connect_db ( void   ) 

Definition at line 112 of file dp_db.c.

References db_func::init, LM_CRIT, and LM_ERR.

Referenced by child_init(), init_db_data(), and mi_child_init().

void dp_disconnect_db ( void   ) 

Definition at line 128 of file dp_db.c.

References db_func::close.

Referenced by init_db_data(), and mod_destroy().

int dp_load_db ( void   ) 

int init_data ( void   ) 

Definition at line 137 of file dp_db.c.

int init_db_data ( void   ) 

void list_hash ( int  h_index  ) 

void list_rule ( dpl_node_t rule  ) 

static pcre* reg_ex_comp ( const char *  pattern,
int *  cap_cnt 
) [static]

Definition at line 299 of file dp_db.c.

References LM_ERR, NULL, and shm_malloc().

Referenced by build_rule(), and reload_gws_and_lcrs().

dpl_id_p select_dpid ( int  id  ) 

Definition at line 606 of file dp_db.c.

References crt_idx, dpl_id::dp_id, dpl_id::next, and NULL.

Referenced by dp_translate_f(), and mi_translate().

int str_to_shm ( str  src,
str dest 
)

Definition at line 279 of file dp_db.c.

References _str::len, LM_ERR, _str::s, and shm_malloc().

Referenced by build_rule().


Variable Documentation

str attrs_column = str_init(ATTRS_COL)

Definition at line 47 of file dp_db.c.

Referenced by mod_init().

int* crt_idx

db_con_t* dp_db_handle = 0 [static]

Definition at line 51 of file dp_db.c.

str dp_db_url = {DEFAULT_RODB_URL, DEFAULT_RODB_URL_LEN}

Definition at line 38 of file dp_db.c.

Referenced by mod_init().

db_func_t dp_dbf [static]

Definition at line 52 of file dp_db.c.

Definition at line 69 of file dialplan.c.

Referenced by dp_load_db(), and mod_init().

str dp_table_name = str_init(DP_TABLE_NAME)

Definition at line 39 of file dp_db.c.

Referenced by mod_init().

str dpid_column = str_init(DPID_COL)

Definition at line 40 of file dp_db.c.

Referenced by mod_init().

str match_exp_column = str_init(MATCH_EXP_COL)

Definition at line 43 of file dp_db.c.

Referenced by mod_init().

str match_len_column = str_init(MATCH_LEN_COL)

Definition at line 44 of file dp_db.c.

Referenced by mod_init().

str match_op_column = str_init(MATCH_OP_COL)

Definition at line 42 of file dp_db.c.

Referenced by mod_init().

int * next_idx

Definition at line 71 of file dp_db.c.

Referenced by dp_load_db(), ds_load_db(), ds_load_list(), and init_data().

str pr_column = str_init(PR_COL)

Definition at line 41 of file dp_db.c.

Referenced by mod_init().

str repl_exp_column = str_init(REPL_EXP_COL)

Definition at line 46 of file dp_db.c.

Referenced by mod_init().

Definition at line 70 of file dp_db.c.

str subst_exp_column = str_init(SUBST_EXP_COL)

Definition at line 45 of file dp_db.c.

Referenced by mod_init().


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