Lines Matching defs:tcp
86 #include <netinet/tcp.h>
1359 /* Check if the ICMP error message is related to an existing TCP, UDP or */
1371 tcphdr_t *tcp = NULL;
1402 * outside the ICMP packet, leading to TCP deref's causing problems.
1478 tcp = (tcphdr_t *)(oip6 + 1);
1479 fin->fin_data[0] = ntohs(tcp->th_dport);
1480 fin->fin_data[1] = ntohs(tcp->th_sport);
1564 tcphdr_t *tcp;
1582 tcp = NULL;
1591 tcp = (tcphdr_t *)dp;
1592 csump = (u_short *)&tcp->th_sum;
1598 tcp = (tcphdr_t *)dp;
1723 * For offending TCP/UDP IP packets, translate the ports as
1727 * Since the port fields are part of the TCP/UDP checksum
1730 * be offset by the checksum change. However, the TCP/UDP
1736 sum4 = ntohs(tcp->th_sport);
1738 sum2 = ntohs(tcp->th_dport);
1740 tcp->th_sport = htons(sum1);
1741 tcp->th_dport = htons(sum3);
1744 sum2 = ntohs(tcp->th_dport);
1746 sum4 = ntohs(tcp->th_sport);
1748 tcp->th_dport = htons(sum3);
1749 tcp->th_sport = htons(sum1);
1757 * TCP/UDP header, given the changes in both the IP
1761 * TCP/UDP checksum instead.
1763 * If we will both the IP and TCP/UDP checksums
1765 * delta applied to the TCP/UDP checksum. If we
1766 * do not change the TCP/UDP checksum them we
2093 /* This function is only called for TCP/UDP NAT table entries where the */
2566 tcphdr_t *tcp = NULL;
2623 tcp = fin->fin_dp;
2688 if (appr_ok(fin, tcp, np) == 0)
2766 tcphdr_t *tcp;
2771 tcp = NULL;
2872 tcp = fin->fin_dp;
2877 tcp->th_sport = nat->nat_nsport;
2879 tcp->th_dport = nat->nat_ndport;
2884 tcp->th_sport = nat->nat_odport;
2886 tcp->th_dport = nat->nat_osport;
2923 /* A NULL tcp indicates a non TCP/UDP packet. When dealing */
2969 tcphdr_t *tcp;
2979 tcp = NULL;
3022 tcp = fin->fin_dp;
3087 if (!appr_ok(fin, tcp, np)) {
3168 tcphdr_t *tcp;
3173 tcp = NULL;
3187 /* A NULL tcp indicates a non TCP/UDP packet. When dealing */
3296 tcp = fin->fin_dp;
3303 tcp->th_sport = nat->nat_nsport;
3305 tcp->th_dport = nat->nat_ndport;
3310 tcp->th_sport = nat->nat_odport;
3312 tcp->th_dport = nat->nat_osport;