#include "../../str.h"#include "../../usr_avp.h"#include "../../pvar.h"#include "../../re.h"#include "../../parser/msg_parser.h"#include "avpops_db.h"


Go to the source code of this file.
Data Structures | |
| struct | db_param |
| struct | fis_param |
Defines | |
| #define | AVP_IS_IN_DB (1<<7) |
| #define | AVPOPS_DB_NAME_INT (1<<1) |
| #define | AVPOPS_DB_VAL_INT (1<<0) |
| #define | AVPOPS_FLAG_ALL (1<<24) |
| #define | AVPOPS_FLAG_CASTN (1<<27) |
| #define | AVPOPS_FLAG_CASTS (1<<28) |
| #define | AVPOPS_FLAG_CI (1<<25) |
| #define | AVPOPS_FLAG_DELETE (1<<26) |
| #define | AVPOPS_FLAG_DOMAIN0 (1<<25) |
| #define | AVPOPS_FLAG_EMPTY (1<<29) |
| #define | AVPOPS_FLAG_URI0 (1<<26) |
| #define | AVPOPS_FLAG_USER0 (1<<24) |
| #define | AVPOPS_FLAG_UUID0 (1<<27) |
| #define | AVPOPS_OP_ADD (1<<12) |
| #define | AVPOPS_OP_BAND (1<<8) |
| #define | AVPOPS_OP_BNOT (1<<11) |
| #define | AVPOPS_OP_BOR (1<<9) |
| #define | AVPOPS_OP_BXOR (1<<10) |
| #define | AVPOPS_OP_DIV (1<<15) |
| #define | AVPOPS_OP_EQ (1<<0) |
| #define | AVPOPS_OP_FM (1<<7) |
| #define | AVPOPS_OP_GE (1<<5) |
| #define | AVPOPS_OP_GT (1<<4) |
| #define | AVPOPS_OP_LE (1<<3) |
| #define | AVPOPS_OP_LT (1<<2) |
| #define | AVPOPS_OP_MOD (1<<16) |
| #define | AVPOPS_OP_MUL (1<<14) |
| #define | AVPOPS_OP_NE (1<<1) |
| #define | AVPOPS_OP_RE (1<<6) |
| #define | AVPOPS_OP_SUB (1<<13) |
| #define | AVPOPS_USE_BRANCH (1<<15) |
| #define | AVPOPS_USE_DOMAIN (1<<9) |
| #define | AVPOPS_USE_DST_IP (1<<13) |
| #define | AVPOPS_USE_DURI (1<<14) |
| #define | AVPOPS_USE_FROM (1<<5) |
| #define | AVPOPS_USE_RURI (1<<7) |
| #define | AVPOPS_USE_SRC_IP (1<<12) |
| #define | AVPOPS_USE_TO (1<<6) |
| #define | AVPOPS_USE_USERNAME (1<<8) |
| #define | AVPOPS_VAL_INT (1<<1) |
| #define | AVPOPS_VAL_NONE (1<<0) |
| #define | AVPOPS_VAL_PVAR (1<<3) |
| #define | AVPOPS_VAL_STR (1<<2) |
Functions | |
| void | init_store_avps (str **db_columns) |
| int | ops_check_avp (struct sip_msg *msg, struct fis_param *param, struct fis_param *check) |
| int | ops_copy_avp (struct sip_msg *msg, struct fis_param *name1, struct fis_param *name2) |
| int | ops_dbdelete_avps (struct sip_msg *msg, struct fis_param *sp, struct db_param *dbp, int use_domain) |
| int | ops_dbload_avps (struct sip_msg *msg, struct fis_param *sp, struct db_param *dbp, int use_domain) |
| int | ops_dbquery_avps (struct sip_msg *msg, pv_elem_t *query, pvname_list_t *dest) |
| int | ops_dbstore_avps (struct sip_msg *msg, struct fis_param *sp, struct db_param *dbp, int use_domain) |
| int | ops_delete_avp (struct sip_msg *msg, struct fis_param *ap) |
| int | ops_is_avp_set (struct sip_msg *msg, struct fis_param *ap) |
| int | ops_op_avp (struct sip_msg *msg, struct fis_param **param, struct fis_param *op) |
| int | ops_print_avp (void) |
| int | ops_pushto_avp (struct sip_msg *msg, struct fis_param *dst, struct fis_param *ap) |
| int | ops_subst (struct sip_msg *msg, struct fis_param **src, struct subst_expr *subst) |
| #define AVP_IS_IN_DB (1<<7) |
| #define AVPOPS_DB_NAME_INT (1<<1) |
| #define AVPOPS_DB_VAL_INT (1<<0) |
| #define AVPOPS_FLAG_ALL (1<<24) |
Definition at line 93 of file avpops_impl.h.
Referenced by fixup_copy_avp(), fixup_delete_avp(), fixup_is_avp_set(), fixup_pushto_avp(), fixup_subst(), ops_check_avp(), ops_copy_avp(), ops_delete_avp(), ops_is_avp_set(), ops_pushto_avp(), ops_subst(), parse_check_value(), and parse_op_value().
| #define AVPOPS_FLAG_CASTN (1<<27) |
Definition at line 96 of file avpops_impl.h.
Referenced by fixup_copy_avp(), fixup_is_avp_set(), ops_copy_avp(), and ops_is_avp_set().
| #define AVPOPS_FLAG_CASTS (1<<28) |
Definition at line 97 of file avpops_impl.h.
Referenced by fixup_copy_avp(), fixup_is_avp_set(), ops_copy_avp(), and ops_is_avp_set().
| #define AVPOPS_FLAG_CI (1<<25) |
Definition at line 94 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_FLAG_DELETE (1<<26) |
Definition at line 95 of file avpops_impl.h.
Referenced by fixup_copy_avp(), fixup_subst(), ops_copy_avp(), ops_op_avp(), ops_subst(), and parse_op_value().
| #define AVPOPS_FLAG_DOMAIN0 (1<<25) |
Definition at line 69 of file avpops_impl.h.
Referenced by fixup_db_avp(), fixup_pushto_avp(), ops_dbdelete_avps(), ops_dbload_avps(), ops_dbstore_avps(), and ops_pushto_avp().
| #define AVPOPS_FLAG_EMPTY (1<<29) |
Definition at line 98 of file avpops_impl.h.
Referenced by fixup_is_avp_set(), and ops_is_avp_set().
| #define AVPOPS_FLAG_URI0 (1<<26) |
Definition at line 70 of file avpops_impl.h.
Referenced by fixup_db_avp(), ops_dbdelete_avps(), ops_dbload_avps(), and ops_dbstore_avps().
| #define AVPOPS_FLAG_USER0 (1<<24) |
Definition at line 68 of file avpops_impl.h.
Referenced by fixup_db_avp(), fixup_pushto_avp(), ops_dbdelete_avps(), ops_dbload_avps(), ops_dbstore_avps(), and ops_pushto_avp().
| #define AVPOPS_FLAG_UUID0 (1<<27) |
Definition at line 71 of file avpops_impl.h.
Referenced by fixup_db_avp(), ops_dbdelete_avps(), ops_dbload_avps(), and ops_dbstore_avps().
| #define AVPOPS_OP_ADD (1<<12) |
| #define AVPOPS_OP_BAND (1<<8) |
Definition at line 82 of file avpops_impl.h.
Referenced by ops_check_avp(), ops_op_avp(), parse_check_value(), and parse_op_value().
| #define AVPOPS_OP_BNOT (1<<11) |
| #define AVPOPS_OP_BOR (1<<9) |
Definition at line 83 of file avpops_impl.h.
Referenced by ops_check_avp(), ops_op_avp(), parse_check_value(), and parse_op_value().
| #define AVPOPS_OP_BXOR (1<<10) |
Definition at line 84 of file avpops_impl.h.
Referenced by ops_check_avp(), ops_op_avp(), parse_check_value(), and parse_op_value().
| #define AVPOPS_OP_DIV (1<<15) |
| #define AVPOPS_OP_EQ (1<<0) |
Definition at line 74 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_FM (1<<7) |
Definition at line 81 of file avpops_impl.h.
Referenced by fixup_check_avp(), ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_GE (1<<5) |
Definition at line 79 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_GT (1<<4) |
Definition at line 78 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_LE (1<<3) |
Definition at line 77 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_LT (1<<2) |
Definition at line 76 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_MOD (1<<16) |
| #define AVPOPS_OP_MUL (1<<14) |
| #define AVPOPS_OP_NE (1<<1) |
Definition at line 75 of file avpops_impl.h.
Referenced by ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_RE (1<<6) |
Definition at line 80 of file avpops_impl.h.
Referenced by fixup_check_avp(), ops_check_avp(), and parse_check_value().
| #define AVPOPS_OP_SUB (1<<13) |
| #define AVPOPS_USE_BRANCH (1<<15) |
Definition at line 65 of file avpops_impl.h.
Referenced by fixup_pushto_avp(), and ops_pushto_avp().
| #define AVPOPS_USE_DOMAIN (1<<9) |
Definition at line 60 of file avpops_impl.h.
| #define AVPOPS_USE_DST_IP (1<<13) |
Definition at line 63 of file avpops_impl.h.
| #define AVPOPS_USE_DURI (1<<14) |
Definition at line 64 of file avpops_impl.h.
Referenced by fixup_pushto_avp(), and ops_pushto_avp().
| #define AVPOPS_USE_FROM (1<<5) |
| #define AVPOPS_USE_RURI (1<<7) |
Definition at line 58 of file avpops_impl.h.
Referenced by fixup_pushto_avp(), get_source_uri(), and ops_pushto_avp().
| #define AVPOPS_USE_SRC_IP (1<<12) |
Definition at line 62 of file avpops_impl.h.
| #define AVPOPS_USE_TO (1<<6) |
| #define AVPOPS_USE_USERNAME (1<<8) |
Definition at line 59 of file avpops_impl.h.
| #define AVPOPS_VAL_INT (1<<1) |
Definition at line 52 of file avpops_impl.h.
Referenced by dbrow2avp(), fixup_delete_avp(), ops_check_avp(), ops_dbstore_avps(), ops_delete_avp(), ops_op_avp(), parse_avp_db(), parse_intstr_value(), and parse_op_value().
| #define AVPOPS_VAL_NONE (1<<0) |
Definition at line 51 of file avpops_impl.h.
Referenced by dbrow2avp(), fixup_delete_avp(), fixup_pushto_avp(), fixup_subst(), ops_dbstore_avps(), ops_delete_avp(), and parse_avp_db().
| #define AVPOPS_VAL_PVAR (1<<3) |
Definition at line 54 of file avpops_impl.h.
Referenced by avpops_parse_pvar(), fixup_check_avp(), fixup_db_avp(), fixup_delete_avp(), fixup_op_avp(), fixup_pushto_avp(), ops_check_avp(), ops_dbdelete_avps(), ops_dbload_avps(), ops_dbstore_avps(), ops_op_avp(), parse_avp_db(), parse_check_value(), and parse_op_value().
| #define AVPOPS_VAL_STR (1<<2) |
Definition at line 53 of file avpops_impl.h.
Referenced by dbrow2avp(), fixup_check_avp(), fixup_db_avp(), fixup_delete_avp(), fixup_op_avp(), ops_dbdelete_avps(), ops_dbload_avps(), ops_dbstore_avps(), ops_delete_avp(), parse_avp_db(), and parse_intstr_value().
| void init_store_avps | ( | str ** | db_columns | ) |
Definition at line 69 of file avpops_impl.c.
References DB_INT, DB_STR, db_val_t::nul, and db_val_t::type.
Referenced by avpops_init().
Definition at line 1045 of file avpops_impl.c.
References AVP_VAL_STR, AVPOPS_FLAG_ALL, AVPOPS_FLAG_CI, avpops_get_aname(), AVPOPS_OP_BAND, AVPOPS_OP_BOR, AVPOPS_OP_BXOR, AVPOPS_OP_EQ, AVPOPS_OP_FM, AVPOPS_OP_GE, AVPOPS_OP_GT, AVPOPS_OP_LE, AVPOPS_OP_LT, AVPOPS_OP_NE, AVPOPS_OP_RE, AVPOPS_VAL_INT, AVPOPS_VAL_PVAR, _pv_value::flags, usr_avp::flags, _str::len, LM_CRIT, LM_DBG, LM_ERR, fis_param::n, int_str::n, usr_avp::next, NULL, fis_param::opd, fis_param::ops, pv_get_spec_value(), PV_TYPE_INT, PVT_AVP, _pv_value::ri, _pv_value::rs, fis_param::s, _str::s, int_str::s, search_first_avp(), str_buf, STR_BUF_SIZE, fis_param::sval, fis_param::type, _pv_spec::type, and fis_param::u.
Referenced by w_check_avps().
Definition at line 814 of file avpops_impl.c.
References add_avp(), AVP_VAL_STR, AVPOPS_FLAG_ALL, AVPOPS_FLAG_CASTN, AVPOPS_FLAG_CASTS, AVPOPS_FLAG_DELETE, avpops_get_aname(), destroy_avp(), usr_avp::flags, int2str(), _str::len, LM_ERR, int_str::n, fis_param::ops, _str::s, int_str::s, search_first_avp(), and str2int().
Referenced by w_copy_avps().
| int ops_dbdelete_avps | ( | struct sip_msg * | msg, | |
| struct fis_param * | sp, | |||
| struct db_param * | dbp, | |||
| int | use_domain | |||
| ) |
Definition at line 427 of file avpops_impl.c.
References db_param::a, avpops_attr_buf, AVPOPS_ATTR_LEN, AVPOPS_FLAG_DOMAIN0, AVPOPS_FLAG_URI0, AVPOPS_FLAG_USER0, AVPOPS_FLAG_UUID0, AVPOPS_VAL_PVAR, AVPOPS_VAL_STR, db_delete_avp(), _pv_value::flags, sip_uri::host, _str::len, LM_CRIT, LM_ERR, LM_INFO, NULL, fis_param::opd, fis_param::ops, parse_uri(), pv_get_spec_name(), pv_get_spec_value(), pv_has_dname, PV_VAL_EMPTY, PV_VAL_NULL, PV_VAL_STR, _pv_spec::pvp, _pv_value::rs, fis_param::s, _str::s, db_param::sa, fis_param::sval, db_param::table, fis_param::type, fis_param::u, and sip_uri::user.
Referenced by w_dbdelete_avps().
| int ops_dbload_avps | ( | struct sip_msg * | msg, | |
| struct fis_param * | sp, | |||
| struct db_param * | dbp, | |||
| int | use_domain | |||
| ) |
Definition at line 283 of file avpops_impl.c.
References db_param::a, AVP_NAME_STR, avpops_attr_buf, AVPOPS_ATTR_LEN, AVPOPS_FLAG_DOMAIN0, AVPOPS_FLAG_URI0, AVPOPS_FLAG_USER0, AVPOPS_FLAG_UUID0, avpops_str2int_str, AVPOPS_VAL_PVAR, AVPOPS_VAL_STR, db_close_query(), db_scheme::db_flags, db_load_avp(), dbrow2avp(), _pv_value::flags, sip_uri::host, _pv_name::isname, _str::len, LM_CRIT, LM_DBG, LM_ERR, LM_INFO, int_str::n, NULL, fis_param::opd, fis_param::ops, parse_uri(), pv_get_spec_name(), pv_get_spec_value(), pv_has_dname, PV_TYPE_INT, PV_VAL_EMPTY, PV_VAL_NULL, PV_VAL_STR, _pv_param::pvn, _pv_spec::pvp, _pv_value::ri, _pv_value::rs, fis_param::s, _str::s, db_param::sa, db_param::scheme, fis_param::sval, db_param::table, fis_param::type, _pv_name::u, fis_param::u, and sip_uri::user.
Referenced by w_dbload_avps().
| int ops_dbquery_avps | ( | struct sip_msg * | msg, | |
| pv_elem_t * | query, | |||
| pvname_list_t * | dest | |||
| ) |
Definition at line 734 of file avpops_impl.c.
References AVP_PRINTBUF_SIZE, db_query_avp(), LM_DBG, LM_ERR, NULL, printbuf, and pv_printf().
Referenced by w_dbquery1_avps(), and w_dbquery2_avps().
| int ops_dbstore_avps | ( | struct sip_msg * | msg, | |
| struct fis_param * | sp, | |||
| struct db_param * | dbp, | |||
| int | use_domain | |||
| ) |
Definition at line 536 of file avpops_impl.c.
References db_param::a, AVP_IS_IN_DB, AVP_NAME_STR, AVP_VAL_STR, avpops_attr_buf, AVPOPS_ATTR_LEN, AVPOPS_DB_NAME_INT, AVPOPS_DB_VAL_INT, AVPOPS_FLAG_DOMAIN0, AVPOPS_FLAG_URI0, AVPOPS_FLAG_USER0, AVPOPS_FLAG_UUID0, AVPOPS_VAL_INT, AVPOPS_VAL_NONE, AVPOPS_VAL_PVAR, AVPOPS_VAL_STR, db_store_avp(), usr_avp::flags, _pv_value::flags, get_avp_list(), get_avp_name(), get_avp_val(), sip_uri::host, usr_avp::id, int_str2db_val(), db_val_t::int_val, _pv_name::isname, _str::len, LM_CRIT, LM_DBG, LM_ERR, LM_INFO, int_str::n, usr_avp::next, NULL, fis_param::opd, fis_param::ops, parse_uri(), pv_get_spec_name(), pv_get_spec_value(), pv_has_dname, PV_TYPE_INT, PV_VAL_EMPTY, PV_VAL_NULL, PV_VAL_STR, _pv_param::pvn, _pv_spec::pvp, _pv_value::ri, _pv_value::rs, int_str::s, fis_param::s, _str::s, db_param::sa, search_first_avp(), db_val_t::str_val, fis_param::sval, db_param::table, fis_param::type, _pv_name::u, fis_param::u, sip_uri::user, and db_val_t::val.
Referenced by w_dbstore_avps().
Definition at line 762 of file avpops_impl.c.
References AVP_NAME_STR, AVP_SCRIPT_MASK, AVPOPS_FLAG_ALL, avpops_get_aname(), AVPOPS_VAL_INT, AVPOPS_VAL_NONE, AVPOPS_VAL_STR, destroy_avp(), destroy_avps(), usr_avp::flags, get_avp_list(), _pv_name::isname, LM_DBG, LM_ERR, usr_avp::next, fis_param::opd, fis_param::ops, _pv_param::pvn, _pv_spec::pvp, fis_param::sval, _pv_name::u, and fis_param::u.
Referenced by w_delete_avps().
Definition at line 1643 of file avpops_impl.c.
References AVP_VAL_STR, AVPOPS_FLAG_ALL, AVPOPS_FLAG_CASTN, AVPOPS_FLAG_CASTS, AVPOPS_FLAG_EMPTY, avpops_get_aname(), usr_avp::flags, _str::len, LM_ERR, int_str::n, fis_param::ops, pv_get_spec_index(), _pv_spec::pvp, _str::s, int_str::s, search_first_avp(), fis_param::sval, and fis_param::u.
Referenced by w_is_avp_set().
Definition at line 1446 of file avpops_impl.c.
References add_avp(), AVP_NAME_STR, AVP_VAL_STR, AVPOPS_FLAG_DELETE, avpops_get_aname(), AVPOPS_OP_ADD, AVPOPS_OP_BAND, AVPOPS_OP_BNOT, AVPOPS_OP_BOR, AVPOPS_OP_BXOR, AVPOPS_OP_DIV, AVPOPS_OP_MOD, AVPOPS_OP_MUL, AVPOPS_OP_SUB, AVPOPS_VAL_INT, AVPOPS_VAL_PVAR, destroy_avp(), _pv_value::flags, usr_avp::flags, _str::len, LM_CRIT, LM_DBG, LM_ERR, fis_param::n, int_str::n, NULL, fis_param::opd, fis_param::ops, pv_get_spec_value(), PV_TYPE_INT, PVT_AVP, _pv_value::ri, fis_param::s, _str::s, int_str::s, search_first_avp(), str_buf, STR_BUF_SIZE, fis_param::sval, fis_param::type, _pv_spec::type, and fis_param::u.
Referenced by w_op_avps().
| int ops_print_avp | ( | void | ) |
Definition at line 1306 of file avpops_impl.c.
References AVP_NAME_STR, AVP_VAL_STR, usr_avp::flags, get_avp_list(), get_avp_name(), get_avp_val(), usr_avp::id, _str::len, LM_INFO, int_str::n, usr_avp::next, int_str::s, and _str::s.
Referenced by w_print_avps().
Definition at line 908 of file avpops_impl.c.
References append_0(), append_branch(), AVP_VAL_STR, AVPOPS_FLAG_ALL, AVPOPS_FLAG_DOMAIN0, AVPOPS_FLAG_USER0, avpops_get_aname(), AVPOPS_USE_BRANCH, AVPOPS_USE_DURI, AVPOPS_USE_RURI, do_action(), action::elem, _pv_value::flags, usr_avp::flags, sip_msg::force_send_socket, int2str(), _str::len, LM_CRIT, LM_DBG, LM_ERR, int_str::n, NULL, fis_param::opd, fis_param::ops, pv_get_spec_value(), PV_TYPE_INT, PVT_AVP, Q_UNSPECIFIED, _pv_value::ri, _pv_value::rs, _str::s, int_str::s, search_first_avp(), set_dst_uri(), SET_HOST_T, SET_URI_T, SET_USER_T, action_elem_::string, STRING_ST, fis_param::sval, action::type, action_elem_::type, _pv_spec::type, action_elem_::u, and fis_param::u.
Referenced by w_pushto_avps().
| int ops_subst | ( | struct sip_msg * | msg, | |
| struct fis_param ** | src, | |||
| struct subst_expr * | subst | |||
| ) |
Definition at line 1341 of file avpops_impl.c.
References add_avp(), AVP_NAME_STR, AVP_VAL_STR, AVPOPS_FLAG_ALL, AVPOPS_FLAG_DELETE, avpops_get_aname(), destroy_avp(), is_avp_str_val, _str::len, LM_DBG, LM_ERR, NULL, pkg_free, _str::s, int_str::s, search_first_avp(), str_buf, STR_BUF_SIZE, and subst_str().
Referenced by w_subst().
1.5.6