xref: /linux/tools/testing/selftests/bpf/cgroup_tcp_skb.h (revision a23e1966932464e1c5226cb9ac4ce1d5fc10ba22) !
1539c7e67SKui-Feng Lee /* SPDX-License-Identifier: GPL-2.0 */
2539c7e67SKui-Feng Lee /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
3539c7e67SKui-Feng Lee 
4539c7e67SKui-Feng Lee /* Define states of a socket to tracking messages sending to and from the
5539c7e67SKui-Feng Lee  * socket.
6539c7e67SKui-Feng Lee  *
7539c7e67SKui-Feng Lee  * These states are based on rfc9293 with some modifications to support
8539c7e67SKui-Feng Lee  * tracking of messages sent out from a socket. For example, when a SYN is
9539c7e67SKui-Feng Lee  * received, a new socket is transiting to the SYN_RECV state defined in
10539c7e67SKui-Feng Lee  * rfc9293. But, we put it in SYN_RECV_SENDING_SYN_ACK state and when
11539c7e67SKui-Feng Lee  * SYN-ACK is sent out, it moves to SYN_RECV state. With this modification,
12539c7e67SKui-Feng Lee  * we can track the message sent out from a socket.
13539c7e67SKui-Feng Lee  */
14539c7e67SKui-Feng Lee 
15539c7e67SKui-Feng Lee #ifndef __CGROUP_TCP_SKB_H__
16539c7e67SKui-Feng Lee #define __CGROUP_TCP_SKB_H__
17539c7e67SKui-Feng Lee 
18539c7e67SKui-Feng Lee enum {
19539c7e67SKui-Feng Lee 	INIT,
20539c7e67SKui-Feng Lee 	CLOSED,
21539c7e67SKui-Feng Lee 	SYN_SENT,
22539c7e67SKui-Feng Lee 	SYN_RECV_SENDING_SYN_ACK,
23539c7e67SKui-Feng Lee 	SYN_RECV,
24539c7e67SKui-Feng Lee 	ESTABLISHED,
25539c7e67SKui-Feng Lee 	FIN_WAIT1,
26539c7e67SKui-Feng Lee 	FIN_WAIT2,
27539c7e67SKui-Feng Lee 	CLOSE_WAIT_SENDING_ACK,
28539c7e67SKui-Feng Lee 	CLOSE_WAIT,
29539c7e67SKui-Feng Lee 	CLOSING,
30539c7e67SKui-Feng Lee 	LAST_ACK,
31539c7e67SKui-Feng Lee 	TIME_WAIT_SENDING_ACK,
32539c7e67SKui-Feng Lee 	TIME_WAIT,
33539c7e67SKui-Feng Lee };
34539c7e67SKui-Feng Lee 
35539c7e67SKui-Feng Lee #endif /* __CGROUP_TCP_SKB_H__ */
36