1 /****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19 #ifndef _LINUX_SOCKET_H
20 #define _LINUX_SOCKET_H
21 #define _K_SS_MAXSIZE 128
22 #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 struct __kernel_sockaddr_storage {
25 unsigned short ss_family;
26 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
27 } __attribute__ ((aligned(_K_SS_ALIGNSIZE)));
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #if !defined(__GLIBC__) || __GLIBC__ < 2
30 #include <asm/socket.h>
31 #include <linux/sockios.h>
32 #include <linux/uio.h>
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #include <linux/types.h>
35 #include <linux/compiler.h>
36 typedef unsigned short sa_family_t;
37 struct sockaddr {
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 sa_family_t sa_family;
40 char sa_data[14];
41 };
42 struct linger {
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 int l_onoff;
45 int l_linger;
46 };
47 #define sockaddr_storage __kernel_sockaddr_storage
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 struct msghdr {
50 void * msg_name;
51 int msg_namelen;
52 struct iovec * msg_iov;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 __kernel_size_t msg_iovlen;
55 void * msg_control;
56 __kernel_size_t msg_controllen;
57 unsigned msg_flags;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 };
60 struct cmsghdr {
61 __kernel_size_t cmsg_len;
62 int cmsg_level;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 int cmsg_type;
65 };
66 #define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
67 #define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 #define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
70 #define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
71 #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
72 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(ctl) : (struct cmsghdr *)NULL)
75 #define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
76 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
77 #ifdef __GNUC__
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define __KINLINE static __inline__
80 #elif defined(__cplusplus)
81 #define __KINLINE static inline
82 #else
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define __KINLINE static
85 #endif
__cmsg_nxthdr(void * __ctl,__kernel_size_t __size,struct cmsghdr * __cmsg)86 __KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
87 struct cmsghdr *__cmsg)
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 {
90 struct cmsghdr * __ptr;
91 __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
92 if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 return (struct cmsghdr *)0;
95 return __ptr;
96 }
cmsg_nxthdr(struct msghdr * __msg,struct cmsghdr * __cmsg)97 __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 {
100 return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
101 }
102 #define SCM_RIGHTS 0x01
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 #define SCM_CREDENTIALS 0x02
105 #define SCM_SECURITY 0x03
106 struct ucred {
107 __u32 pid;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 __u32 uid;
110 __u32 gid;
111 };
112 #define AF_UNSPEC 0
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 #define AF_UNIX 1
115 #define AF_LOCAL 1
116 #define AF_INET 2
117 #define AF_AX25 3
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 #define AF_IPX 4
120 #define AF_APPLETALK 5
121 #define AF_NETROM 6
122 #define AF_BRIDGE 7
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 #define AF_ATMPVC 8
125 #define AF_X25 9
126 #define AF_INET6 10
127 #define AF_ROSE 11
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 #define AF_DECnet 12
130 #define AF_NETBEUI 13
131 #define AF_SECURITY 14
132 #define AF_KEY 15
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 #define AF_NETLINK 16
135 #define AF_ROUTE AF_NETLINK
136 #define AF_PACKET 17
137 #define AF_ASH 18
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 #define AF_ECONET 19
140 #define AF_ATMSVC 20
141 #define AF_SNA 22
142 #define AF_IRDA 23
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 #define AF_PPPOX 24
145 #define AF_WANPIPE 25
146 #define AF_LLC 26
147 #define AF_TIPC 30
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define AF_BLUETOOTH 31
150 #define AF_CAIF 38
151 #define AF_MAX 39
152 #define PF_UNSPEC AF_UNSPEC
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 #define PF_UNIX AF_UNIX
155 #define PF_LOCAL AF_LOCAL
156 #define PF_INET AF_INET
157 #define PF_AX25 AF_AX25
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 #define PF_IPX AF_IPX
160 #define PF_APPLETALK AF_APPLETALK
161 #define PF_NETROM AF_NETROM
162 #define PF_BRIDGE AF_BRIDGE
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 #define PF_ATMPVC AF_ATMPVC
165 #define PF_X25 AF_X25
166 #define PF_INET6 AF_INET6
167 #define PF_ROSE AF_ROSE
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 #define PF_DECnet AF_DECnet
170 #define PF_NETBEUI AF_NETBEUI
171 #define PF_SECURITY AF_SECURITY
172 #define PF_KEY AF_KEY
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174 #define PF_NETLINK AF_NETLINK
175 #define PF_ROUTE AF_ROUTE
176 #define PF_PACKET AF_PACKET
177 #define PF_ASH AF_ASH
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179 #define PF_ECONET AF_ECONET
180 #define PF_ATMSVC AF_ATMSVC
181 #define PF_SNA AF_SNA
182 #define PF_IRDA AF_IRDA
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 #define PF_PPPOX AF_PPPOX
185 #define PF_WANPIPE AF_WANPIPE
186 #define PF_LLC AF_LLC
187 #define PF_TIPC AF_TIPC
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 #define PF_BLUETOOTH AF_BLUETOOTH
190 #define PF_CAIF AF_CAIF
191 #define PF_MAX AF_MAX
192 #define SOMAXCONN 128
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 #define MSG_OOB 1
195 #define MSG_PEEK 2
196 #define MSG_DONTROUTE 4
197 #define MSG_TRYHARD 4
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 #define MSG_CTRUNC 8
200 #define MSG_PROBE 0x10
201 #define MSG_TRUNC 0x20
202 #define MSG_DONTWAIT 0x40
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204 #define MSG_EOR 0x80
205 #define MSG_WAITALL 0x100
206 #define MSG_FIN 0x200
207 #define MSG_SYN 0x400
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 #define MSG_CONFIRM 0x800
210 #define MSG_RST 0x1000
211 #define MSG_ERRQUEUE 0x2000
212 #define MSG_NOSIGNAL 0x4000
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214 #define MSG_MORE 0x8000
215 #define MSG_EOF MSG_FIN
216 #define MSG_CMSG_COMPAT 0
217 #define SOL_IP 0
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219 #define SOL_TCP 6
220 #define SOL_UDP 17
221 #define SOL_IPV6 41
222 #define SOL_ICMPV6 58
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 #define SOL_SCTP 132
225 #define SOL_RAW 255
226 #define SOL_IPX 256
227 #define SOL_AX25 257
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 #define SOL_ATALK 258
230 #define SOL_NETROM 259
231 #define SOL_ROSE 260
232 #define SOL_DECNET 261
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 #define SOL_X25 262
235 #define SOL_PACKET 263
236 #define SOL_ATM 264
237 #define SOL_AAL 265
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 #define SOL_IRDA 266
240 #define SOL_NETBEUI 267
241 #define SOL_LLC 268
242 #define SOL_DCCP 269
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 #define SOL_NETLINK 270
245 #define SOL_TIPC 271
246 #define IPX_TYPE 1
247 #endif
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249 #endif
250