I'm creating a parser for /proc/net/tcp, and I would like to know what are all the possible constants for the connection states (fourth column)? I know 0A means LISTENING, but Google results don't give me the rest of the answers I need.
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
0: 3500007F:0035 00000000:0000 0A 00000000:00000000 00:00000000 00000000 101 0 21384 1 ffff987636718000 100 0 0 10 0
1: 0100007F:0277 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 78109 1 ffff98762c4dd000 100 0 0 10 0
2: 800AA8C0:B9CC 70FD1EC0:0016 06 00000000:00000000 03:000005EF 00000000 0 0 0 3 ffff987518bb7cf0
Best Answer
The state contants correspond to the entries in the first
enum
innet/tcp_states.h
:The values are currently as follows:
Most of these correspond to states in the TCP/IP state machine.