#include <sys/types.h>
#include <regex.h>
#include "../../str.h"
#include "../../mem/mem.h"
#include "../../route_struct.h"
#include "group_mod.h"
#include "re_group.h"
#include "group.h"

Go to the source code of this file.
Data Structures | |
| struct | re_grp |
Functions | |
| static int | add_re (const char *re, int gid) |
| Create a group regexp and add it to the list. | |
| int | get_user_group (struct sip_msg *req, char *user, char *avp) |
| Get the user group and compare to the regexp list. | |
| int | load_re (str *table) |
| Load regular expression rules from a database. | |
Variables | |
| static struct re_grp * | re_list = 0 |
Definition in file re_group.c.
| static int add_re | ( | const char * | re, | |
| int | gid | |||
| ) | [static] |
Create a group regexp and add it to the list.
| re | regular expression string | |
| gid | group ID |
Definition at line 61 of file re_group.c.
References re_grp::gid, LM_DBG, LM_ERR, int_str::n, re_grp::next, pkg_free, pkg_malloc, and re_grp::re.
Referenced by load_re().
| int get_user_group | ( | struct sip_msg * | req, | |
| char * | user, | |||
| char * | avp | |||
| ) |
Get the user group and compare to the regexp list.
| req | SIP message | |
| user | user string | |
| avp | AVP value |
Definition at line 154 of file re_group.c.
References domain, EQ_T, _pv_value::flags, get_username_domain(), re_grp::gid, _str::len, LM_DBG, LM_ERR, MAX_URI_SIZE, multiple_gid, int_str::n, re_grp::next, NULL, PV_TYPE_INT, PV_VAL_INT, _pv_spec::pvp, re_grp::re, _pv_value::ri, _str::s, and _pv_spec::setf.
| int load_re | ( | str * | table | ) |
Load regular expression rules from a database.
| table | DB table |
Definition at line 96 of file re_group.c.
References add_re(), DB_INT, DB_STRING, db_func::free_result, group_dbf, group_dbh, db_val_t::int_val, LM_DBG, LM_ERR, db_val_t::nul, NULL, db_func::query, re_exp_column, re_gid_column, RES_ROW_N, db_res::rows, _str::s, db_val_t::string_val, db_val_t::type, db_func::use_table, db_val_t::val, and db_row::values.
Referenced by mod_init().
global regexp list
Definition at line 52 of file re_group.c.
1.5.6