#include <stdio.h>#include "permissions.h"#include "parse_config.h"#include "trusted.h"#include "address.h"#include "hash.h"#include "mi.h"#include "../../mem/mem.h"#include "../../parser/parse_from.h"#include "../../parser/parse_uri.h"#include "../../parser/parse_refer_to.h"#include "../../parser/contact/parse_contact.h"#include "../../str.h"#include "../../dset.h"#include "../../globals.h"#include "../../mod_fix.h"#include "../../ut.h"

Go to the source code of this file.
Functions | |
| static int | allow_register_1 (struct sip_msg *msg, char *basename, char *s) |
| static int | allow_register_2 (struct sip_msg *msg, char *allow_file, char *deny_file) |
| static int | allow_routing_0 (struct sip_msg *msg, char *str1, char *str2) |
| static int | allow_routing_1 (struct sip_msg *msg, char *basename, char *str2) |
| static int | allow_routing_2 (struct sip_msg *msg, char *allow_file, char *deny_file) |
| int | allow_test (char *file, char *uri, char *contact) |
| static int | allow_uri (struct sip_msg *msg, char *basename, char *uri) |
| static int | check_register (struct sip_msg *msg, int idx) |
| static int | check_routing (struct sip_msg *msg, int idx) |
| static int | child_init (int rank) |
| static int | double_fixup (void **param, int param_no) |
| static int | find_index (rule_file_t *array, char *pathname) |
| static int | get_path (char *pathname) |
| static char * | get_pathname (char *name) |
| static char * | get_plain_uri (const str *uri) |
| static int | load_fixup (void **param, int param_no) |
| static int | mi_addr_child_init () |
| static int | mi_trusted_child_init () |
| static void | mod_exit (void) |
| static int | mod_init (void) |
| static int | single_fixup (void **param, int param_no) |
Variables | |
| str | address_table = str_init("address") |
| static MODULE_VERSION rule_file_t | allow [MAX_RULE_FILES] |
| char * | allow_suffix = ".allow" |
| static int | check_all_branches = 1 |
| static cmd_export_t | cmds [] |
| int | db_mode = DISABLE_CACHE |
| str | db_url = {NULL, 0} |
| static char * | default_allow_file = DEFAULT_ALLOW_FILE |
| static char * | default_deny_file = DEFAULT_DENY_FILE |
| static rule_file_t | deny [MAX_RULE_FILES] |
| static char * | deny_suffix = ".deny" |
| struct module_exports | exports |
| str | from_col = str_init("from_pattern") |
| str | grp_col = str_init("grp") |
| str | ip_addr_col = str_init("ip_addr") |
| str | mask_col = str_init("mask") |
| static mi_export_t | mi_cmds [] |
| static param_export_t | params [] |
| str | port_col = str_init("port") |
| str | proto_col = str_init("proto") |
| static int | rules_num |
| str | source_col = str_init("src_ip") |
| str | tag_avp_param = {NULL, 0} |
| str | tag_col = str_init("tag") |
| str | trusted_table = str_init("trusted") |
| int allow_register_1 | ( | struct sip_msg * | msg, | |
| char * | basename, | |||
| char * | s | |||
| ) | [static] |
| int allow_register_2 | ( | struct sip_msg * | msg, | |
| char * | allow_file, | |||
| char * | deny_file | |||
| ) | [static] |
| int allow_routing_0 | ( | struct sip_msg * | msg, | |
| char * | str1, | |||
| char * | str2 | |||
| ) | [static] |
| int allow_routing_1 | ( | struct sip_msg * | msg, | |
| char * | basename, | |||
| char * | str2 | |||
| ) | [static] |
| int allow_routing_2 | ( | struct sip_msg * | msg, | |
| char * | allow_file, | |||
| char * | deny_file | |||
| ) | [static] |
| int allow_test | ( | char * | file, | |
| char * | uri, | |||
| char * | contact | |||
| ) |
Definition at line 904 of file permissions.c.
References find_index(), get_pathname(), LM_DBG, LM_ERR, pkg_free, and search_rule().
Referenced by mi_allow_uri().
| static int allow_uri | ( | struct sip_msg * | msg, | |
| char * | basename, | |||
| char * | uri | |||
| ) | [static] |
Definition at line 820 of file permissions.c.
References EXPRESSION_LENGTH, _pv_value::flags, sip_msg::from, HDR_FROM_F, _str::len, hdr_field::len, len, LM_DBG, LM_ERR, parse_from_header(), parse_headers(), hdr_field::parsed, pv_get_spec_value(), PV_VAL_STR, _pv_value::rs, rule_file::rules, _str::s, and search_rule().
| static int check_register | ( | struct sip_msg * | msg, | |
| int | idx | |||
| ) | [static] |
Definition at line 708 of file permissions.c.
References check_all_branches, sip_msg::contact, contact_iterator(), EXPRESSION_LENGTH, get_plain_uri(), HDR_CONTACT_F, HDR_TO_F, len, LM_DBG, LM_ERR, parse_contact(), parse_headers(), hdr_field::parsed, search_rule(), sip_msg::to, and contact::uri.
Referenced by allow_register_1(), and allow_register_2().
| static int check_routing | ( | struct sip_msg * | msg, | |
| int | idx | |||
| ) | [static] |
Definition at line 316 of file permissions.c.
References check_all_branches, EXPRESSION_LENGTH, sip_msg::from, get_branch(), get_plain_uri(), HDR_FROM_F, sip_uri::host, _str::len, hdr_field::len, len, LM_DBG, LM_ERR, parse_from_header(), parse_headers(), parse_sip_msg_uri(), hdr_field::parsed, sip_msg::parsed_uri, _str::s, search_rule(), and sip_uri::user.
Referenced by allow_routing_0(), allow_routing_1(), and allow_routing_2().
| static int child_init | ( | int | rank | ) | [static] |
| static int double_fixup | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 505 of file permissions.c.
References allow_suffix, deny_suffix, _str::len, LM_ERR, load_fixup(), pkg_free, pkg_malloc, pv_parse_spec(), PVT_NULL, _str::s, s, and _pv_spec::type.
| static int find_index | ( | rule_file_t * | array, | |
| char * | pathname | |||
| ) | [static] |
Definition at line 255 of file permissions.c.
References filename, and rules_num.
Referenced by allow_test(), and load_fixup().
| static int get_path | ( | char * | pathname | ) | [static] |
| static char* get_pathname | ( | char * | name | ) | [static] |
Definition at line 220 of file permissions.c.
References cfg_file, get_path(), LM_ERR, and pkg_malloc.
Referenced by allow_test(), load_fixup(), and mod_init().
| static char* get_plain_uri | ( | const str * | uri | ) | [static] |
Definition at line 272 of file permissions.c.
References EXPRESSION_LENGTH, sip_uri::host, _str::len, len, LM_ERR, parse_uri(), _str::s, and sip_uri::user.
Referenced by check_register(), and check_routing().
| static int load_fixup | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 424 of file permissions.c.
References rule_file::filename, find_index(), get_pathname(), LM_DBG, LM_WARN, parse_config_file(), pkg_free, rule_file::rules, rules_num, and table.
Referenced by double_fixup(), and single_fixup().
| static int mi_addr_child_init | ( | void | ) | [static] |
| static int mi_trusted_child_init | ( | void | ) | [static] |
| static void mod_exit | ( | void | ) | [static] |
Definition at line 658 of file permissions.c.
References clean_addresses(), clean_trusted(), filename, free_rule(), pkg_free, and rules_num.
| static int mod_init | ( | void | ) | [static] |
Definition at line 575 of file permissions.c.
References db_mode, default_allow_file, default_deny_file, DISABLE_CACHE, ENABLE_CACHE, filename, rule_file::filename, get_pathname(), init_addresses(), init_tag_avp(), init_trusted(), _str::len, LM_DBG, LM_ERR, LM_WARN, parse_config_file(), rule_file::rules, rules_num, and _str::s.
| static int single_fixup | ( | void ** | param, | |
| int | param_no | |||
| ) | [static] |
Definition at line 464 of file permissions.c.
References allow_suffix, deny_suffix, LM_ERR, load_fixup(), pkg_free, and pkg_malloc.
| str address_table = str_init("address") |
Definition at line 73 of file permissions.c.
Referenced by init_addresses(), and reload_address_table().
MODULE_VERSION rule_file_t allow[MAX_RULE_FILES] [static] |
Definition at line 48 of file permissions.c.
Referenced by parse_allow(), parse_headers(), and sip_msg_cloner().
| char* allow_suffix = ".allow" |
Definition at line 56 of file permissions.c.
Referenced by double_fixup(), mi_allow_uri(), and single_fixup().
int check_all_branches = 1 [static] |
cmd_export_t cmds[] [static] |
Definition at line 119 of file permissions.c.
| int db_mode = DISABLE_CACHE |
Definition at line 64 of file permissions.c.
Definition at line 61 of file permissions.c.
char* default_allow_file = DEFAULT_ALLOW_FILE [static] |
char* default_deny_file = DEFAULT_DENY_FILE [static] |
rule_file_t deny[MAX_RULE_FILES] [static] |
Definition at line 49 of file permissions.c.
char* deny_suffix = ".deny" [static] |
| struct module_exports exports |
Definition at line 184 of file permissions.c.
Definition at line 68 of file permissions.c.
Referenced by allow_trusted(), and reload_trusted_table().
| str ip_addr_col = str_init("ip_addr") |
Definition at line 75 of file permissions.c.
mi_export_t mi_cmds[] [static] |
Definition at line 171 of file permissions.c.
param_export_t params[] [static] |
Definition at line 146 of file permissions.c.
Definition at line 77 of file permissions.c.
Definition at line 67 of file permissions.c.
Referenced by allow_trusted(), and reload_trusted_table().
int rules_num [static] |
Definition at line 50 of file permissions.c.
Referenced by find_index(), load_fixup(), mod_exit(), and mod_init().
| str source_col = str_init("src_ip") |
Definition at line 66 of file permissions.c.
Referenced by allow_trusted(), and reload_trusted_table().
| str tag_avp_param = {NULL, 0} |
Definition at line 70 of file permissions.c.
Definition at line 69 of file permissions.c.
| str trusted_table = str_init("trusted") |
Definition at line 65 of file permissions.c.
Referenced by allow_trusted(), init_child_trusted(), init_trusted(), and reload_trusted_table().
1.5.6