#include "str.h"


Go to the source code of this file.
Data Structures | |
| union | int_str |
| struct | usr_avp |
Defines | |
| #define | avp_core_flags(f) ((f)&0x00ff) |
| #define | AVP_CORE_MASK 0x00ff |
| #define | avp_get_script_flags(f) (((f)&0xff00)>>8) |
| #define | AVP_NAME_DELIM ':' |
| #define | AVP_NAME_STR (1<<0) |
| #define | AVP_NAME_VALUE_MASK 0x0003 |
| #define | avp_script_flags(f) (((f)<<8)&0xff00) |
| #define | AVP_SCRIPT_MASK 0xff00 |
| #define | AVP_VAL_STR (1<<1) |
| #define | is_avp_str_name(a) (a->flags&AVP_NAME_STR) |
| #define | is_avp_str_val(a) (a->flags&AVP_VAL_STR) |
Functions | |
| int | add_avp (unsigned short flags, int_str name, int_str val) |
| Add an AVP to the global list. | |
| int | add_avp_galias (str *alias, int type, int_str avp_name) |
| Add global AVP alias to the list, allocate private memory. | |
| int | add_avp_galias_str (char *alias_definition) |
| Add global alias. | |
| void | destroy_avp (struct usr_avp *avp) |
| Search AVP in list and delete it. | |
| void | destroy_avp_list (struct usr_avp **list) |
| Free an AVP list in shared memory with memory locking. | |
| void | destroy_avp_list_unsafe (struct usr_avp **list) |
| Free an AVP list in shared memory without memory locking. | |
| int | destroy_avps (unsigned short flags, int_str name, int all) |
| Search AVP(s) in list and destroy them. | |
| struct usr_avp ** | get_avp_list (void) |
| Return global AVP list, assert that is not null. | |
| str * | get_avp_name (struct usr_avp *avp) |
| Get AVP name. | |
| void | get_avp_val (struct usr_avp *avp, int_str *val) |
| Get AVP value. | |
| int | lookup_avp_galias (str *alias, int *type, int_str *avp_name) |
| Lookup global AVP alias. | |
| int | parse_avp_name (str *name, int *type, int_str *avp_name) |
| Parse an AVP name (as string) and set type and name. | |
| int | parse_avp_spec (str *name, int *type, int_str *avp_name) |
| Parse AVP specification (alias or AVP) and set type and name. | |
| void | reset_avps (void) |
| Destroy global AVP list. | |
| struct usr_avp * | search_first_avp (unsigned short flags, int_str name, int_str *val, struct usr_avp *start) |
| Search the first matching AVP in the global list. | |
| struct usr_avp * | search_next_avp (struct usr_avp *avp, int_str *val) |
| Search the next AVP in the given AVP list. | |
| struct usr_avp ** | set_avp_list (struct usr_avp **list) |
| Set global AVP list, assert that old list is not null. | |
Definition in file usr_avp.h.
| #define AVP_NAME_DELIM ':' |
delimiter between data type and name
Definition at line 74 of file usr_avp.h.
Referenced by parse_avp_name(), and parse_avp_spec().
| #define AVP_NAME_STR (1<<0) |
Definition at line 83 of file usr_avp.h.
Referenced by add_avp(), add_avp_galias(), check_avp_galias(), dbrow2avp(), extract_avp(), free_aaa_avp(), generate_avps(), get_avp_name(), get_avp_val(), h350_auth_lookup(), h350_call_preferences(), h350_service_level(), internal_search_ID_avp(), internal_search_name_avp(), ldap_filter_url_encode(), ldap_write_result(), mod_init(), ops_dbload_avps(), ops_dbstore_avps(), ops_delete_avp(), ops_op_avp(), ops_print_avp(), ops_subst(), ospCheckOrigDestination(), ospCheckTranslation(), ospDumpAllDestination(), ospDumpParameters(), ospGetLastOrigDestination(), ospGetNextOrigDestination(), ospGetTermDestination(), ospPrepareDestination(), ospReportOrigSetupUsage(), ospSaveDestination(), parse_aaa_avps(), parse_avp_db(), parse_avp_name(), pv_get_avp_name(), pv_get_spec_name(), pv_parse_color_name(), search_first_avp(), search_next_avp(), and stack_to_avp().
| #define avp_script_flags | ( | f | ) | (((f)<<8)&0xff00) |
| #define AVP_SCRIPT_MASK 0xff00 |
Definition at line 78 of file usr_avp.h.
Referenced by ops_delete_avp(), pv_get_avp_name(), search_first_avp(), and search_next_avp().
| #define AVP_VAL_STR (1<<1) |
Definition at line 84 of file usr_avp.h.
Referenced by actually_rewrite(), add_avp(), add_gws_into_avps(), append_rpid_hf(), append_rpid_hf_p(), avp2timer(), cr_gp2id(), db_query_avp(), dbrow2avp(), do_load_gws(), dp_apply_policy(), ds_mark_dst(), ds_next_dst(), ds_select_dst(), exec_avp(), extract_avp(), fix_nated_register_f(), generate_avps(), get_avp_name(), get_avp_val(), get_media_relay(), get_signaling_ip(), h350_auth_lookup(), h350_call_preferences(), is_rpid_user_e164(), ldap_filter_url_encode(), ldap_write_result(), legs2strar(), match_hash_table(), match_res(), next_gw(), ops_check_avp(), ops_copy_avp(), ops_dbstore_avps(), ops_is_avp_set(), ops_op_avp(), ops_print_avp(), ops_pushto_avp(), ops_subst(), ospCheckOrigDestination(), ospDumpAllDestination(), ospGetLastOrigDestination(), ospGetNextOrigDestination(), ospGetTermDestination(), ospReportOrigSetupUsage(), ospRequestRouting(), ospSaveDestination(), ospSetRpid(), parse_avp_db_scheme(), stack_to_avp(), and t_load_contacts().
| #define is_avp_str_val | ( | a | ) | (a->flags&AVP_VAL_STR) |
Definition at line 87 of file usr_avp.h.
Referenced by extract_aor(), m_store(), ops_subst(), registered(), and siptrace_get_table().
Add an AVP to the global list.
| flags | AVP flags | |
| name | AVP name | |
| val | AVP value |
Definition at line 94 of file usr_avp.c.
References AVP_NAME_STR, AVP_VAL_STR, compute_ID(), usr_avp::data, usr_avp::flags, usr_avp::id, _str::len, len, LM_ERR, int_str::n, str_str_data::name, str_int_data::name, usr_avp::next, _str::s, int_str::s, s, shm_malloc(), str_str_data::val, and str_int_data::val.
Referenced by actually_rewrite(), add_gws_into_avps(), cr_load_user_carrier(), db_query_avp(), dbrow2avp(), do_from_gw(), ds_select_dst(), exec_avp(), fix_nated_register_f(), generate_avps(), h350_auth_lookup(), h350_call_preferences(), h350_service_level(), ldap_filter_url_encode(), ldap_write_result(), match_hash_table(), match_res(), next_gw(), ops_copy_avp(), ops_op_avp(), ops_subst(), ospPrepareDestination(), ospSaveDestination(), ospSetRpid(), run_proxy(), set_next_domain_on_rule(), stack_to_avp(), t_load_contacts(), and t_next_contacts().
Add global AVP alias to the list, allocate private memory.
| alias | alias string | |
| type | AVP type | |
| avp_name | AVP name |
Definition at line 467 of file usr_avp.c.
References avp_galias::alias, avp_galias::avp, AVP_NAME_STR, check_avp_galias(), _str::len, LM_DBG, LM_ERR, int_str::n, avp_spec::name, avp_galias::next, pkg_free, pkg_malloc, _str::s, int_str::s, and avp_spec::type.
Referenced by add_avp_galias_str().
| int add_avp_galias_str | ( | char * | alias_definition | ) |
Add global alias.
| alias_definition | alias definition, including the AVP |
Definition at line 621 of file usr_avp.c.
References add_avp_galias(), avp_galias::alias, _str::len, LM_ERR, parse_avp_name(), _str::s, and s.
| void destroy_avp | ( | struct usr_avp * | avp | ) |
Search AVP in list and delete it.
| avp | searched AVP |
Definition at line 349 of file usr_avp.c.
References usr_avp::next, avp::next, and shm_free.
Referenced by destroy_avps(), ds_next_dst(), generate_uris(), ops_copy_avp(), ops_delete_avp(), ops_op_avp(), ops_subst(), and t_next_contacts().
| void destroy_avp_list | ( | struct usr_avp ** | list | ) | [inline] |
Free an AVP list in shared memory with memory locking.
Definition at line 397 of file usr_avp.c.
References LM_DBG, usr_avp::next, and shm_free.
Referenced by build_cell(), and reset_avps().
| void destroy_avp_list_unsafe | ( | struct usr_avp ** | list | ) |
Free an AVP list in shared memory without memory locking.
Definition at line 383 of file usr_avp.c.
References usr_avp::next, and shm_free_unsafe.
Referenced by free_cell().
| int destroy_avps | ( | unsigned short | flags, | |
| int_str | name, | |||
| int | all | |||
| ) |
Search AVP(s) in list and destroy them.
| flags | AVP flags | |
| name | AVP name | |
| all | set to 1 to delete all matching AVPs, 0 to delete only the first |
Definition at line 367 of file usr_avp.c.
References destroy_avp(), and search_first_avp().
Referenced by ops_delete_avp().
| struct usr_avp** get_avp_list | ( | void | ) | [read] |
Return global AVP list, assert that is not null.
Definition at line 236 of file usr_avp.c.
Referenced by ops_dbstore_avps(), ops_delete_avp(), and ops_print_avp().
Get AVP name.
| avp | inspected AVP |
Definition at line 179 of file usr_avp.c.
References AVP_NAME_STR, AVP_VAL_STR, usr_avp::data, usr_avp::flags, LM_ERR, and str_str_data::name.
Referenced by internal_search_name_avp(), ops_dbstore_avps(), ops_print_avp(), and search_next_avp().
Get AVP value.
Definition at line 205 of file usr_avp.c.
References AVP_NAME_STR, AVP_VAL_STR, usr_avp::data, usr_avp::flags, int_str::n, and int_str::s.
Referenced by ops_dbstore_avps(), ops_print_avp(), ospCheckOrigDestination(), ospDumpAllDestination(), ospGetLastOrigDestination(), ospGetNextOrigDestination(), ospReportOrigSetupUsage(), search_first_avp(), and search_next_avp().
Lookup global AVP alias.
| alias | alias string | |
| type | AVP type | |
| avp_name | AVP name |
Definition at line 529 of file usr_avp.c.
References avp_galias::alias, avp_galias::avp, _str::len, avp_spec::name, avp_galias::next, _str::s, and avp_spec::type.
Referenced by parse_avp_spec().
Parse an AVP name (as string) and set type and name.
| name | AVP name | |
| type | AVP type | |
| avp_name | AVP name |
Definition at line 547 of file usr_avp.c.
References AVP_NAME_DELIM, AVP_NAME_STR, avp_script_flags, id, _str::len, LM_ERR, int_str::n, NULL, int_str::s, _str::s, s, and str2int().
Referenced by add_avp_galias_str(), and parse_avp_spec().
Parse AVP specification (alias or AVP) and set type and name.
| name | AVP name | |
| type | AVP type | |
| avp_name |
Definition at line 604 of file usr_avp.c.
References AVP_NAME_DELIM, _str::len, lookup_avp_galias(), NULL, parse_avp_name(), and _str::s.
| void reset_avps | ( | void | ) |
Destroy global AVP list.
Definition at line 412 of file usr_avp.c.
References destroy_avp_list().
Referenced by build_cell(), receive_msg(), and t_uac_cancel().
| struct usr_avp* search_first_avp | ( | unsigned short | flags, | |
| int_str | name, | |||
| int_str * | val, | |||
| struct usr_avp * | start | |||
| ) | [read] |
Search the first matching AVP in the global list.
Search the first AVP in the global list that matches to the given parameter.
| flags | AVP flags | |
| name | AVP name | |
| val | AVP value | |
| start | start the search at start->next, if NULL start from the head of the global list |
Definition at line 281 of file usr_avp.c.
References AVP_NAME_STR, AVP_SCRIPT_MASK, compute_ID(), get_avp_val(), internal_search_ID_avp(), internal_search_name_avp(), _str::len, LM_ERR, int_str::n, usr_avp::next, _str::s, and int_str::s.
Referenced by append_rpid_hf(), append_rpid_hf_p(), avp2timer(), cr_gp2id(), destroy_avps(), do_load_gws(), dp_apply_policy(), ds_mark_dst(), ds_next_dst(), extract_aor(), generate_uris(), get_media_relay(), get_signaling_ip(), is_rpid_user_e164(), legs2strar(), m_store(), next_gw(), ops_check_avp(), ops_copy_avp(), ops_dbstore_avps(), ops_is_avp_set(), ops_op_avp(), ops_pushto_avp(), ops_subst(), ospCheckOrigDestination(), ospCheckTranslation(), ospDumpAllDestination(), ospGetLastOrigDestination(), ospGetNextOrigDestination(), ospGetTermDestination(), ospReportOrigSetupUsage(), ospRequestRouting(), pack_ci(), registered(), sip_trace(), siptrace_get_table(), t_next_contacts(), tls_tcpconn_init(), trace_onreply_in(), trace_onreply_out(), trace_onreq_in(), trace_onreq_out(), and trace_sl_onreply_out().
Search the next AVP in the given AVP list.
Search the next AVP in the given AVP list, that is returned from search_first_avp
Definition at line 327 of file usr_avp.c.
References AVP_NAME_STR, AVP_SCRIPT_MASK, usr_avp::flags, get_avp_name(), get_avp_val(), usr_avp::id, internal_search_ID_avp(), internal_search_name_avp(), and usr_avp::next.
Referenced by ds_next_dst(), legs2strar(), ospCheckOrigDestination(), ospDumpAllDestination(), ospGetLastOrigDestination(), ospGetNextOrigDestination(), ospReportOrigSetupUsage(), sip_trace(), t_next_contacts(), trace_onreply_in(), trace_onreply_out(), trace_onreq_out(), and trace_sl_onreply_out().
Set global AVP list, assert that old list is not null.
Definition at line 423 of file usr_avp.c.
Referenced by build_cell(), faked_env(), pre_print_uac_request(), reply_received(), run_reqin_callbacks(), run_trans_callbacks(), and t_uac().
1.5.6