00001 /* 00002 * $Id: trusted.h 4518 2008-07-28 15:39:28Z henningw $ 00003 * 00004 * Header file for trusted.c implementing allow_trusted function 00005 * 00006 * Copyright (C) 2003-2008 Juha Heinanen 00007 * 00008 * This file is part of Kamailio, a free SIP server. 00009 * 00010 * Kamailio is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version 00014 * 00015 * Kamailio is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 00025 #ifndef TRUSTED_H 00026 #define TRUSTED_H 00027 00028 #include "../../parser/msg_parser.h" 00029 00030 00031 extern struct trusted_list ***hash_table; /* Pointer to current hash table pointer */ 00032 extern struct trusted_list **hash_table_1; /* Pointer to hash table 1 */ 00033 extern struct trusted_list **hash_table_2; /* Pointer to hash table 2 */ 00034 00035 00036 /* 00037 * Initialize data structures 00038 */ 00039 int init_trusted(void); 00040 00041 00042 /* 00043 * Open database connections if necessary 00044 */ 00045 int init_child_trusted(int rank); 00046 00047 00048 /* 00049 * Open database connections if necessary 00050 */ 00051 int mi_init_trusted(void); 00052 00053 00054 /* 00055 * Reload trusted table to new hash table and when done, make new hash table 00056 * current one. 00057 */ 00058 int reload_trusted_table(void); 00059 00060 00061 /* 00062 * Close connections and release memory 00063 */ 00064 void clean_trusted(void); 00065 00066 00067 /* 00068 * Check if request comes from trusted ip address with matching from URI 00069 */ 00070 int allow_trusted(struct sip_msg* _msg, char* _s1, char* _s2); 00071 00072 00073 /* 00074 * Checks based on request's source address, protocol, and From URI 00075 * if request can be trusted without authentication. 00076 */ 00077 int allow_trusted_0(struct sip_msg* _msg, char* str1, char* str2); 00078 00079 00080 /* 00081 * Checks based on source address and protocol given in pvar arguments and 00082 * and requests's From URI, if request can be trusted without authentication. 00083 */ 00084 int allow_trusted_2(struct sip_msg* _msg, char* _src_ip_sp, char* _proto_sp); 00085 00086 00087 #endif /* TRUSTED_H */
1.5.6