Go to the documentation of this file. 1 #ifndef _LINUX_SOCKET_H
2 #define _LINUX_SOCKET_H
5 #include <asm/socket.h>
8 #include <linux/types.h>
9 #include <linux/compiler.h>
15 #define __sockaddr_check_size(size) \
16 BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
20 extern void socket_seq_show(
struct seq_file *seq);
39 #define sockaddr_storage __kernel_sockaddr_storage
80 #define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
81 #define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
83 #define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
85 #define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
86 #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
87 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
89 #define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \
90 (struct cmsghdr *)(ctl) : \
91 (struct cmsghdr *)NULL)
92 #define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
93 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
94 (cmsg)->cmsg_len <= (unsigned long) \
95 ((mhdr)->msg_controllen - \
96 ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
117 if ((
unsigned long)((
char*)(__ptr+1) - (
char *) __ctl) > __size)
130 #define SCM_RIGHTS 0x01
131 #define SCM_CREDENTIALS 0x02
132 #define SCM_SECURITY 0x03
147 #define AF_APPLETALK 5
155 #define AF_NETBEUI 13
156 #define AF_SECURITY 14
158 #define AF_NETLINK 16
159 #define AF_ROUTE AF_NETLINK
168 #define AF_WANPIPE 25
172 #define AF_BLUETOOTH 31
177 #define AF_IEEE802154 36
184 #define PF_UNSPEC AF_UNSPEC
185 #define PF_UNIX AF_UNIX
186 #define PF_LOCAL AF_LOCAL
187 #define PF_INET AF_INET
188 #define PF_AX25 AF_AX25
189 #define PF_IPX AF_IPX
190 #define PF_APPLETALK AF_APPLETALK
191 #define PF_NETROM AF_NETROM
192 #define PF_BRIDGE AF_BRIDGE
193 #define PF_ATMPVC AF_ATMPVC
194 #define PF_X25 AF_X25
195 #define PF_INET6 AF_INET6
196 #define PF_ROSE AF_ROSE
197 #define PF_DECnet AF_DECnet
198 #define PF_NETBEUI AF_NETBEUI
199 #define PF_SECURITY AF_SECURITY
200 #define PF_KEY AF_KEY
201 #define PF_NETLINK AF_NETLINK
202 #define PF_ROUTE AF_ROUTE
203 #define PF_PACKET AF_PACKET
204 #define PF_ASH AF_ASH
205 #define PF_ECONET AF_ECONET
206 #define PF_ATMSVC AF_ATMSVC
207 #define PF_RDS AF_RDS
208 #define PF_SNA AF_SNA
209 #define PF_IRDA AF_IRDA
210 #define PF_PPPOX AF_PPPOX
211 #define PF_WANPIPE AF_WANPIPE
212 #define PF_LLC AF_LLC
213 #define PF_CAN AF_CAN
214 #define PF_TIPC AF_TIPC
215 #define PF_BLUETOOTH AF_BLUETOOTH
216 #define PF_IUCV AF_IUCV
217 #define PF_RXRPC AF_RXRPC
218 #define PF_ISDN AF_ISDN
219 #define PF_PHONET AF_PHONET
220 #define PF_IEEE802154 AF_IEEE802154
221 #define PF_CAIF AF_CAIF
222 #define PF_ALG AF_ALG
223 #define PF_NFC AF_NFC
224 #define PF_MAX AF_MAX
227 #define SOMAXCONN 128
235 #define MSG_DONTROUTE 4
236 #define MSG_TRYHARD 4
238 #define MSG_PROBE 0x10
239 #define MSG_TRUNC 0x20
240 #define MSG_DONTWAIT 0x40
242 #define MSG_WAITALL 0x100
243 #define MSG_FIN 0x200
244 #define MSG_SYN 0x400
245 #define MSG_CONFIRM 0x800
246 #define MSG_RST 0x1000
247 #define MSG_ERRQUEUE 0x2000
248 #define MSG_NOSIGNAL 0x4000
249 #define MSG_MORE 0x8000
250 #define MSG_WAITFORONE 0x10000
251 #define MSG_SENDPAGE_NOTLAST 0x20000
252 #define MSG_EOF MSG_FIN
254 #define MSG_FASTOPEN 0x20000000
255 #define MSG_CMSG_CLOEXEC 0x40000000
258 #if defined(CONFIG_COMPAT)
259 #define MSG_CMSG_COMPAT 0x80000000
261 #define MSG_CMSG_COMPAT 0
271 #define SOL_ICMPV6 58
273 #define SOL_UDPLITE 136
277 #define SOL_ATALK 258
278 #define SOL_NETROM 259
280 #define SOL_DECNET 261
282 #define SOL_PACKET 263
286 #define SOL_NETBEUI 267
289 #define SOL_NETLINK 270
291 #define SOL_RXRPC 272
292 #define SOL_PPPOL2TP 273
293 #define SOL_BLUETOOTH 274
294 #define SOL_PNPIPE 275
311 unsigned int len,
__wsum *csump);
325 unsigned int vlen,
unsigned int flags);