aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index c945fba4f543..93a6745bfdb2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -126,12 +126,17 @@ struct sock;
126struct proto; 126struct proto;
127struct net; 127struct net;
128 128
129typedef __u32 __bitwise __portpair;
130typedef __u64 __bitwise __addrpair;
131
129/** 132/**
130 * struct sock_common - minimal network layer representation of sockets 133 * struct sock_common - minimal network layer representation of sockets
131 * @skc_daddr: Foreign IPv4 addr 134 * @skc_daddr: Foreign IPv4 addr
132 * @skc_rcv_saddr: Bound local IPv4 addr 135 * @skc_rcv_saddr: Bound local IPv4 addr
133 * @skc_hash: hash value used with various protocol lookup tables 136 * @skc_hash: hash value used with various protocol lookup tables
134 * @skc_u16hashes: two u16 hash values used by UDP lookup tables 137 * @skc_u16hashes: two u16 hash values used by UDP lookup tables
138 * @skc_dport: placeholder for inet_dport/tw_dport
139 * @skc_num: placeholder for inet_num/tw_num
135 * @skc_family: network address family 140 * @skc_family: network address family
136 * @skc_state: Connection state 141 * @skc_state: Connection state
137 * @skc_reuse: %SO_REUSEADDR setting 142 * @skc_reuse: %SO_REUSEADDR setting
@@ -149,16 +154,29 @@ struct net;
149 * for struct sock and struct inet_timewait_sock. 154 * for struct sock and struct inet_timewait_sock.
150 */ 155 */
151struct sock_common { 156struct sock_common {
152 /* skc_daddr and skc_rcv_saddr must be grouped : 157 /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned
153 * cf INET_MATCH() and INET_TW_MATCH() 158 * address on 64bit arches : cf INET_MATCH() and INET_TW_MATCH()
154 */ 159 */
155 __be32 skc_daddr; 160 union {
156 __be32 skc_rcv_saddr; 161 __addrpair skc_addrpair;
157 162 struct {
163 __be32 skc_daddr;
164 __be32 skc_rcv_saddr;
165 };
166 };
158 union { 167 union {
159 unsigned int skc_hash; 168 unsigned int skc_hash;
160 __u16 skc_u16hashes[2]; 169 __u16 skc_u16hashes[2];
161 }; 170 };
171 /* skc_dport && skc_num must be grouped as well */
172 union {
173 __portpair skc_portpair;
174 struct {
175 __be16 skc_dport;
176 __u16 skc_num;
177 };
178 };
179
162 unsigned short skc_family; 180 unsigned short skc_family;
163 volatile unsigned char skc_state; 181 volatile unsigned char skc_state;
164 unsigned char skc_reuse; 182 unsigned char skc_reuse;
@@ -213,7 +231,7 @@ struct cg_proto;
213 * @sk_sndbuf: size of send buffer in bytes 231 * @sk_sndbuf: size of send buffer in bytes
214 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 232 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
215 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 233 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
216 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets 234 * @sk_no_check: %SO_NO_CHECK setting, whether or not checkup packets
217 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) 235 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
218 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK) 236 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK)
219 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) 237 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)