00001 /* 00002 * $Id: permissions.h 5524 2009-01-28 10:38:13Z henningw $ 00003 * 00004 * PERMISSIONS module 00005 * 00006 * Copyright (C) 2003 Miklós Tirpák (mtirpak@sztaki.hu) 00007 * Copyright (C) 2006 Juha Heinanen 00008 * 00009 * This file is part of Kamailio, a free SIP server. 00010 * 00011 * Kamailio is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version 00015 * 00016 * Kamailio is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 * 00025 * History: 00026 * -------- 00027 * 2003-09-03 replaced /usr/local/et/ser/ with CFG_DIR (andrei) 00028 */ 00029 00030 #ifndef PERMISSIONS_H 00031 #define PERMISSIONS_H 1 00032 00033 #include "../../sr_module.h" 00034 #include "../../db/db.h" 00035 #include "../../pvar.h" 00036 #include "rule.h" 00037 00038 #define DEFAULT_ALLOW_FILE "permissions.allow" 00039 #define DEFAULT_DENY_FILE "permissions.deny" 00040 00041 typedef struct rule_file { 00042 rule* rules; /* Parsed rule set */ 00043 char* filename; /* The name of the file */ 00044 } rule_file_t; 00045 00046 /* 00047 * Maximum number if allow/deny file pairs that can be opened 00048 * at any time 00049 */ 00050 #define MAX_RULE_FILES 64 00051 00052 extern str db_url; /* Database URL */ 00053 extern int db_mode; /* Database usage mode: 0=no cache, 1=cache */ 00054 extern str trusted_table; /* Name of trusted table */ 00055 extern str source_col; /* Name of source address column */ 00056 extern str proto_col; /* Name of protocol column */ 00057 extern str from_col; /* Name of from pattern column */ 00058 extern str tag_col; /* Name of tag column */ 00059 extern str address_table; /* Name of address table */ 00060 extern str grp_col; /* Name of address group column */ 00061 extern str ip_addr_col; /* Name of ip address column */ 00062 extern str mask_col; /* Name of mask column */ 00063 extern str port_col; /* Name of port column */ 00064 00065 typedef struct int_or_pvar { 00066 unsigned int i; 00067 pv_spec_t *pvar; /* zero if int */ 00068 } int_or_pvar_t; 00069 00070 #define DISABLE_CACHE 0 00071 #define ENABLE_CACHE 1 00072 00073 extern char *allow_suffix; 00074 int allow_test(char *file, char *uri, char *contact); 00075 00076 #endif
1.5.6