1STRUCT SOCK_COMMON(9) Linux Networking STRUCT SOCK_COMMON(9)
2
3
4
6 struct_sock_common - minimal network layer representation of sockets
7
9 struct sock_common {
10 union {unnamed_union};
11 atomic_t skc_refcnt;
12 unsigned int skc_hash;
13 unsigned short skc_family;
14 volatile unsigned char skc_state;
15 #ifndef __GENKSYMS__
16 unsigned char skc_reuse;
17 unsigned char skc_reuseport:4;
18 #else
19 unsigned char skc_reuse;
20 #endif
21 int skc_bound_dev_if;
22 struct hlist_node skc_bind_node;
23 struct proto * skc_prot;
24 #ifdef CONFIG_NET_NS
25 struct net * skc_net;
26 #endif
27 };
28
30 {unnamed_union}
31 anonymous
32
33 skc_refcnt
34 reference count
35
36 skc_hash
37 hash value used with various protocol lookup tables
38
39 skc_family
40 network address family
41
42 skc_state
43 Connection state
44
45 skc_reuse
46
47 SO_REUSEADDR setting
48
49 skc_reuseport
50
51 SO_REUSEPORT setting
52
53 skc_reuse
54
55 SO_REUSEADDR setting
56
57 skc_bound_dev_if
58 bound device index if != 0
59
60 skc_bind_node
61 bind hash linkage for various protocol lookup tables
62
63 skc_prot
64 protocol handlers inside a network family
65
66 skc_net
67 reference to the network namespace of this socket
68
70 This is the minimal network layer representation of sockets, the header
71 for struct sock and struct inet_timewait_sock.
72
74Kernel Hackers Manual 2.6. June 2019 STRUCT SOCK_COMMON(9)