1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _NF_CONNTRACK_TCP_H
3 #define _NF_CONNTRACK_TCP_H
4 
5 #include <uapi/linux/netfilter/nf_conntrack_tcp.h>
6 
7 
8 struct ip_ct_tcp_state {
9 	u_int32_t	td_end;		/* max of seq + len */
10 	u_int32_t	td_maxend;	/* max of ack + max(win, 1) */
11 	u_int32_t	td_maxwin;	/* max(win) */
12 	u_int32_t	td_maxack;	/* max of ack */
13 	u_int8_t	td_scale;	/* window scale factor */
14 	u_int8_t	flags;		/* per direction options */
15 };
16 
17 struct ip_ct_tcp {
18 	struct ip_ct_tcp_state seen[2];	/* connection parameters per direction */
19 	u_int8_t	state;		/* state of the connection (enum tcp_conntrack) */
20 	/* For detecting stale connections */
21 	u_int8_t	last_dir;	/* Direction of the last packet (enum ip_conntrack_dir) */
22 	u_int8_t	retrans;	/* Number of retransmitted packets */
23 	u_int8_t	last_index;	/* Index of the last packet */
24 	u_int32_t	last_seq;	/* Last sequence number seen in dir */
25 	u_int32_t	last_ack;	/* Last sequence number seen in opposite dir */
26 	u_int32_t	last_end;	/* Last seq + len */
27 	u_int16_t	last_win;	/* Last window advertisement seen in dir */
28 	/* For SYN packets while we may be out-of-sync */
29 	u_int8_t	last_wscale;	/* Last window scaling factor seen */
30 	u_int8_t	last_flags;	/* Last flags set */
31 };
32 
33 #endif /* _NF_CONNTRACK_TCP_H */
34