alias_ftp.c (32377) | alias_ftp.c (36711) |
---|---|
1/* 2 Alias_ftp.c performs special processing for FTP sessions under 3 TCP. Specifically, when a PORT command from the client side 4 is sent, it is intercepted and modified. The address is changed 5 to the gateway machine and an aliasing port is used. 6 7 For this routine to work, the PORT command must fit entirely 8 into a single TCP packet. This is typically the case, but exceptions --- 138 unchanged lines hidden (view full) --- 147 ftp_link = FindUdpTcpOut(true_addr, GetDestAddress(link), 148 true_port, 0, IPPROTO_TCP); 149 150 if (ftp_link != NULL) 151 { 152 int slen, hlen, tlen, dlen; 153 struct tcphdr *tc; 154 | 1/* 2 Alias_ftp.c performs special processing for FTP sessions under 3 TCP. Specifically, when a PORT command from the client side 4 is sent, it is intercepted and modified. The address is changed 5 to the gateway machine and an aliasing port is used. 6 7 For this routine to work, the PORT command must fit entirely 8 into a single TCP packet. This is typically the case, but exceptions --- 138 unchanged lines hidden (view full) --- 147 ftp_link = FindUdpTcpOut(true_addr, GetDestAddress(link), 148 true_port, 0, IPPROTO_TCP); 149 150 if (ftp_link != NULL) 151 { 152 int slen, hlen, tlen, dlen; 153 struct tcphdr *tc; 154 |
155#ifndef NO_FW_PUNCH |
|
155/* Punch hole in firewall */ 156 PunchFWHole(ftp_link); | 156/* Punch hole in firewall */ 157 PunchFWHole(ftp_link); |
158#endif |
|
157 158/* Calculate data length of TCP packet */ 159 tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2)); 160 hlen = (pip->ip_hl + tc->th_off) << 2; 161 tlen = ntohs(pip->ip_len); 162 dlen = tlen - hlen; 163 164/* Create new PORT command */ --- 61 unchanged lines hidden --- | 159 160/* Calculate data length of TCP packet */ 161 tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2)); 162 hlen = (pip->ip_hl + tc->th_off) << 2; 163 tlen = ntohs(pip->ip_len); 164 dlen = tlen - hlen; 165 166/* Create new PORT command */ --- 61 unchanged lines hidden --- |