vserver 1.9.3
[linux-2.6.git] / include / linux / netfilter_ipv4 / ip_conntrack_tcp.h
1 #ifndef _IP_CONNTRACK_TCP_H
2 #define _IP_CONNTRACK_TCP_H
3 /* TCP tracking. */
4
5 enum tcp_conntrack {
6         TCP_CONNTRACK_NONE,
7         TCP_CONNTRACK_SYN_SENT,
8         TCP_CONNTRACK_SYN_RECV,
9         TCP_CONNTRACK_ESTABLISHED,
10         TCP_CONNTRACK_FIN_WAIT,
11         TCP_CONNTRACK_CLOSE_WAIT,
12         TCP_CONNTRACK_LAST_ACK,
13         TCP_CONNTRACK_TIME_WAIT,
14         TCP_CONNTRACK_CLOSE,
15         TCP_CONNTRACK_LISTEN,
16         TCP_CONNTRACK_MAX,
17         TCP_CONNTRACK_IGNORE
18 };
19
20 /* Window scaling is advertised by the sender */
21 #define IP_CT_TCP_STATE_FLAG_WINDOW_SCALE       0x01
22
23 /* SACK is permitted by the sender */
24 #define IP_CT_TCP_FLAG_SACK_PERM                0x02
25
26 struct ip_ct_tcp_state {
27         u_int32_t       td_end;         /* max of seq + len */
28         u_int32_t       td_maxend;      /* max of ack + max(win, 1) */
29         u_int32_t       td_maxwin;      /* max(win) */
30         u_int8_t        td_scale;       /* window scale factor */
31         u_int8_t        loose;          /* used when connection picked up from the middle */
32         u_int8_t        flags;          /* per direction state flags */
33 };
34
35 struct ip_ct_tcp
36 {
37         struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
38         u_int8_t        state;          /* state of the connection (enum tcp_conntrack) */
39         /* For detecting stale connections */
40         u_int8_t        last_dir;       /* Direction of the last packet (enum ip_conntrack_dir) */
41         u_int8_t        retrans;        /* Number of retransmitted packets */
42         u_int8_t        last_index;     /* Index of the last packet */
43         u_int32_t       last_seq;       /* Last sequence number seen in dir */
44         u_int32_t       last_end;       /* Last seq + len */
45 };
46
47 #endif /* _IP_CONNTRACK_TCP_H */