root / linux-user / socket.h @ 67f0875e
History | View | Annotate | Download (5 kB)
1 | 3532fa74 | bellard | |
---|---|---|---|
2 | 3532fa74 | bellard | #if defined(TARGET_MIPS)
|
3 | 3532fa74 | bellard | // MIPS special values for constants
|
4 | 3532fa74 | bellard | |
5 | 3532fa74 | bellard | /*
|
6 | 3532fa74 | bellard | * For setsockopt(2)
|
7 | 3532fa74 | bellard | *
|
8 | 3532fa74 | bellard | * This defines are ABI conformant as far as Linux supports these ...
|
9 | 3532fa74 | bellard | */
|
10 | 3532fa74 | bellard | #define TARGET_SOL_SOCKET 0xffff |
11 | 3532fa74 | bellard | |
12 | 3532fa74 | bellard | #define TARGET_SO_DEBUG 0x0001 /* Record debugging information. */ |
13 | 3532fa74 | bellard | #define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */ |
14 | 3532fa74 | bellard | #define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and send |
15 | 3532fa74 | bellard | SIGPIPE when they die. */
|
16 | 3532fa74 | bellard | #define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */ |
17 | 3532fa74 | bellard | #define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of |
18 | 3532fa74 | bellard | broadcast messages. */
|
19 | 3532fa74 | bellard | #define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable |
20 | 3532fa74 | bellard | socket to transmit pending data. */
|
21 | 3532fa74 | bellard | #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */ |
22 | 3532fa74 | bellard | #if 0
|
23 | 3532fa74 | bellard | To add: #define TARGET_SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
|
24 | 3532fa74 | bellard | #endif
|
25 | 3532fa74 | bellard | |
26 | 3532fa74 | bellard | #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
|
27 | 3532fa74 | bellard | #define TARGET_SO_STYLE SO_TYPE /* Synonym */
|
28 | 3532fa74 | bellard | #define TARGET_SO_ERROR 0x1007 /* get error status and clear */
|
29 | 3532fa74 | bellard | #define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */
|
30 | 3532fa74 | bellard | #define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */
|
31 | 3532fa74 | bellard | #define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */
|
32 | 3532fa74 | bellard | #define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */
|
33 | 3532fa74 | bellard | #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */
|
34 | 3532fa74 | bellard | #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */
|
35 | 3532fa74 | bellard | #define TARGET_SO_ACCEPTCONN 0x1009
|
36 | 3532fa74 | bellard | |
37 | 3532fa74 | bellard | /* linux-specific, might as well be the same as on i386 */
|
38 | 3532fa74 | bellard | #define TARGET_SO_NO_CHECK 11
|
39 | 3532fa74 | bellard | #define TARGET_SO_PRIORITY 12
|
40 | 3532fa74 | bellard | #define TARGET_SO_BSDCOMPAT 14
|
41 | 3532fa74 | bellard | |
42 | 3532fa74 | bellard | #define TARGET_SO_PASSCRED 17
|
43 | 3532fa74 | bellard | #define TARGET_SO_PEERCRED 18
|
44 | 3532fa74 | bellard | |
45 | 3532fa74 | bellard | /* Security levels - as per NRL IPv6 - don't actually do anything */
|
46 | 3532fa74 | bellard | #define TARGET_SO_SECURITY_AUTHENTICATION 22
|
47 | 3532fa74 | bellard | #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
|
48 | 3532fa74 | bellard | #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
|
49 | 3532fa74 | bellard | |
50 | 3532fa74 | bellard | #define TARGET_SO_BINDTODEVICE 25
|
51 | 3532fa74 | bellard | |
52 | 3532fa74 | bellard | /* Socket filtering */
|
53 | 3532fa74 | bellard | #define TARGET_SO_ATTACH_FILTER 26
|
54 | 3532fa74 | bellard | #define TARGET_SO_DETACH_FILTER 27
|
55 | 3532fa74 | bellard | |
56 | 3532fa74 | bellard | #define TARGET_SO_PEERNAME 28
|
57 | 3532fa74 | bellard | #define TARGET_SO_TIMESTAMP 29
|
58 | 3532fa74 | bellard | #define SCM_TIMESTAMP SO_TIMESTAMP
|
59 | 3532fa74 | bellard | |
60 | 3532fa74 | bellard | #define TARGET_SO_PEERSEC 30
|
61 | 3532fa74 | bellard | #define TARGET_SO_SNDBUFFORCE 31
|
62 | 3532fa74 | bellard | #define TARGET_SO_RCVBUFFORCE 33
|
63 | 3532fa74 | bellard | |
64 | 3532fa74 | bellard | /** sock_type - Socket types
|
65 | 3532fa74 | bellard | *
|
66 | 3532fa74 | bellard | * Please notice that for binary compat reasons MIPS has to
|
67 | 3532fa74 | bellard | * override the enum sock_type in include/linux/net.h, so
|
68 | 3532fa74 | bellard | * we define ARCH_HAS_SOCKET_TYPES here.
|
69 | 3532fa74 | bellard | *
|
70 | 3532fa74 | bellard | * @SOCK_DGRAM - datagram (conn.less) socket
|
71 | 3532fa74 | bellard | * @SOCK_STREAM - stream (connection) socket
|
72 | 3532fa74 | bellard | * @SOCK_RAW - raw socket
|
73 | 3532fa74 | bellard | * @SOCK_RDM - reliably-delivered message
|
74 | 3532fa74 | bellard | * @SOCK_SEQPACKET - sequential packet socket
|
75 | 3532fa74 | bellard | * @SOCK_PACKET - linux specific way of getting packets at the dev level.
|
76 | 3532fa74 | bellard | * For writing rarp and other similar things on the user level.
|
77 | 3532fa74 | bellard | */
|
78 | 3532fa74 | bellard | enum sock_type {
|
79 | 3532fa74 | bellard | TARGET_SOCK_DGRAM = 1,
|
80 | 3532fa74 | bellard | TARGET_SOCK_STREAM = 2,
|
81 | 3532fa74 | bellard | TARGET_SOCK_RAW = 3,
|
82 | 3532fa74 | bellard | TARGET_SOCK_RDM = 4,
|
83 | 3532fa74 | bellard | TARGET_SOCK_SEQPACKET = 5,
|
84 | 3532fa74 | bellard | TARGET_SOCK_DCCP = 6,
|
85 | 3532fa74 | bellard | TARGET_SOCK_PACKET = 10,
|
86 | 3532fa74 | bellard | };
|
87 | 3532fa74 | bellard | |
88 | 3532fa74 | bellard | #define TARGET_SOCK_MAX (SOCK_PACKET + 1)
|
89 | 3532fa74 | bellard | |
90 | 3532fa74 | bellard | #else
|
91 | 3532fa74 | bellard | |
92 | 3532fa74 | bellard | /* For setsockopt(2) */
|
93 | 3532fa74 | bellard | #define TARGET_SOL_SOCKET 1 |
94 | 3532fa74 | bellard | |
95 | 3532fa74 | bellard | #define TARGET_SO_DEBUG 1 |
96 | 3532fa74 | bellard | #define TARGET_SO_REUSEADDR 2 |
97 | 3532fa74 | bellard | #define TARGET_SO_TYPE 3 |
98 | 3532fa74 | bellard | #define TARGET_SO_ERROR 4 |
99 | 3532fa74 | bellard | #define TARGET_SO_DONTROUTE 5 |
100 | 3532fa74 | bellard | #define TARGET_SO_BROADCAST 6 |
101 | 3532fa74 | bellard | #define TARGET_SO_SNDBUF 7 |
102 | 3532fa74 | bellard | #define TARGET_SO_RCVBUF 8 |
103 | 3532fa74 | bellard | #define TARGET_SO_SNDBUFFORCE 32 |
104 | 3532fa74 | bellard | #define TARGET_SO_RCVBUFFORCE 33 |
105 | 3532fa74 | bellard | #define TARGET_SO_KEEPALIVE 9 |
106 | 3532fa74 | bellard | #define TARGET_SO_OOBINLINE 10 |
107 | 3532fa74 | bellard | #define TARGET_SO_NO_CHECK 11 |
108 | 3532fa74 | bellard | #define TARGET_SO_PRIORITY 12 |
109 | 3532fa74 | bellard | #define TARGET_SO_LINGER 13 |
110 | 3532fa74 | bellard | #define TARGET_SO_BSDCOMPAT 14 |
111 | 3532fa74 | bellard | /* To add :#define TARGET_SO_REUSEPORT 15 */
|
112 | e32448e0 | j_mayer | #if defined(TARGET_PPC)
|
113 | e32448e0 | j_mayer | #define TARGET_SO_RCVLOWAT 16 |
114 | e32448e0 | j_mayer | #define TARGET_SO_SNDLOWAT 17 |
115 | e32448e0 | j_mayer | #define TARGET_SO_RCVTIMEO 18 |
116 | e32448e0 | j_mayer | #define TARGET_SO_SNDTIMEO 19 |
117 | e32448e0 | j_mayer | #define TARGET_SO_PASSCRED 20 |
118 | e32448e0 | j_mayer | #define TARGET_SO_PEERCRED 21 |
119 | e32448e0 | j_mayer | #else
|
120 | 3532fa74 | bellard | #define TARGET_SO_PASSCRED 16 |
121 | 3532fa74 | bellard | #define TARGET_SO_PEERCRED 17 |
122 | 3532fa74 | bellard | #define TARGET_SO_RCVLOWAT 18 |
123 | 3532fa74 | bellard | #define TARGET_SO_SNDLOWAT 19 |
124 | 3532fa74 | bellard | #define TARGET_SO_RCVTIMEO 20 |
125 | 3532fa74 | bellard | #define TARGET_SO_SNDTIMEO 21 |
126 | e32448e0 | j_mayer | #endif
|
127 | 3532fa74 | bellard | |
128 | 3532fa74 | bellard | /* Security levels - as per NRL IPv6 - don't actually do anything */
|
129 | 3532fa74 | bellard | #define TARGET_SO_SECURITY_AUTHENTICATION 22 |
130 | 3532fa74 | bellard | #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 |
131 | 3532fa74 | bellard | #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 |
132 | 3532fa74 | bellard | |
133 | 3532fa74 | bellard | #define TARGET_SO_BINDTODEVICE 25 |
134 | 3532fa74 | bellard | |
135 | 3532fa74 | bellard | /* Socket filtering */
|
136 | 3532fa74 | bellard | #define TARGET_SO_ATTACH_FILTER 26 |
137 | 3532fa74 | bellard | #define TARGET_SO_DETACH_FILTER 27 |
138 | 3532fa74 | bellard | |
139 | 3532fa74 | bellard | #define TARGET_SO_PEERNAME 28 |
140 | 3532fa74 | bellard | #define TARGET_SO_TIMESTAMP 29 |
141 | 3532fa74 | bellard | #define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
|
142 | 3532fa74 | bellard | |
143 | 3532fa74 | bellard | #define TARGET_SO_ACCEPTCONN 30 |
144 | 3532fa74 | bellard | |
145 | 3532fa74 | bellard | #define TARGET_SO_PEERSEC 31 |
146 | 3532fa74 | bellard | |
147 | 3532fa74 | bellard | #endif |