#include <sys/types.h>#include <regex.h>#include "../../mem/shm_mem.h"#include "../../parser/parse_from.h"#include "../../ut.h"#include "../../hash_func.h"#include "../../usr_avp.h"#include "../../ip_addr.h"#include "../../pvar.h"#include "hash.h"#include "trusted.h"#include "address.h"

Go to the source code of this file.
Defines | |
| #define | perm_hash(_s) core_hash( &(_s), 0, PERM_HASH_SIZE) |
Functions | |
| int | addr_hash_table_insert (struct addr_list **table, unsigned int grp, unsigned int ip_addr, unsigned int port) |
| int | addr_hash_table_mi_print (struct addr_list **table, struct mi_node *rpl) |
| void | empty_addr_hash_table (struct addr_list **table) |
| void | empty_hash_table (struct trusted_list **table) |
| void | empty_subnet_table (struct subnet *table) |
| int | find_group_in_addr_hash_table (struct addr_list **table, unsigned int ip_addr, unsigned int port) |
| int | find_group_in_subnet_table (struct subnet *table, unsigned int ip_addr, unsigned int port) |
| void | free_addr_hash_table (struct addr_list **table) |
| void | free_hash_table (struct trusted_list **table) |
| void | free_subnet_table (struct subnet *table) |
| void | get_tag_avp (int_str *tag_avp_p, int *tag_avp_type_p) |
| int | hash_table_insert (struct trusted_list **table, char *src_ip, char *proto, char *pattern, char *tag) |
| int | hash_table_mi_print (struct trusted_list **table, struct mi_node *rpl) |
| int | init_tag_avp (str *tag_avp_param) |
| int | match_addr_hash_table (struct addr_list **table, unsigned int group, unsigned int ip_addr, unsigned int port) |
| int | match_hash_table (struct trusted_list **table, struct sip_msg *msg, char *src_ip_c_str, int proto) |
| int | match_subnet_table (struct subnet *table, unsigned int grp, unsigned int ip_addr, unsigned int port) |
| struct addr_list ** | new_addr_hash_table (void) |
| struct trusted_list ** | new_hash_table (void) |
| struct subnet * | new_subnet_table (void) |
| int | subnet_table_insert (struct subnet *table, unsigned int grp, unsigned int subnet, unsigned int mask, unsigned int port) |
| int | subnet_table_mi_print (struct subnet *table, struct mi_node *rpl) |
Variables | |
| static int_str | tag_avp |
| static int | tag_avp_type |
| #define perm_hash | ( | _s | ) | core_hash( &(_s), 0, PERM_HASH_SIZE) |
Definition at line 36 of file permissions/hash.c.
Referenced by addr_hash_table_insert(), find_group_in_addr_hash_table(), hash_table_insert(), match_addr_hash_table(), and match_hash_table().
| int addr_hash_table_insert | ( | struct addr_list ** | table, | |
| unsigned int | grp, | |||
| unsigned int | ip_addr, | |||
| unsigned int | port | |||
| ) |
Definition at line 342 of file permissions/hash.c.
References addr_list::grp, addr_list::ip_addr, _str::len, LM_ERR, addr_list::next, NULL, perm_hash, addr_list::port, _str::s, and shm_malloc().
Referenced by reload_address_table().
Definition at line 421 of file permissions/hash.c.
References addf_mi_node_child(), ip_addr::addr32, ip_addr::af, addr_list::grp, addr_list::ip_addr, ip_addr2a(), ip_addr::len, addr_list::next, PERM_HASH_SIZE, addr_list::port, and ip_addr::u.
Referenced by mi_address_dump().
| void empty_addr_hash_table | ( | struct addr_list ** | table | ) |
Definition at line 449 of file permissions/hash.c.
References addr_list::next, PERM_HASH_SIZE, and shm_free.
Referenced by free_addr_hash_table(), and reload_address_table().
| void empty_hash_table | ( | struct trusted_list ** | table | ) |
Definition at line 286 of file permissions/hash.c.
References trusted_list::next, trusted_list::pattern, PERM_HASH_SIZE, _str::s, shm_free, trusted_list::src_ip, and trusted_list::tag.
Referenced by free_hash_table(), and reload_trusted_table().
| void empty_subnet_table | ( | struct subnet * | table | ) |
Definition at line 607 of file permissions/hash.c.
References subnet::grp, and PERM_MAX_SUBNETS.
Referenced by reload_address_table().
| int find_group_in_addr_hash_table | ( | struct addr_list ** | table, | |
| unsigned int | ip_addr, | |||
| unsigned int | port | |||
| ) |
Definition at line 398 of file permissions/hash.c.
References addr_list::grp, addr_list::ip_addr, _str::len, addr_list::next, NULL, perm_hash, addr_list::port, and _str::s.
Referenced by allow_source_address_group().
| int find_group_in_subnet_table | ( | struct subnet * | table, | |
| unsigned int | ip_addr, | |||
| unsigned int | port | |||
| ) |
Definition at line 559 of file permissions/hash.c.
References subnet::grp, subnet::mask, and PERM_MAX_SUBNETS.
Referenced by allow_source_address_group().
| void free_addr_hash_table | ( | struct addr_list ** | table | ) |
Definition at line 329 of file permissions/hash.c.
References empty_addr_hash_table(), and shm_free.
Referenced by clean_addresses(), and init_addresses().
| void free_hash_table | ( | struct trusted_list ** | table | ) |
Definition at line 105 of file permissions/hash.c.
References empty_hash_table(), and shm_free.
Referenced by clean_trusted(), init_hash_table(), init_trusted(), and tm_shutdown().
| void free_subnet_table | ( | struct subnet * | table | ) |
Definition at line 616 of file permissions/hash.c.
References shm_free.
Referenced by clean_addresses(), and init_addresses().
| void get_tag_avp | ( | int_str * | tag_avp_p, | |
| int * | tag_avp_type_p | |||
| ) |
Definition at line 75 of file permissions/hash.c.
References tag_avp_type.
Referenced by match_res().
| int hash_table_insert | ( | struct trusted_list ** | table, | |
| char * | src_ip, | |||
| char * | proto, | |||
| char * | pattern, | |||
| char * | tag | |||
| ) |
Definition at line 119 of file permissions/hash.c.
References _str::len, LM_CRIT, LM_ERR, trusted_list::next, NULL, trusted_list::pattern, perm_hash, trusted_list::proto, PROTO_NONE, PROTO_SCTP, PROTO_TCP, PROTO_TLS, PROTO_UDP, _str::s, shm_free, shm_malloc(), trusted_list::src_ip, and trusted_list::tag.
Referenced by reload_trusted_table().
| int hash_table_mi_print | ( | struct trusted_list ** | table, | |
| struct mi_node * | rpl | |||
| ) |
Definition at line 258 of file permissions/hash.c.
References addf_mi_node_child(), _str::len, trusted_list::next, trusted_list::pattern, PERM_HASH_SIZE, trusted_list::proto, _str::s, trusted_list::src_ip, trusted_list::tag, and ZSW.
| int init_tag_avp | ( | str * | tag_avp_param | ) |
Definition at line 47 of file permissions/hash.c.
References _str::len, LM_ERR, int_str::n, pv_get_avp_name(), pv_parse_spec(), _pv_spec::pvp, PVT_AVP, _str::s, tag_avp_type, and _pv_spec::type.
Referenced by mod_init().
| int match_addr_hash_table | ( | struct addr_list ** | table, | |
| unsigned int | group, | |||
| unsigned int | ip_addr, | |||
| unsigned int | port | |||
| ) |
Definition at line 373 of file permissions/hash.c.
References addr_list::grp, addr_list::ip_addr, _str::len, addr_list::next, NULL, perm_hash, addr_list::port, and _str::s.
Referenced by allow_address(), and allow_source_address().
| int match_hash_table | ( | struct trusted_list ** | table, | |
| struct sip_msg * | msg, | |||
| char * | src_ip_c_str, | |||
| int | proto | |||
| ) |
Definition at line 203 of file permissions/hash.c.
References add_avp(), AVP_VAL_STR, get_from, _str::len, LM_ERR, MAX_URI_SIZE, int_str::n, trusted_list::next, NULL, parse_from_header(), trusted_list::pattern, perm_hash, trusted_list::proto, PROTO_NONE, int_str::s, _str::s, trusted_list::src_ip, trusted_list::tag, and tag_avp_type.
Referenced by allow_trusted().
| int match_subnet_table | ( | struct subnet * | table, | |
| unsigned int | grp, | |||
| unsigned int | ip_addr, | |||
| unsigned int | port | |||
| ) |
Definition at line 529 of file permissions/hash.c.
References subnet::grp, mask, and PERM_MAX_SUBNETS.
Referenced by allow_address(), and allow_source_address().
| struct addr_list** new_addr_hash_table | ( | void | ) | [read] |
Definition at line 309 of file permissions/hash.c.
References LM_ERR, PERM_HASH_SIZE, and shm_malloc().
Referenced by init_addresses().
| struct trusted_list** new_hash_table | ( | void | ) | [read] |
Definition at line 85 of file permissions/hash.c.
References LM_ERR, PERM_HASH_SIZE, and shm_malloc().
Referenced by init_trusted(), reload_address_table(), reload_domain_table(), and reload_trusted_table().
| struct subnet* new_subnet_table | ( | void | ) | [read] |
Definition at line 469 of file permissions/hash.c.
References subnet::grp, LM_ERR, PERM_MAX_SUBNETS, and shm_malloc().
Referenced by init_addresses(), and reload_address_table().
| int subnet_table_insert | ( | struct subnet * | table, | |
| unsigned int | grp, | |||
| unsigned int | subnet, | |||
| unsigned int | mask, | |||
| unsigned int | port | |||
| ) |
Definition at line 490 of file permissions/hash.c.
References subnet::grp, LM_CRIT, subnet::mask, PERM_MAX_SUBNETS, subnet::port, and subnet::subnet.
Referenced by reload_address_table().
Definition at line 582 of file permissions/hash.c.
References addf_mi_node_child(), ip_addr::addr32, ip_addr::af, subnet::grp, ip_addr2a(), ip_addr::len, mask, PERM_MAX_SUBNETS, port, and ip_addr::u.
Referenced by mi_subnet_dump().
int tag_avp_type [static] |
Definition at line 40 of file permissions/hash.c.
Referenced by get_tag_avp(), init_tag_avp(), match_hash_table(), and match_res().
1.5.6