9 #define __NEED_socklen_t
10 #define __NEED_sa_family_t
12 #define __NEED_ssize_t
16 #define __NEED_struct_iovec
18 #include <bits/alltypes.h>
20 #include <bits/socket.h>
46 #define SOCK_SEQPACKET 5
48 #define SOCK_PACKET 10
51 #define SOCK_CLOEXEC 02000000
52 #define SOCK_NONBLOCK 04000
57 #define PF_UNIX PF_LOCAL
58 #define PF_FILE PF_LOCAL
62 #define PF_APPLETALK 5
71 #define PF_SECURITY 14
74 #define PF_ROUTE PF_NETLINK
88 #define PF_BLUETOOTH 31
93 #define PF_IEEE802154 36
100 #define AF_UNSPEC PF_UNSPEC
101 #define AF_LOCAL PF_LOCAL
102 #define AF_UNIX AF_LOCAL
103 #define AF_FILE AF_LOCAL
104 #define AF_INET PF_INET
105 #define AF_AX25 PF_AX25
106 #define AF_IPX PF_IPX
107 #define AF_APPLETALK PF_APPLETALK
108 #define AF_NETROM PF_NETROM
109 #define AF_BRIDGE PF_BRIDGE
110 #define AF_ATMPVC PF_ATMPVC
111 #define AF_X25 PF_X25
112 #define AF_INET6 PF_INET6
113 #define AF_ROSE PF_ROSE
114 #define AF_DECnet PF_DECnet
115 #define AF_NETBEUI PF_NETBEUI
116 #define AF_SECURITY PF_SECURITY
117 #define AF_KEY PF_KEY
118 #define AF_NETLINK PF_NETLINK
119 #define AF_ROUTE PF_ROUTE
120 #define AF_PACKET PF_PACKET
121 #define AF_ASH PF_ASH
122 #define AF_ECONET PF_ECONET
123 #define AF_ATMSVC PF_ATMSVC
124 #define AF_RDS PF_RDS
125 #define AF_SNA PF_SNA
126 #define AF_IRDA PF_IRDA
127 #define AF_PPPOX PF_PPPOX
128 #define AF_WANPIPE PF_WANPIPE
129 #define AF_LLC PF_LLC
131 #define AF_CAN PF_CAN
132 #define AF_TIPC PF_TIPC
133 #define AF_BLUETOOTH PF_BLUETOOTH
134 #define AF_IUCV PF_IUCV
135 #define AF_RXRPC PF_RXRPC
136 #define AF_ISDN PF_ISDN
137 #define AF_PHONET PF_PHONET
138 #define AF_IEEE802154 PF_IEEE802154
139 #define AF_CAIF PF_CAIF
140 #define AF_ALG PF_ALG
141 #define AF_NFC PF_NFC
142 #define AF_VSOCK PF_VSOCK
143 #define AF_MAX PF_MAX
147 #define SO_REUSEADDR 2
150 #define SO_DONTROUTE 5
151 #define SO_BROADCAST 6
154 #define SO_KEEPALIVE 9
155 #define SO_OOBINLINE 10
156 #define SO_NO_CHECK 11
157 #define SO_PRIORITY 12
159 #define SO_BSDCOMPAT 14
160 #define SO_REUSEPORT 15
161 #define SO_PASSCRED 16
162 #define SO_PEERCRED 17
163 #define SO_RCVLOWAT 18
164 #define SO_SNDLOWAT 19
165 #define SO_RCVTIMEO 20
166 #define SO_SNDTIMEO 21
167 #define SO_SNDBUFFORCE 32
168 #define SO_RCVBUFFORCE 33
171 #define SO_SECURITY_AUTHENTICATION 22
172 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23
173 #define SO_SECURITY_ENCRYPTION_NETWORK 24
175 #define SO_BINDTODEVICE 25
177 #define SO_ATTACH_FILTER 26
178 #define SO_DETACH_FILTER 27
179 #define SO_GET_FILTER SO_ATTACH_FILTER
181 #define SO_PEERNAME 28
182 #define SO_TIMESTAMP 29
183 #define SCM_TIMESTAMP SO_TIMESTAMP
185 #define SO_ACCEPTCONN 30
186 #define SO_PEERSEC 31
187 #define SO_PASSSEC 34
188 #define SO_TIMESTAMPNS 35
189 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS
191 #define SO_TIMESTAMPING 37
192 #define SCM_TIMESTAMPING SO_TIMESTAMPING
193 #define SO_PROTOCOL 38
195 #define SO_RXQ_OVFL 40
196 #define SO_WIFI_STATUS 41
197 #define SCM_WIFI_STATUS SO_WIFI_STATUS
198 #define SO_PEEK_OFF 42
200 #define SO_LOCK_FILTER 44
201 #define SO_SELECT_ERR_QUEUE 45
202 #define SO_BUSY_POLL 46
209 #define SOL_DECNET 261
211 #define SOL_PACKET 263
216 #define SOMAXCONN 128
218 #define MSG_OOB 0x0001
219 #define MSG_PEEK 0x0002
220 #define MSG_DONTROUTE 0x0004
221 #define MSG_CTRUNC 0x0008
222 #define MSG_PROXY 0x0010
223 #define MSG_TRUNC 0x0020
224 #define MSG_DONTWAIT 0x0040
225 #define MSG_EOR 0x0080
226 #define MSG_WAITALL 0x0100
227 #define MSG_FIN 0x0200
228 #define MSD_SYN 0x0400
229 #define MSG_CONFIRM 0x0800
230 #define MSG_RST 0x1000
231 #define MSG_ERRQUEUE 0x2000
232 #define MSG_NOSIGNAL 0x4000
233 #define MSG_MORE 0x8000
234 #define MSG_WAITFORONE 0x10000
235 #define MSG_CMSG_CLOEXEC 0x40000000
237 #define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1))
238 #define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))
239 #define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)
241 #define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
242 #define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) ? (struct cmsghdr *)0 : \
243 (__CMSG_NEXT(cmsg) + sizeof (struct cmsghdr) >= __MHDR_END(mhdr) ? (struct cmsghdr *)0 : \
244 ((struct cmsghdr *)__CMSG_NEXT(cmsg))))
245 #define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
247 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
248 #define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr)))
249 #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
251 #define SCM_RIGHTS 0x01
252 #define SCM_CREDENTIALS 0x02
256 sa_family_t sa_family;
260 struct sockaddr_storage
262 sa_family_t ss_family;
263 unsigned long __ss_align;
264 char __ss_padding[128-2*sizeof(unsigned long)];
267 int socket (int, int, int);
268 int socketpair (int, int, int, int [2]);
270 int shutdown (int, int);
272 int bind (int, const struct sockaddr *, socklen_t);
273 int connect (int, const struct sockaddr *, socklen_t);
274 int listen (int, int);
275 int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);
276 int accept4(int, struct sockaddr *__restrict, socklen_t *__restrict, int);
278 int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
279 int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict);
281 ssize_t send (int, const void *, size_t, int);
282 ssize_t recv (int, void *, size_t, int);
283 ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
284 ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict);
285 ssize_t sendmsg (int, const struct msghdr *, int);
286 ssize_t recvmsg (int, struct msghdr *, int);
288 int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict);
289 int setsockopt (int, int, int, const void *, socklen_t);
291 int sockatmark (int);