Move CONFIG_KVM related definitions to kvm_i386.h
[qemu/ar7.git] / linux-user / socket.h
blob7051cd2cf44112830ad77991c316e74b700ee4c7
2 #if defined(TARGET_MIPS)
3 /* MIPS special values for constants */
5 /*
6 * For setsockopt(2)
8 * This defines are ABI conformant as far as Linux supports these ...
9 */
10 #define TARGET_SOL_SOCKET 0xffff
12 #define TARGET_SO_DEBUG 0x0001 /* Record debugging information. */
13 #define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
14 #define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and send
15 SIGPIPE when they die. */
16 #define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */
17 #define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of
18 broadcast messages. */
19 #define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable
20 * socket to transmit pending data.
22 #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band.
24 #if 0
25 /* To add: Allow local address and port reuse. */
26 #define TARGET_SO_REUSEPORT 0x0200
27 #endif
29 #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
30 #define TARGET_SO_STYLE SO_TYPE /* Synonym */
31 #define TARGET_SO_ERROR 0x1007 /* get error status and clear */
32 #define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */
33 #define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */
34 #define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */
35 #define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */
36 #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */
37 #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */
38 #define TARGET_SO_ACCEPTCONN 0x1009
40 /* linux-specific, might as well be the same as on i386 */
41 #define TARGET_SO_NO_CHECK 11
42 #define TARGET_SO_PRIORITY 12
43 #define TARGET_SO_BSDCOMPAT 14
45 #define TARGET_SO_PASSCRED 17
46 #define TARGET_SO_PEERCRED 18
48 /* Security levels - as per NRL IPv6 - don't actually do anything */
49 #define TARGET_SO_SECURITY_AUTHENTICATION 22
50 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
51 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
53 #define TARGET_SO_BINDTODEVICE 25
55 /* Socket filtering */
56 #define TARGET_SO_ATTACH_FILTER 26
57 #define TARGET_SO_DETACH_FILTER 27
59 #define TARGET_SO_PEERNAME 28
60 #define TARGET_SO_TIMESTAMP 29
61 #define SCM_TIMESTAMP SO_TIMESTAMP
63 #define TARGET_SO_PEERSEC 30
64 #define TARGET_SO_SNDBUFFORCE 31
65 #define TARGET_SO_RCVBUFFORCE 33
66 #define TARGET_SO_PASSSEC 34
68 /** sock_type - Socket types
70 * Please notice that for binary compat reasons MIPS has to
71 * override the enum sock_type in include/linux/net.h, so
72 * we define ARCH_HAS_SOCKET_TYPES here.
74 * @SOCK_DGRAM - datagram (conn.less) socket
75 * @SOCK_STREAM - stream (connection) socket
76 * @SOCK_RAW - raw socket
77 * @SOCK_RDM - reliably-delivered message
78 * @SOCK_SEQPACKET - sequential packet socket
79 * @SOCK_DCCP - Datagram Congestion Control Protocol socket
80 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
81 * For writing rarp and other similar things on the user
82 * level.
83 * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
84 * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
87 #define ARCH_HAS_SOCKET_TYPES 1
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,
101 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
102 #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
104 #elif defined(TARGET_ALPHA)
106 /* For setsockopt(2) */
107 #define TARGET_SOL_SOCKET 0xffff
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 /* To add :#define TARGET_SO_REUSEPORT 0x0200 */
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
132 /* linux-specific, might as well be the same as on i386 */
133 #define TARGET_SO_NO_CHECK 11
134 #define TARGET_SO_PRIORITY 12
135 #define TARGET_SO_BSDCOMPAT 14
137 #define TARGET_SO_PASSCRED 17
138 #define TARGET_SO_PEERCRED 18
139 #define TARGET_SO_BINDTODEVICE 25
141 /* Socket filtering */
142 #define TARGET_SO_ATTACH_FILTER 26
143 #define TARGET_SO_DETACH_FILTER 27
145 #define TARGET_SO_PEERNAME 28
146 #define TARGET_SO_TIMESTAMP 29
147 #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
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
154 /* Security levels - as per NRL IPv6 - don't actually do anything */
155 #define TARGET_SO_SECURITY_AUTHENTICATION 19
156 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 20
157 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 21
159 #define TARGET_SO_MARK 36
161 #define TARGET_SO_TIMESTAMPING 37
162 #define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING
164 #define TARGET_SO_RXQ_OVFL 40
166 #define TARGET_SO_WIFI_STATUS 41
167 #define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS
168 #define TARGET_SO_PEEK_OFF 42
170 /* Instruct lower device to use last 4-bytes of skb data as FCS */
171 #define TARGET_SO_NOFCS 43
173 /** sock_type - Socket types
175 * Please notice that for binary compat reasons ALPHA has to
176 * override the enum sock_type in include/linux/net.h, so
177 * we define ARCH_HAS_SOCKET_TYPES here.
179 * @SOCK_DGRAM - datagram (conn.less) socket
180 * @SOCK_STREAM - stream (connection) socket
181 * @SOCK_RAW - raw socket
182 * @SOCK_RDM - reliably-delivered message
183 * @SOCK_SEQPACKET - sequential packet socket
184 * @SOCK_DCCP - Datagram Congestion Control Protocol socket
185 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
186 * For writing rarp and other similar things on the user
187 * level.
188 * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
189 * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
192 #define ARCH_HAS_SOCKET_TYPES 1
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,
206 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
207 #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
208 #elif defined(TARGET_HPPA)
209 #include <hppa/sockbits.h>
210 #else
212 #if defined(TARGET_SPARC)
213 /** sock_type - Socket types
215 * Please notice that for binary compat reasons SPARC has to
216 * override the enum sock_type in include/linux/net.h, so
217 * we define ARCH_HAS_SOCKET_TYPES here.
219 * @SOCK_DGRAM - datagram (conn.less) socket
220 * @SOCK_STREAM - stream (connection) socket
221 * @SOCK_RAW - raw socket
222 * @SOCK_RDM - reliably-delivered message
223 * @SOCK_SEQPACKET - sequential packet socket
224 * @SOCK_DCCP - Datagram Congestion Control Protocol socket
225 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
226 * For writing rarp and other similar things on the user
227 * level.
228 * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
229 * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
232 #define ARCH_HAS_SOCKET_TYPES 1
234 enum sock_type {
235 TARGET_SOCK_STREAM = 1,
236 TARGET_SOCK_DGRAM = 2,
237 TARGET_SOCK_RAW = 3,
238 TARGET_SOCK_RDM = 4,
239 TARGET_SOCK_SEQPACKET = 5,
240 TARGET_SOCK_DCCP = 6,
241 TARGET_SOCK_PACKET = 10,
242 TARGET_SOCK_CLOEXEC = 020000000,
243 TARGET_SOCK_NONBLOCK = 040000,
246 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
247 #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
249 #define TARGET_SO_PASSSEC 31
250 #else
251 #define TARGET_SO_PASSSEC 34
252 #endif
254 /* For setsockopt(2) */
255 #define TARGET_SOL_SOCKET 1
257 #define TARGET_SO_DEBUG 1
258 #define TARGET_SO_REUSEADDR 2
259 #define TARGET_SO_TYPE 3
260 #define TARGET_SO_ERROR 4
261 #define TARGET_SO_DONTROUTE 5
262 #define TARGET_SO_BROADCAST 6
263 #define TARGET_SO_SNDBUF 7
264 #define TARGET_SO_RCVBUF 8
265 #define TARGET_SO_SNDBUFFORCE 32
266 #define TARGET_SO_RCVBUFFORCE 33
267 #define TARGET_SO_KEEPALIVE 9
268 #define TARGET_SO_OOBINLINE 10
269 #define TARGET_SO_NO_CHECK 11
270 #define TARGET_SO_PRIORITY 12
271 #define TARGET_SO_LINGER 13
272 #define TARGET_SO_BSDCOMPAT 14
273 /* To add :#define TARGET_SO_REUSEPORT 15 */
274 #if defined(TARGET_PPC)
275 #define TARGET_SO_RCVLOWAT 16
276 #define TARGET_SO_SNDLOWAT 17
277 #define TARGET_SO_RCVTIMEO 18
278 #define TARGET_SO_SNDTIMEO 19
279 #define TARGET_SO_PASSCRED 20
280 #define TARGET_SO_PEERCRED 21
281 #else
282 #define TARGET_SO_PASSCRED 16
283 #define TARGET_SO_PEERCRED 17
284 #define TARGET_SO_RCVLOWAT 18
285 #define TARGET_SO_SNDLOWAT 19
286 #define TARGET_SO_RCVTIMEO 20
287 #define TARGET_SO_SNDTIMEO 21
288 #endif
290 /* Security levels - as per NRL IPv6 - don't actually do anything */
291 #define TARGET_SO_SECURITY_AUTHENTICATION 22
292 #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
293 #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
295 #define TARGET_SO_BINDTODEVICE 25
297 /* Socket filtering */
298 #define TARGET_SO_ATTACH_FILTER 26
299 #define TARGET_SO_DETACH_FILTER 27
301 #define TARGET_SO_PEERNAME 28
302 #define TARGET_SO_TIMESTAMP 29
303 #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
305 #define TARGET_SO_ACCEPTCONN 30
307 #define TARGET_SO_PEERSEC 31
309 #endif
311 #ifndef ARCH_HAS_SOCKET_TYPES
312 /** sock_type - Socket types - default values
315 * @SOCK_STREAM - stream (connection) socket
316 * @SOCK_DGRAM - datagram (conn.less) socket
317 * @SOCK_RAW - raw socket
318 * @SOCK_RDM - reliably-delivered message
319 * @SOCK_SEQPACKET - sequential packet socket
320 * @SOCK_DCCP - Datagram Congestion Control Protocol socket
321 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
322 * For writing rarp and other similar things on the user
323 * level.
324 * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
325 * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
327 enum sock_type {
328 TARGET_SOCK_STREAM = 1,
329 TARGET_SOCK_DGRAM = 2,
330 TARGET_SOCK_RAW = 3,
331 TARGET_SOCK_RDM = 4,
332 TARGET_SOCK_SEQPACKET = 5,
333 TARGET_SOCK_DCCP = 6,
334 TARGET_SOCK_PACKET = 10,
335 TARGET_SOCK_CLOEXEC = 02000000,
336 TARGET_SOCK_NONBLOCK = 04000,
339 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
340 #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
342 #endif