--- zzzz-none-000/linux-2.4.17/include/linux/netfilter_ipv4/ip_conntrack_tcp.h 2000-08-04 20:07:24.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/include/linux/netfilter_ipv4/ip_conntrack_tcp.h 2004-11-24 13:21:45.000000000 +0000 @@ -8,25 +8,41 @@ enum tcp_conntrack { TCP_CONNTRACK_NONE, - TCP_CONNTRACK_ESTABLISHED, TCP_CONNTRACK_SYN_SENT, TCP_CONNTRACK_SYN_RECV, + TCP_CONNTRACK_ESTABLISHED, TCP_CONNTRACK_FIN_WAIT, - TCP_CONNTRACK_TIME_WAIT, - TCP_CONNTRACK_CLOSE, TCP_CONNTRACK_CLOSE_WAIT, TCP_CONNTRACK_LAST_ACK, + TCP_CONNTRACK_TIME_WAIT, + TCP_CONNTRACK_CLOSE, TCP_CONNTRACK_LISTEN, TCP_CONNTRACK_MAX }; +struct ip_ct_tcp_state { + u_int32_t td_end; /* max of seq + len */ + u_int32_t td_maxend; /* max of ack + max(win, 1) */ + u_int32_t td_maxwin; /* max(win) */ + u_int8_t td_scale; /* window scale factor */ + u_int8_t loose; /* used when connection picked up from the middle */ +}; + struct ip_ct_tcp { - enum tcp_conntrack state; - - /* Poor man's window tracking: sequence number of valid ACK - handshake completion packet */ - u_int32_t handshake_ack; + enum tcp_conntrack state; /* state of the connection */ + struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ + /* For detecting aborted connections */ + enum ip_conntrack_dir last_dir; /* Direction of the last packet */ + u_int32_t last_seq; /* Last sequence number seen in dir */ + size_t last_end; /* Last seq + len */ + u_int8_t retrans; /* Number of retransmitted packets */ }; +/* For NAT, when it mangles the packet */ +extern void ip_conntrack_tcp_update(struct ip_conntrack *conntrack, int dir, + struct iphdr *iph, size_t newlen, + struct tcphdr *tcph); + + #endif /* _IP_CONNTRACK_TCP_H */