00001 /* 00002 * $Id: nat_helper.h 566 2008-06-05 12:55:00Z vingarzan $ 00003 * 00004 * 00005 * Copyright (C) 2005 Porta Software Ltd. 00006 * 00007 * This file is part of ser, a free SIP server. 00008 * 00009 * ser is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version 00013 * 00014 * For a license to use the ser software under conditions 00015 * other than those described here, or to purchase support for this 00016 * software, please contact iptel.org by e-mail at the following addresses: 00017 * info@iptel.org 00018 * 00019 * ser is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU General Public License 00025 * along with this program; if not, write to the Free Software 00026 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00027 */ 00028 00086 #ifndef P_CSCF_NAT_HELPER_H_ 00087 #define P_CSCF_NAT_HELPER_H_ 00088 00089 #include "registrar_storage.h" 00090 00092 typedef struct { 00093 const char *cnetaddr; 00094 uint32_t netaddr; 00095 uint32_t mask; 00096 } network_t; 00097 00098 char * ser_memmem(const void *b1, const void *b2, size_t len1, size_t len2); 00099 int is1918addr(str *saddr); 00100 00102 #define NAT_UAC_TEST_C_1918 0x01 00103 00104 #define NAT_UAC_TEST_RCVD 0x02 00105 00106 #define NAT_UAC_TEST_V_1918 0x04 00107 00108 #define NAT_UAC_TEST_S_1918 0x08 00109 00110 #define NAT_UAC_TEST_RPORT 0x10 00111 00112 int nat_send_ping(r_contact *c); 00113 int nat_uac_test(struct sip_msg * msg); 00114 int nat_prepare_1918addr(); 00115 r_nat_dest* nat_msg_origin(struct sip_msg * msg); 00116 int requires_nat(struct sip_msg * msg); 00117 00118 00119 #endif 00120
1.5.2