#include <sys/types.h>#include <regex.h>#include <string.h>#include "permissions.h"#include "hash.h"#include "../../config.h"#include "../../db/db.h"#include "../../ip_addr.h"#include "../../mem/shm_mem.h"#include "../../parser/msg_parser.h"#include "../../parser/parse_from.h"#include "../../usr_avp.h"

Go to the source code of this file.
Defines | |
| #define | TABLE_VERSION 4 |
Functions | |
| int | allow_trusted (struct sip_msg *msg, char *src_ip, int proto) |
| int | allow_trusted_0 (struct sip_msg *_msg, char *str1, char *str2) |
| int | allow_trusted_2 (struct sip_msg *_msg, char *_src_ip_sp, char *_proto_sp) |
| void | clean_trusted (void) |
| int | init_child_trusted (int rank) |
| int | init_trusted (void) |
| static int | match_proto (const char *proto_string, int proto_int) |
| static int | match_res (struct sip_msg *msg, int proto, db_res_t *_r) |
| int | mi_init_trusted (void) |
| int | reload_trusted_table (void) |
Variables | |
| static db_con_t * | db_handle = 0 |
| struct trusted_list *** | hash_table |
| struct trusted_list ** | hash_table_1 |
| struct trusted_list ** | hash_table_2 |
| static db_func_t | perm_dbf |
| int allow_trusted | ( | struct sip_msg * | msg, | |
| char * | src_ip, | |||
| int | proto | |||
| ) |
Definition at line 393 of file trusted.c.
References db_func::close, db_mode, DB_STRING, db_url, DISABLE_CACHE, db_func::free_result, from_col, LM_ERR, match_hash_table(), match_res(), NULL, proto_col, db_func::query, RES_ROW_N, _str::s, source_col, tag_col, trusted_table, db_func::use_table, VAL_NULL, VAL_STRING, VAL_TYPE, and vals.
Referenced by allow_trusted_0(), and allow_trusted_2().
| int allow_trusted_0 | ( | struct sip_msg * | _msg, | |
| char * | str1, | |||
| char * | str2 | |||
| ) |
Definition at line 447 of file trusted.c.
References allow_trusted(), ip_addr2a(), receive_info::proto, sip_msg::rcv, and receive_info::src_ip.
| int allow_trusted_2 | ( | struct sip_msg * | _msg, | |
| char * | _src_ip_sp, | |||
| char * | _proto_sp | |||
| ) |
Definition at line 458 of file trusted.c.
References allow_trusted(), _pv_value::flags, LM_ERR, trusted_list::proto, PROTO_SCTP, PROTO_TCP, PROTO_TLS, PROTO_UDP, pv_get_spec_value(), PV_VAL_STR, _pv_value::rs, _str::s, and trusted_list::src_ip.
| void clean_trusted | ( | void | ) |
Definition at line 271 of file trusted.c.
References free_hash_table(), and shm_free.
Referenced by mod_exit().
| int init_child_trusted | ( | int | rank | ) |
Definition at line 227 of file trusted.c.
References db_func::close, db_check_table_version(), db_mode, db_url, DISABLE_CACHE, db_func::init, LM_ERR, _str::s, TABLE_VERSION, and trusted_table.
Referenced by child_init().
| int init_trusted | ( | void | ) |
Definition at line 148 of file trusted.c.
References db_func::close, db_bind_mod(), DB_CAP_QUERY, DB_CAPABILITY, db_check_table_version(), db_mode, db_url, ENABLE_CACHE, free_hash_table(), db_func::init, LM_CRIT, LM_ERR, LM_INFO, new_hash_table(), reload_trusted_table(), _str::s, shm_free, shm_malloc(), TABLE_VERSION, and trusted_table.
Referenced by mod_init().
| static int match_proto | ( | const char * | proto_string, | |
| int | proto_int | |||
| ) | [inline, static] |
Definition at line 283 of file trusted.c.
References LM_ERR, PROTO_SCTP, PROTO_TCP, PROTO_TLS, and PROTO_UDP.
Referenced by match_res().
Definition at line 328 of file trusted.c.
References add_avp(), AVP_VAL_STR, DB_STRING, get_from, get_tag_avp(), _str::len, LM_ERR, match_proto(), MAX_URI_SIZE, int_str::n, parse_from_header(), RES_ROW_N, RES_ROWS, ROW_N, ROW_VALUES, int_str::s, _str::s, tag_avp, tag_avp_type, VAL_NULL, VAL_STRING, and VAL_TYPE.
Referenced by allow_trusted().
| int mi_init_trusted | ( | void | ) |
Definition at line 256 of file trusted.c.
References db_url, db_func::init, LM_ERR, and _str::s.
Referenced by mi_trusted_child_init().
| int reload_trusted_table | ( | void | ) |
Definition at line 58 of file trusted.c.
References DB_STRING, empty_hash_table(), db_func::free_result, from_col, hash_table_insert(), LM_DBG, LM_ERR, new_hash_table(), NULL, trusted_list::pattern, proto_col, db_func::query, RES_ROW_N, RES_ROWS, ROW_N, ROW_VALUES, source_col, trusted_list::tag, tag_col, trusted_table, db_func::use_table, VAL_NULL, VAL_STRING, and VAL_TYPE.
Referenced by init_trusted(), and mi_trusted_reload().
| struct trusted_list*** hash_table |
| struct trusted_list** hash_table_1 |
| struct trusted_list** hash_table_2 |
1.5.6