group_mod.c File Reference

Group membership module

More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../ut.h"
#include "../../error.h"
#include "../../mem/mem.h"
#include "../../usr_avp.h"
#include "group_mod.h"
#include "group.h"
#include "re_group.h"

Include dependency graph for group_mod.c:

Go to the source code of this file.

Defines

#define DOMAIN_COL   "domain"
#define DOMAIN_COL_LEN   (sizeof(DOMAIN_COL) - 1)
#define GROUP_COL   "grp"
#define GROUP_COL_LEN   (sizeof(GROUP_COL) - 1)
#define RE_EXP_COL   "reg_exp"
#define RE_EXP_COL_LEN   (sizeof(USER_COL) - 1)
#define RE_GID_COL   "group_id"
#define RE_GID_COL_LEN   (sizeof(DOMAIN_COL) - 1)
#define RE_TABLE   "re_grp"
#define RE_TABLE_LEN   (sizeof(TABLE) - 1)
#define RE_TABLE_VERSION   1
#define TABLE   "grp"
#define TABLE_LEN   (sizeof(TABLE) - 1)
#define TABLE_VERSION   2
#define USER_COL   "username"
#define USER_COL_LEN   (sizeof(USER_COL) - 1)

Functions

static int child_init (int rank)
 Module child-init function prototype.
static void destroy (void)
 Module destroy function prototype.
static int get_gid_fixup (void **param, int param_no)
 Group ID fixup.
static group_check_p get_hf (char *str1)
 Convert HF description string to hdr_field pointer.
static int hf_fixup (void **param, int param_no)
 Header fixup function.
static int mod_init (void)
 Module initialization function prototype.

Variables

static cmd_export_t cmds []
static str db_url = {DEFAULT_RODB_URL, DEFAULT_RODB_URL_LEN}
str domain_column = {DOMAIN_COL, DOMAIN_COL_LEN}
struct module_exports exports
str group_column = {GROUP_COL, GROUP_COL_LEN}
db_func_t group_dbf
db_con_tgroup_dbh = 0
int multiple_gid = 1
static param_export_t params []
str re_exp_column = {RE_EXP_COL, RE_EXP_COL_LEN}
str re_gid_column = {RE_GID_COL, RE_GID_COL_LEN}
str re_table = {0, 0}
str table = {TABLE, TABLE_LEN}
int use_domain = 0
str user_column = {USER_COL, USER_COL_LEN}


Detailed Description

Group membership module

Definition in file group_mod.c.


Define Documentation

#define DOMAIN_COL   "domain"

Definition at line 95 of file group_mod.c.

#define DOMAIN_COL_LEN   (sizeof(DOMAIN_COL) - 1)

Definition at line 96 of file group_mod.c.

#define GROUP_COL   "grp"

Definition at line 98 of file group_mod.c.

#define GROUP_COL_LEN   (sizeof(GROUP_COL) - 1)

Definition at line 99 of file group_mod.c.

#define RE_EXP_COL   "reg_exp"

Definition at line 104 of file group_mod.c.

#define RE_EXP_COL_LEN   (sizeof(USER_COL) - 1)

Definition at line 105 of file group_mod.c.

#define RE_GID_COL   "group_id"

Definition at line 107 of file group_mod.c.

#define RE_GID_COL_LEN   (sizeof(DOMAIN_COL) - 1)

Definition at line 108 of file group_mod.c.

#define RE_TABLE   "re_grp"

Definition at line 101 of file group_mod.c.

#define RE_TABLE_LEN   (sizeof(TABLE) - 1)

Definition at line 102 of file group_mod.c.

#define RE_TABLE_VERSION   1

Definition at line 63 of file group_mod.c.

Referenced by mod_init().

#define TABLE   "grp"

Definition at line 89 of file group_mod.c.

#define TABLE_LEN   (sizeof(TABLE) - 1)

Definition at line 90 of file group_mod.c.

#define TABLE_VERSION   2

Definition at line 62 of file group_mod.c.

#define USER_COL   "username"

Definition at line 92 of file group_mod.c.

#define USER_COL_LEN   (sizeof(USER_COL) - 1)

