1 /* 2 * Copyright (C) 2005 Voice Sistem SRL 3 * 4 * This file is part of Kamailio, a free SIP server. 5 * 6 * Kamailio is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * 11 * Kamailio is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 * 20 */ 21 22 23 #ifndef _REDIRECT_FILTER_H 24 #define _REDIRECT_FILTER_H 25 26 #include <sys/types.h> /* for regex */ 27 #include <regex.h> 28 29 #define ACCEPT_FILTER 0 30 #define DENY_FILTER 1 31 #define NR_FILTER_TYPES 2 32 33 #define ACCEPT_RULE 11 34 #define DENY_RULE 12 35 36 #define RESET_ADDED (1<<0) 37 #define RESET_DEFAULT (1<<1) 38 39 void init_filters(void); 40 void set_default_rule( int type ); 41 void reset_filters(void); 42 void add_default_filter( int type, regex_t *filter); 43 int add_filter( int type, regex_t *filter, int flags); 44 int run_filters(char *s); 45 46 #endif 47