1STRUCT SOCKET(9) Linux Networking STRUCT SOCKET(9)
2
3
4
6 struct_socket - general BSD socket
7
9 struct socket {
10 socket_state state;
11 short type;
12 unsigned long flags;
13 struct fasync_struct * fasync_list;
14 wait_queue_head_t wait;
15 struct file * file;
16 struct sock * sk;
17 const struct proto_ops * ops;
18 };
19
21 state
22 socket state (SS_CONNECTED, etc)
23
24 type
25 socket type (SOCK_STREAM, etc)
26
27 flags
28 socket flags (SOCK_ASYNC_NOSPACE, etc)
29
30 fasync_list
31 Asynchronous wake up list
32
33 wait
34 wait queue for several uses
35
36 file
37 File back pointer for gc
38
39 sk
40 internal networking protocol agnostic socket representation
41
42 ops
43 protocol specific socket operations
44
46Kernel Hackers Manual 2.6. June 2019 STRUCT SOCKET(9)