1
2#if defined(TARGET_MIPS)
3
4
5
6
7
8
9
10 #define TARGET_SOL_SOCKET 0xffff
11
12 #define TARGET_SO_DEBUG 0x0001
13 #define TARGET_SO_REUSEADDR 0x0004
14 #define TARGET_SO_KEEPALIVE 0x0008
15
16 #define TARGET_SO_DONTROUTE 0x0010
17 #define TARGET_SO_BROADCAST 0x0020
18
19 #define TARGET_SO_LINGER 0x0080
20
21
22 #define TARGET_SO_OOBINLINE 0x0100
23
24 #if 0
25
26 #define TARGET_SO_REUSEPORT 0x0200
27 #endif
28
29 #define TARGET_SO_TYPE 0x1008
30 #define TARGET_SO_STYLE SO_TYPE
31 #define TARGET_SO_ERROR 0x1007
32 #define TARGET_SO_SNDBUF 0x1001
33 #define TARGET_SO_RCVBUF 0x1002
34 #define TARGET_SO_SNDLOWAT 0x1003
35 #define TARGET_SO_RCVLOWAT 0x1004
36 #define TARGET_SO_SNDTIMEO 0x1005
37 #define TARGET_SO_RCVTIMEO 0x1006
38 #define TARGET_SO_ACCEPTCONN 0x1009
39
40
41 #define TARGET_SO_NO_CHECK 11
42 #define TARGET_SO_PRIORITY 12
43 #define TARGET_SO_BSDCOMPAT 14
44
45 #define TARGET_SO_PASSCRED 17
46 #define TARGET_SO_PEERCRED 18
47
48
49 #define TARGET_SO_SECURITY_AUTHENTICATION 22
50 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
51 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
52
53 #define TARGET_SO_BINDTODEVICE 25
54
55
56 #define TARGET_SO_ATTACH_FILTER 26
57 #define TARGET_SO_DETACH_FILTER 27
58
59 #define TARGET_SO_PEERNAME 28
60 #define TARGET_SO_TIMESTAMP 29
61 #define SCM_TIMESTAMP SO_TIMESTAMP
62
63 #define TARGET_SO_PEERSEC 30
64 #define TARGET_SO_SNDBUFFORCE 31
65 #define TARGET_SO_RCVBUFFORCE 33
66 #define TARGET_SO_PASSSEC 34
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 #define ARCH_HAS_SOCKET_TYPES 1
88
89 enum sock_type {
90 TARGET_SOCK_DGRAM = 1,
91 TARGET_SOCK_STREAM = 2,
92 TARGET_SOCK_RAW = 3,
93 TARGET_SOCK_RDM = 4,
94 TARGET_SOCK_SEQPACKET = 5,
95 TARGET_SOCK_DCCP = 6,
96 TARGET_SOCK_PACKET = 10,
97 TARGET_SOCK_CLOEXEC = 02000000,
98 TARGET_SOCK_NONBLOCK = 0200,
99 };
100
101 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
102 #define TARGET_SOCK_TYPE_MASK 0xf
103
104#elif defined(TARGET_ALPHA)
105
106
107 #define TARGET_SOL_SOCKET 0xffff
108
109 #define TARGET_SO_DEBUG 0x0001
110 #define TARGET_SO_REUSEADDR 0x0004
111 #define TARGET_SO_KEEPALIVE 0x0008
112 #define TARGET_SO_DONTROUTE 0x0010
113 #define TARGET_SO_BROADCAST 0x0020
114 #define TARGET_SO_LINGER 0x0080
115 #define TARGET_SO_OOBINLINE 0x0100
116
117
118 #define TARGET_SO_TYPE 0x1008
119 #define TARGET_SO_ERROR 0x1007
120 #define TARGET_SO_SNDBUF 0x1001
121 #define TARGET_SO_RCVBUF 0x1002
122 #define TARGET_SO_SNDBUFFORCE 0x100a
123 #define TARGET_SO_RCVBUFFORCE 0x100b
124 #define TARGET_SO_RCVLOWAT 0x1010
125 #define TARGET_SO_SNDLOWAT 0x1011
126 #define TARGET_SO_RCVTIMEO 0x1012
127 #define TARGET_SO_SNDTIMEO 0x1013
128 #define TARGET_SO_ACCEPTCONN 0x1014
129 #define TARGET_SO_PROTOCOL 0x1028
130 #define TARGET_SO_DOMAIN 0x1029
131
132
133 #define TARGET_SO_NO_CHECK 11
134 #define TARGET_SO_PRIORITY 12
135 #define TARGET_SO_BSDCOMPAT 14
136
137 #define TARGET_SO_PASSCRED 17
138 #define TARGET_SO_PEERCRED 18
139 #define TARGET_SO_BINDTODEVICE 25
140
141
142 #define TARGET_SO_ATTACH_FILTER 26
143 #define TARGET_SO_DETACH_FILTER 27
144
145 #define TARGET_SO_PEERNAME 28
146 #define TARGET_SO_TIMESTAMP 29
147 #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
148
149 #define TARGET_SO_PEERSEC 30
150 #define TARGET_SO_PASSSEC 34
151 #define TARGET_SO_TIMESTAMPNS 35
152 #define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS
153
154
155 #define TARGET_SO_SECURITY_AUTHENTICATION 19
156 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 20
157 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 21
158
159 #define TARGET_SO_MARK 36
160
161 #define TARGET_SO_TIMESTAMPING 37
162 #define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING
163
164 #define TARGET_SO_RXQ_OVFL 40
165
166 #define TARGET_SO_WIFI_STATUS 41
167 #define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS
168 #define TARGET_SO_PEEK_OFF 42
169
170
171 #define TARGET_SO_NOFCS 43
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192 #define ARCH_HAS_SOCKET_TYPES 1
193
194 enum sock_type {
195 TARGET_SOCK_STREAM = 1,
196 TARGET_SOCK_DGRAM = 2,
197 TARGET_SOCK_RAW = 3,
198 TARGET_SOCK_RDM = 4,
199 TARGET_SOCK_SEQPACKET = 5,
200 TARGET_SOCK_DCCP = 6,
201 TARGET_SOCK_PACKET = 10,
202 TARGET_SOCK_CLOEXEC = 010000000,
203 TARGET_SOCK_NONBLOCK = 010000000000,
204 };
205
206 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
207 #define TARGET_SOCK_TYPE_MASK 0xf
208#else
209
210#if defined(TARGET_SPARC)
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230 #define ARCH_HAS_SOCKET_TYPES 1
231
232 enum sock_type {
233 TARGET_SOCK_STREAM = 1,
234 TARGET_SOCK_DGRAM = 2,
235 TARGET_SOCK_RAW = 3,
236 TARGET_SOCK_RDM = 4,
237 TARGET_SOCK_SEQPACKET = 5,
238 TARGET_SOCK_DCCP = 6,
239 TARGET_SOCK_PACKET = 10,
240 TARGET_SOCK_CLOEXEC = 020000000,
241 TARGET_SOCK_NONBLOCK = 040000,
242 };
243
244 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
245 #define TARGET_SOCK_TYPE_MASK 0xf
246
247 #define TARGET_SO_PASSSEC 31
248#else
249 #define TARGET_SO_PASSSEC 34
250#endif
251
252
253 #define TARGET_SOL_SOCKET 1
254
255 #define TARGET_SO_DEBUG 1
256 #define TARGET_SO_REUSEADDR 2
257 #define TARGET_SO_TYPE 3
258 #define TARGET_SO_ERROR 4
259 #define TARGET_SO_DONTROUTE 5
260 #define TARGET_SO_BROADCAST 6
261 #define TARGET_SO_SNDBUF 7
262 #define TARGET_SO_RCVBUF 8
263 #define TARGET_SO_SNDBUFFORCE 32
264 #define TARGET_SO_RCVBUFFORCE 33
265 #define TARGET_SO_KEEPALIVE 9
266 #define TARGET_SO_OOBINLINE 10
267 #define TARGET_SO_NO_CHECK 11
268 #define TARGET_SO_PRIORITY 12
269 #define TARGET_SO_LINGER 13
270 #define TARGET_SO_BSDCOMPAT 14
271
272#if defined(TARGET_PPC)
273 #define TARGET_SO_RCVLOWAT 16
274 #define TARGET_SO_SNDLOWAT 17
275 #define TARGET_SO_RCVTIMEO 18
276 #define TARGET_SO_SNDTIMEO 19
277 #define TARGET_SO_PASSCRED 20
278 #define TARGET_SO_PEERCRED 21
279#else
280 #define TARGET_SO_PASSCRED 16
281 #define TARGET_SO_PEERCRED 17
282 #define TARGET_SO_RCVLOWAT 18
283 #define TARGET_SO_SNDLOWAT 19
284 #define TARGET_SO_RCVTIMEO 20
285 #define TARGET_SO_SNDTIMEO 21
286#endif
287
288
289 #define TARGET_SO_SECURITY_AUTHENTICATION 22
290 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
291 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
292
293 #define TARGET_SO_BINDTODEVICE 25
294
295
296 #define TARGET_SO_ATTACH_FILTER 26
297 #define TARGET_SO_DETACH_FILTER 27
298
299 #define TARGET_SO_PEERNAME 28
300 #define TARGET_SO_TIMESTAMP 29
301 #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
302
303 #define TARGET_SO_ACCEPTCONN 30
304
305 #define TARGET_SO_PEERSEC 31
306
307#endif
308
309#ifndef ARCH_HAS_SOCKET_TYPES
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325 enum sock_type {
326 TARGET_SOCK_STREAM = 1,
327 TARGET_SOCK_DGRAM = 2,
328 TARGET_SOCK_RAW = 3,
329 TARGET_SOCK_RDM = 4,
330 TARGET_SOCK_SEQPACKET = 5,
331 TARGET_SOCK_DCCP = 6,
332 TARGET_SOCK_PACKET = 10,
333 TARGET_SOCK_CLOEXEC = 02000000,
334 TARGET_SOCK_NONBLOCK = 04000,
335 };
336
337 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
338 #define TARGET_SOCK_TYPE_MASK 0xf
339
340#endif
341