1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_NF_CONNTRACK_TCP_H
3 #define _UAPI_NF_CONNTRACK_TCP_H
4 /* TCP tracking. */
5 
6 #include <linux/types.h>
7 
8 /* This is exposed to userspace (ctnetlink) */
9 enum tcp_conntrack {
10 	TCP_CONNTRACK_NONE,
11 	TCP_CONNTRACK_SYN_SENT,
12 	TCP_CONNTRACK_SYN_RECV,
13 	TCP_CONNTRACK_ESTABLISHED,
14 	TCP_CONNTRACK_FIN_WAIT,
15 	TCP_CONNTRACK_CLOSE_WAIT,
16 	TCP_CONNTRACK_LAST_ACK,
17 	TCP_CONNTRACK_TIME_WAIT,
18 	TCP_CONNTRACK_CLOSE,
19 	TCP_CONNTRACK_LISTEN,	/* obsolete */
20 #define TCP_CONNTRACK_SYN_SENT2	TCP_CONNTRACK_LISTEN
21 	TCP_CONNTRACK_MAX,
22 	TCP_CONNTRACK_IGNORE,
23 	TCP_CONNTRACK_RETRANS,
24 	TCP_CONNTRACK_UNACK,
25 	TCP_CONNTRACK_TIMEOUT_MAX
26 };
27 
28 /* Window scaling is advertised by the sender */
29 #define IP_CT_TCP_FLAG_WINDOW_SCALE		0x01
30 
31 /* SACK is permitted by the sender */
32 #define IP_CT_TCP_FLAG_SACK_PERM		0x02
33 
34 /* This sender sent FIN first */
35 #define IP_CT_TCP_FLAG_CLOSE_INIT		0x04
36 
37 /* Be liberal in window checking */
38 #define IP_CT_TCP_FLAG_BE_LIBERAL		0x08
39 
40 /* Has unacknowledged data */
41 #define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED	0x10
42 
43 /* The field td_maxack has been set */
44 #define IP_CT_TCP_FLAG_MAXACK_SET		0x20
45 
46 /* Marks possibility for expected RFC5961 challenge ACK */
47 #define IP_CT_EXP_CHALLENGE_ACK 		0x40
48 
49 /* Simultaneous open initialized */
50 #define IP_CT_TCP_SIMULTANEOUS_OPEN		0x80
51 
52 struct nf_ct_tcp_flags {
53 	__u8 flags;
54 	__u8 mask;
55 };
56 
57 
58 #endif /* _UAPI_NF_CONNTRACK_TCP_H */
59