Definition at line 93 of file group_mod.c.


Function Documentation

static int child_init ( int  rank  )  [static]

Module child-init function prototype.

Definition at line 181 of file group_mod.c.

References group_db_init().

static void destroy ( void   )  [static]

Module destroy function prototype.

Definition at line 233 of file group_mod.c.

References group_db_close().

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

Group ID fixup.

get user group ID fixup

Parameters:
param fixed parameter
param_no number of parameters
Returns:
0 on success, negative on failure

Definition at line 323 of file group_mod.c.

References E_UNSPEC, get_hf(), _str::len, LM_ERR, module_exports::name, NULL, pkg_malloc, pv_parse_spec(), pv_spec_free(), PVT_AVP, _str::s, and _pv_spec::type.

static group_check_p get_hf ( char *  str1  )  [static]

Convert HF description string to hdr_field pointer.

Convert a header field description string to hdr_field structure Supported strings: "Request-URI", "To", "From", "Credentials"

Parameters:
str1 header field description string
Returns:
hdr_field structure on success, NULL on failure

Definition at line 247 of file group_mod.c.

References _group_check::id, _str::len, LM_ERR, NULL, pkg_free, pkg_malloc, pv_parse_spec(), PVT_AVP, _str::s, s, _group_check::sp, and _pv_spec::type.

Referenced by get_gid_fixup(), and hf_fixup().

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

Header fixup function.

Header field fixup

Parameters:
param fixed parameter
param_no number of parameters
Returns:
0 on success, negative on failure

Definition at line 293 of file group_mod.c.

References E_UNSPEC, get_hf(), _str::len, LM_ERR, pkg_malloc, _str::s, and s.

static int mod_init ( void   )  [static]

Module initialization function prototype.

Definition at line 187 of file group_mod.c.

References db_check_table_version(), group_db_bind(), group_db_close(), group_db_init(), _str::len, LM_ERR, load_re(), RE_TABLE_VERSION, _str::s, and TABLE_VERSION.


Variable Documentation

cmd_export_t cmds[] [static]

Exported functions

Definition at line 135 of file group_mod.c.

str db_url = {DEFAULT_RODB_URL, DEFAULT_RODB_URL_LEN} [static]

Definition at line 113 of file group_mod.c.

str domain_column = {DOMAIN_COL, DOMAIN_COL_LEN}

'domain' column name in group table

Definition at line 117 of file group_mod.c.

Module interface

Definition at line 165 of file group_mod.c.

str group_column = {GROUP_COL, GROUP_COL_LEN}

"group' column name in group table

Definition at line 118 of file group_mod.c.

Referenced by is_user_in().

Definition at line 128 of file group_mod.c.

Referenced by group_db_bind(), group_db_close(), group_db_init(), is_user_in(), and load_re().

Definition at line 129 of file group_mod.c.

Referenced by group_db_close(), group_db_init(), is_user_in(), and load_re().

int multiple_gid = 1

Definition at line 125 of file group_mod.c.

Referenced by get_user_group().

param_export_t params[] [static]

Exported parameters

Definition at line 147 of file group_mod.c.

str re_exp_column = {RE_EXP_COL, RE_EXP_COL_LEN}

Definition at line 123 of file group_mod.c.

Referenced by load_re().

str re_gid_column = {RE_GID_COL, RE_GID_COL_LEN}

Definition at line 124 of file group_mod.c.

Referenced by load_re().

str re_table = {0, 0}

Definition at line 122 of file group_mod.c.

str table = {TABLE, TABLE_LEN}

Table name where group definitions are stored

Definition at line 115 of file group_mod.c.

Referenced by authorize(), check_blacklist_fixup(), check_user_blacklist(), HashTable_new(), is_user_in(), load_fixup(), mi_usrloc_dump(), and print_udomain().

int use_domain = 0

Use domain in is_user_in

Definition at line 119 of file group_mod.c.

str user_column = {USER_COL, USER_COL_LEN}

'user' column name in group table

Definition at line 116 of file group_mod.c.


Generated on Wed May 23 06:01:03 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6