#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <regex.h>#include <fnmatch.h>#include "../../ut.h"#include "../../dprint.h"#include "../../usr_avp.h"#include "../../action.h"#include "../../ip_addr.h"#include "../../config.h"#include "../../dset.h"#include "../../data_lump.h"#include "../../data_lump_rpl.h"#include "../../pvar.h"#include "../../parser/parse_from.h"#include "../../parser/parse_uri.h"#include "../../mem/mem.h"#include "avpops_impl.h"#include "avpops_db.h"

Go to the source code of this file.
Defines | |
| #define | AVP_PRINTBUF_SIZE 1024 |
| #define | AVPOPS_ATTR_LEN 64 |
| #define | avpops_str2int_str(a, b) |
| #define | STR_BUF_SIZE 1024 |
Functions | |
| static int | append_0 (str *in, str *out) |
| static int | avpops_get_aname (struct sip_msg *msg, struct fis_param *ap, int_str *avp_name, unsigned short *name_type) |
| static int | dbrow2avp (struct db_row *row, struct db_param *dbp, int_str attr, int attr_type, int just_val_flags) |
| static str * | get_source_uri (struct sip_msg *msg, int source) |
| void | init_store_avps (str **db_columns) |
| static void | int_str2db_val (int_str is_val, str *val, int is_s) |
| int | ops_check_avp (struct sip_msg *msg, struct fis_param *src, struct fis_param *val) |
| int | ops_copy_avp (struct sip_msg *msg, struct fis_param *src, struct fis_param *dst) |
| 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 **av, struct fis_param *val) |
| int | ops_print_avp (void) |
| int | ops_pushto_avp (struct sip_msg *msg, struct fis_param *dst, struct fis_param *src) |
| int | ops_subst (struct sip_msg *msg, struct fis_param **src, struct subst_expr *se) |
Variables | |
| static char | avpops_attr_buf [AVPOPS_ATTR_LEN] |
| static str | empty = {"",0} |
| static char | printbuf [AVP_PRINTBUF_SIZE] |
| static db_key_t | store_keys [6] |
| static db_val_t | store_vals [6] |
| static char | str_buf [STR_BUF_SIZE] |
| #define AVP_PRINTBUF_SIZE 1024 |
| #define AVPOPS_ATTR_LEN 64 |
Definition at line 280 of file avpops_impl.c.
Referenced by ops_dbdelete_avps(), ops_dbload_avps(), and ops_dbstore_avps().
| #define avpops_str2int_str | ( | a, | |||
| b | ) |
| #define STR_BUF_SIZE 1024 |
Definition at line 893 of file avpops_impl.c.
Referenced by append_0(), ldap_filter_url_encode(), ldap_write_result(), ops_check_avp(), ops_op_avp(), and ops_subst().
Definition at line 896 of file avpops_impl.c.
References _str::len, _str::s, str_buf, and STR_BUF_SIZE.
Referenced by ops_pushto_avp().
| static int avpops_get_aname | ( | struct sip_msg * | msg, | |
| struct fis_param * | ap, | |||
| int_str * | avp_name, | |||
| unsigned short * | name_type | |||
| ) | [static] |
Definition at line 268 of file avpops_impl.c.
References LM_ERR, NULL, pv_get_avp_name(), _pv_spec::pvp, fis_param::sval, and fis_param::u.
Referenced by ops_check_avp(), ops_copy_avp(), ops_delete_avp(), ops_is_avp_set(), ops_op_avp(), ops_pushto_avp(), and ops_subst().
| static int dbrow2avp | ( | struct db_row * | row, | |
| struct db_param * | dbp, | |||
| int_str | attr, | |||
| int | attr_type, | |||
| int | just_val_flags | |||
| ) | [static] |
Definition at line 102 of file avpops_impl.c.
References db_param::a, add_avp(), AVP_IS_IN_DB, AVP_NAME_STR, AVP_VAL_STR, AVPOPS_DB_NAME_INT, AVPOPS_DB_VAL_INT, AVPOPS_VAL_INT, AVPOPS_VAL_NONE, AVPOPS_VAL_STR, db_scheme::db_flags, DB_INT, DB_STR, DB_STRING, int2str(), db_val_t::int_val, _pv_name::isname, _str::len, LM_DBG, LM_ERR, int_str::n, db_val_t::nul, fis_param::opd, _pv_param::pvn, _pv_spec::pvp, int_str::s, _str::s, str2int(), db_val_t::str_val, db_val_t::string_val, fis_param::sval, db_val_t::type, _pv_name::u, fis_param::u, db_val_t::val, and db_row::values.
Referenced by ops_dbload_avps().
Definition at line 224 of file avpops_impl.c.
References AVPOPS_USE_FROM, AVPOPS_USE_RURI, AVPOPS_USE_TO, sip_msg::first_line, get_from, get_to, HDR_TO_F, _str::len, LM_ERR, sip_msg::new_uri, NULL, parse_from_header(), parse_headers(), msg_start::request, _str::s, and msg_start::u.
Referenced by __dialog_confirmed(), __dialog_created(), __dialog_early(), keepalive_registration(), and keepalive_subscription().
| 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 255 of file avpops_impl.c.
References int2str(), _str::len, int_str::n, _str::s, and int_str::s.
Referenced by ops_dbstore_avps().
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 * | se | |||
| ) |
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().
char avpops_attr_buf[AVPOPS_ATTR_LEN] [static] |
Definition at line 281 of file avpops_impl.c.
Referenced by ops_dbdelete_avps(), ops_dbload_avps(), and ops_dbstore_avps().
Definition at line 63 of file avpops_impl.c.
Referenced by dlg_bridge_tm_callback(), dlg_transfer(), and mi_print_uris().
char printbuf[AVP_PRINTBUF_SIZE] [static] |
db_key_t store_keys[6] [static] |
Definition at line 61 of file avpops_impl.c.
db_val_t store_vals[6] [static] |
Definition at line 62 of file avpops_impl.c.
char str_buf[STR_BUF_SIZE] [static] |
Definition at line 894 of file avpops_impl.c.
Referenced by append_0(), ldap_filter_url_encode(), ldap_write_result(), ops_check_avp(), ops_op_avp(), ops_subst(), and use_media_proxy().
1.5.6