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