diff options
Diffstat (limited to 'sys/contrib/ipfilter/netinet/ip_proxy.c')
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_proxy.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index f3b2cd5..d612adf 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -3,11 +3,12 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ + #if defined(__FreeBSD__) && defined(KERNEL) && !defined(_KERNEL) # define _KERNEL #endif -#if defined(__sgi) && (IRIX > 602) +#ifdef __sgi # include <sys/ptimers.h> #endif #include <sys/errno.h> @@ -75,17 +76,14 @@ #endif #if !defined(lint) -static const char rcsid[] = "@(#)$Id: ip_proxy.c,v 2.9.2.26 2002/12/06 11:40:23 darrenr Exp $"; +/* static const char rcsid[] = "@(#)$Id: ip_proxy.c,v 2.9.2.6 2001/07/15 22:06:15 darrenr Exp $"; */ +static const char rcsid[] = "@(#)$FreeBSD$"; #endif #if defined(_KERNEL) && (SOLARIS || defined(__sgi)) extern KRWLOCK_T ipf_nat, ipf_state; #endif -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif - static int appr_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int )); @@ -98,9 +96,8 @@ static int appr_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int )); #include "netinet/ip_rcmd_pxy.c" #include "netinet/ip_raudio_pxy.c" #include "netinet/ip_netbios_pxy.c" -#include "netinet/ip_h323_pxy.c" -#endif #include "netinet/ip_ipsec_pxy.c" +#endif ap_session_t *ap_sess_tab[AP_SESS_SIZE]; ap_session_t *ap_sess_list = NULL; @@ -315,7 +312,7 @@ nat_t *nat; sum = fr_tcpsum(*(mb_t **)fin->fin_mp, ip, tcp); #endif if (sum != tcp->th_sum) { -#if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) +#if PROXY_DEBUG printf("proxy tcp checksum failure\n"); #endif frstats[fin->fin_out].fr_tcpbad++; @@ -323,8 +320,8 @@ nat_t *nat; } /* - * Don't bother the proxy with these...or in fact, - * should we free up proxy stuff when seen? + * Don't both the proxy with these...or in fact, should + * we free up proxy stuff when seen? */ if ((tcp->th_flags & TH_RST) != 0) return 0; @@ -342,13 +339,13 @@ nat_t *nat; rv = APR_EXIT(err); if (rv == 1) { -#if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) +#if PROXY_DEBUG printf("proxy says bad packet received\n"); #endif return -1; } if (rv == 2) { -#if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) +#if PROXY_DEBUG printf("proxy says free app proxy data\n"); #endif appr_free(apr); @@ -424,7 +421,7 @@ ap_session_t *aps; apr = aps->aps_apr; if ((apr != NULL) && (apr->apr_del != NULL)) (*apr->apr_del)(aps); - + if ((aps->aps_data != NULL) && (aps->aps_psiz != 0)) KFREES(aps->aps_data, aps->aps_psiz); KFREE(aps); @@ -468,7 +465,7 @@ int inc; sel, !sel, seq1, aps->aps_seqmin[!sel]); #endif sel = aps->aps_sel[out] = !sel; - } +} if (aps->aps_seqoff[sel]) { seq2 = aps->aps_seqmin[sel] - aps->aps_seqoff[sel]; @@ -503,7 +500,7 @@ int inc; sel, !sel, seq1, aps->aps_ackmin[!sel]); #endif sel = aps->aps_sel[1 - out] = !sel; - } +} if (aps->aps_ackoff[sel] && (seq1 > aps->aps_ackmin[sel])) { seq2 = aps->aps_ackoff[sel]; @@ -522,7 +519,7 @@ int inc; sel, !sel, seq1, aps->aps_ackmin[!sel]); #endif sel = aps->aps_sel[out] = !sel; - } +} if (aps->aps_ackoff[sel]) { seq2 = aps->aps_ackmin[sel] - aps->aps_ackoff[sel]; @@ -557,7 +554,7 @@ int inc; sel, !sel, seq1, aps->aps_seqmin[!sel]); #endif sel = aps->aps_sel[1 - out] = !sel; - } +} if (aps->aps_seqoff[sel] != 0) { #if PROXY_DEBUG |