permissions.c File Reference

#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"

Include dependency graph for permissions.c:

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")


Function Documentation

int allow_register_1 ( struct sip_msg msg,
char *  basename,
char *  s 
) [static]

Definition at line 802 of file permissions.c.

References check_register().

int allow_register_2 ( struct sip_msg msg,
char *  allow_file,
char *  deny_file 
) [static]

Definition at line 808 of file permissions.c.

References check_register().

int allow_routing_0 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 679 of file permissions.c.

References check_routing().

int allow_routing_1 ( struct sip_msg msg,
char *  basename,
char *  str2 
) [static]

Definition at line 685 of file permissions.c.

References check_routing().

int allow_routing_2 ( struct sip_msg msg,
char *  allow_file,
char *  deny_file 
) [static]

Definition at line 694 of file permissions.c.

References check_routing().

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]

static int check_register ( struct sip_msg msg,
int  idx 
) [static]

static int check_routing ( struct sip_msg msg,
int  idx 
) [static]

static int child_init ( int  rank  )  [static]

Definition at line 635 of file permissions.c.

References init_child_trusted().

static int double_fixup ( void **  param,
int  param_no 
) [static]

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]

Definition at line 205 of file permissions.c.

Referenced by get_pathname().

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]

static int mi_addr_child_init ( void   )  [static]

Definition at line 649 of file permissions.c.

References mi_init_addresses().

static int mi_trusted_child_init ( void   )  [static]

Definition at line 643 of file permissions.c.

References mi_init_trusted().

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]

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.


Variable Documentation

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]

Definition at line 83 of file permissions.c.

Referenced by check_register(), and check_routing().

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.

str db_url = {NULL, 0}

Definition at line 61 of file permissions.c.

char* default_allow_file = DEFAULT_ALLOW_FILE [static]

Definition at line 54 of file permissions.c.

Referenced by mod_init().

char* default_deny_file = DEFAULT_DENY_FILE [static]

Definition at line 55 of file permissions.c.

Referenced by mod_init().

rule_file_t deny[MAX_RULE_FILES] [static]

Definition at line 49 of file permissions.c.

char* deny_suffix = ".deny" [static]

Definition at line 57 of file permissions.c.

Referenced by double_fixup(), and single_fixup().

Definition at line 184 of file permissions.c.

str from_col = str_init("from_pattern")

Definition at line 68 of file permissions.c.

Referenced by allow_trusted(), and reload_trusted_table().

str grp_col = str_init("grp")

Definition at line 74 of file permissions.c.

Referenced by reload_address_table().

str ip_addr_col = str_init("ip_addr")

Definition at line 75 of file permissions.c.

str mask_col = str_init("mask")

Definition at line 76 of file permissions.c.

Referenced by reload_address_table().

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.

str port_col = str_init("port")

Definition at line 77 of file permissions.c.

str proto_col = str_init("proto")

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.

str tag_col = str_init("tag")

Definition at line 69 of file permissions.c.

str trusted_table = str_init("trusted")


Generated on Thu May 24 02:00:40 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6