ip_rcmd_pxy.c (60857) | ip_rcmd_pxy.c (63523) |
---|---|
1/* | 1/* |
2 * $Id: ip_rcmd_pxy.c,v 1.4.2.1 2000/05/06 11:19:34 darrenr Exp $ | 2 * $Id: ip_rcmd_pxy.c,v 1.4.2.2 2000/07/15 12:38:30 darrenr Exp $ |
3 */ 4/* 5 * Simple RCMD transparent proxy for in-kernel use. For use with the NAT 6 * code. | 3 */ 4/* 5 * Simple RCMD transparent proxy for in-kernel use. For use with the NAT 6 * code. |
7 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c 60857 2000-05-24 04:40:17Z darrenr $ | 7 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c 63523 2000-07-19 14:02:09Z darrenr $ |
8 */ 9#if SOLARIS && defined(_KERNEL) 10extern kmutex_t ipf_rw; 11#endif 12 13#define isdigit(x) ((x) >= '0' && (x) <= '9') 14 15#define IPF_RCMD_PROXY --- 73 unchanged lines hidden (view full) --- 89 fr_info_t fi; 90 nat_t *ipn; 91 mb_t *m; 92#if SOLARIS 93 mb_t *m1; 94#endif 95 96 tcp = (tcphdr_t *)fin->fin_dp; | 8 */ 9#if SOLARIS && defined(_KERNEL) 10extern kmutex_t ipf_rw; 11#endif 12 13#define isdigit(x) ((x) >= '0' && (x) <= '9') 14 15#define IPF_RCMD_PROXY --- 73 unchanged lines hidden (view full) --- 89 fr_info_t fi; 90 nat_t *ipn; 91 mb_t *m; 92#if SOLARIS 93 mb_t *m1; 94#endif 95 96 tcp = (tcphdr_t *)fin->fin_dp; |
97 98 if (tcp->th_flags & TH_SYN) { 99 *(u_32_t *)aps->aps_data = htonl(ntohl(tcp->th_seq) + 1); 100 return 0; 101 } 102 103 if ((*(u_32_t *)aps->aps_data != 0) && 104 (tcp->th_seq != *(u_32_t *)aps->aps_data)) 105 return 0; 106 |
|
97 off = (ip->ip_hl << 2) + (tcp->th_off << 2); | 107 off = (ip->ip_hl << 2) + (tcp->th_off << 2); |
98 m = *(mb_t **)fin->fin_mp; | |
99 100#if SOLARIS 101 m = fin->fin_qfm; 102 103 dlen = msgdsize(m) - off; 104 bzero(portbuf, sizeof(portbuf)); 105 copyout_mblk(m, off, MIN(sizeof(portbuf), dlen), portbuf); 106#else | 108 109#if SOLARIS 110 m = fin->fin_qfm; 111 112 dlen = msgdsize(m) - off; 113 bzero(portbuf, sizeof(portbuf)); 114 copyout_mblk(m, off, MIN(sizeof(portbuf), dlen), portbuf); 115#else |
116 m = *(mb_t **)fin->fin_mp; |
|
107 dlen = mbufchainlen(m) - off; 108 bzero(portbuf, sizeof(portbuf)); 109 m_copydata(m, off, MIN(sizeof(portbuf), dlen), portbuf); 110#endif | 117 dlen = mbufchainlen(m) - off; 118 bzero(portbuf, sizeof(portbuf)); 119 m_copydata(m, off, MIN(sizeof(portbuf), dlen), portbuf); 120#endif |
111 if ((*(u_32_t *)aps->aps_data != 0) && 112 (tcp->th_seq != *(u_32_t *)aps->aps_data)) 113 return 0; | |
114 115 portbuf[sizeof(portbuf) - 1] = '\0'; 116 s = portbuf; 117 sp = ipf_rcmd_atoi(s); 118 if (!sp) 119 return 0; 120 121 /* --- 45 unchanged lines hidden --- | 121 122 portbuf[sizeof(portbuf) - 1] = '\0'; 123 s = portbuf; 124 sp = ipf_rcmd_atoi(s); 125 if (!sp) 126 return 0; 127 128 /* --- 45 unchanged lines hidden --- |