1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2c752f073SArnaldo Carvalho de Melo /* 3c752f073SArnaldo Carvalho de Melo * INET An implementation of the TCP/IP protocol suite for the LINUX 4c752f073SArnaldo Carvalho de Melo * operating system. INET is implemented using the BSD Socket 5c752f073SArnaldo Carvalho de Melo * interface as the means of communication with the user level. 6c752f073SArnaldo Carvalho de Melo * 7c752f073SArnaldo Carvalho de Melo * Definitions for the TCP protocol sk_state field. 8c752f073SArnaldo Carvalho de Melo */ 9c752f073SArnaldo Carvalho de Melo #ifndef _LINUX_TCP_STATES_H 10c752f073SArnaldo Carvalho de Melo #define _LINUX_TCP_STATES_H 11c752f073SArnaldo Carvalho de Melo 12c752f073SArnaldo Carvalho de Melo enum { 13c752f073SArnaldo Carvalho de Melo TCP_ESTABLISHED = 1, 14c752f073SArnaldo Carvalho de Melo TCP_SYN_SENT, 15c752f073SArnaldo Carvalho de Melo TCP_SYN_RECV, 16c752f073SArnaldo Carvalho de Melo TCP_FIN_WAIT1, 17c752f073SArnaldo Carvalho de Melo TCP_FIN_WAIT2, 18c752f073SArnaldo Carvalho de Melo TCP_TIME_WAIT, 19c752f073SArnaldo Carvalho de Melo TCP_CLOSE, 20c752f073SArnaldo Carvalho de Melo TCP_CLOSE_WAIT, 21c752f073SArnaldo Carvalho de Melo TCP_LAST_ACK, 22c752f073SArnaldo Carvalho de Melo TCP_LISTEN, 23c752f073SArnaldo Carvalho de Melo TCP_CLOSING, /* Now a valid state */ 2410feb428SEric Dumazet TCP_NEW_SYN_RECV, 25c752f073SArnaldo Carvalho de Melo 26c752f073SArnaldo Carvalho de Melo TCP_MAX_STATES /* Leave at the end! */ 27c752f073SArnaldo Carvalho de Melo }; 28c752f073SArnaldo Carvalho de Melo 29c752f073SArnaldo Carvalho de Melo #define TCP_STATE_MASK 0xF 30c752f073SArnaldo Carvalho de Melo 31a823fed0SYafang Shao #define TCP_ACTION_FIN (1 << TCP_CLOSE) 3222712813SArnaldo Carvalho de Melo 3322712813SArnaldo Carvalho de Melo enum { 34a823fed0SYafang Shao TCPF_ESTABLISHED = (1 << TCP_ESTABLISHED), 35a823fed0SYafang Shao TCPF_SYN_SENT = (1 << TCP_SYN_SENT), 36a823fed0SYafang Shao TCPF_SYN_RECV = (1 << TCP_SYN_RECV), 37a823fed0SYafang Shao TCPF_FIN_WAIT1 = (1 << TCP_FIN_WAIT1), 38a823fed0SYafang Shao TCPF_FIN_WAIT2 = (1 << TCP_FIN_WAIT2), 39a823fed0SYafang Shao TCPF_TIME_WAIT = (1 << TCP_TIME_WAIT), 40a823fed0SYafang Shao TCPF_CLOSE = (1 << TCP_CLOSE), 41a823fed0SYafang Shao TCPF_CLOSE_WAIT = (1 << TCP_CLOSE_WAIT), 42a823fed0SYafang Shao TCPF_LAST_ACK = (1 << TCP_LAST_ACK), 43a823fed0SYafang Shao TCPF_LISTEN = (1 << TCP_LISTEN), 44a823fed0SYafang Shao TCPF_CLOSING = (1 << TCP_CLOSING), 45a823fed0SYafang Shao TCPF_NEW_SYN_RECV = (1 << TCP_NEW_SYN_RECV), 4622712813SArnaldo Carvalho de Melo }; 4722712813SArnaldo Carvalho de Melo 48c752f073SArnaldo Carvalho de Melo #endif /* _LINUX_TCP_STATES_H */ 49