linux32_socketcall.h revision 1.1.2.2 1 1.1.2.2 yamt /* $NetBSD: linux32_socketcall.h,v 1.1.2.2 2006/02/18 15:39:02 yamt Exp $ */
2 1.1.2.2 yamt
3 1.1.2.2 yamt /*-
4 1.1.2.2 yamt * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 1.1.2.2 yamt *
6 1.1.2.2 yamt * Redistribution and use in source and binary forms, with or without
7 1.1.2.2 yamt * modification, are permitted provided that the following conditions
8 1.1.2.2 yamt * are met:
9 1.1.2.2 yamt * 1. Redistributions of source code must retain the above copyright
10 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer.
11 1.1.2.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
12 1.1.2.2 yamt * notice, this list of conditions and the following disclaimer in the
13 1.1.2.2 yamt * documentation and/or other materials provided with the distribution.
14 1.1.2.2 yamt * 3. All advertising materials mentioning features or use of this software
15 1.1.2.2 yamt * must display the following acknowledgement:
16 1.1.2.2 yamt * This product includes software developed by Emmanuel Dreyfus
17 1.1.2.2 yamt * 4. The name of the author may not be used to endorse or promote
18 1.1.2.2 yamt * products derived from this software without specific prior written
19 1.1.2.2 yamt * permission.
20 1.1.2.2 yamt *
21 1.1.2.2 yamt * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
22 1.1.2.2 yamt * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 1.1.2.2 yamt * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 1.1.2.2 yamt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 1.1.2.2 yamt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 1.1.2.2 yamt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 1.1.2.2 yamt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 1.1.2.2 yamt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 1.1.2.2 yamt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 1.1.2.2 yamt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 1.1.2.2 yamt * POSSIBILITY OF SUCH DAMAGE.
32 1.1.2.2 yamt */
33 1.1.2.2 yamt #ifndef _LINUX32_SOCKETCALL_H
34 1.1.2.2 yamt #define _LINUX32_SOCKETCALL_H
35 1.1.2.2 yamt
36 1.1.2.2 yamt #define LINUX32_MAX_SOCKETCALL 17
37 1.1.2.2 yamt
38 1.1.2.2 yamt #ifdef syscallarg
39 1.1.2.2 yamt #undef syscallarg
40 1.1.2.2 yamt #endif
41 1.1.2.2 yamt
42 1.1.2.2 yamt #define syscallarg(x) \
43 1.1.2.2 yamt union { \
44 1.1.2.2 yamt register32_t pad; \
45 1.1.2.2 yamt \
46 1.1.2.2 yamt struct { x datum; } le; \
47 1.1.2.2 yamt struct { /* LINTED zero array dimension */ \
48 1.1.2.2 yamt int8_t pad[ /* CONSTCOND */ \
49 1.1.2.2 yamt (sizeof (register32_t) < sizeof (x)) \
50 1.1.2.2 yamt ? 0 \
51 1.1.2.2 yamt : sizeof (register32_t) - sizeof (x)]; \
52 1.1.2.2 yamt x datum; \
53 1.1.2.2 yamt } be; \
54 1.1.2.2 yamt }
55 1.1.2.2 yamt
56 1.1.2.2 yamt struct linux32_sys_socket_args {
57 1.1.2.2 yamt syscallarg(int) domain;
58 1.1.2.2 yamt syscallarg(int) type;
59 1.1.2.2 yamt syscallarg(int) protocol;
60 1.1.2.2 yamt };
61 1.1.2.2 yamt
62 1.1.2.2 yamt struct linux32_sys_socketpair_args {
63 1.1.2.2 yamt syscallarg(int) domain;
64 1.1.2.2 yamt syscallarg(int) type;
65 1.1.2.2 yamt syscallarg(int) protocol;
66 1.1.2.2 yamt syscallarg(netbsd32_intp) rsv;
67 1.1.2.2 yamt };
68 1.1.2.2 yamt
69 1.1.2.2 yamt struct linux32_sys_sendto_args {
70 1.1.2.2 yamt syscallarg(int) s;
71 1.1.2.2 yamt syscallarg(netbsd32_voidp) msg;
72 1.1.2.2 yamt syscallarg(int) len;
73 1.1.2.2 yamt syscallarg(int) flags;
74 1.1.2.2 yamt syscallarg(netbsd32_sockaddrp_t) to;
75 1.1.2.2 yamt syscallarg(int) tolen;
76 1.1.2.2 yamt };
77 1.1.2.2 yamt
78 1.1.2.2 yamt struct linux32_sys_recvfrom_args {
79 1.1.2.2 yamt syscallarg(int) s;
80 1.1.2.2 yamt syscallarg(netbsd32_voidp) buf;
81 1.1.2.2 yamt syscallarg(netbsd32_size_t) len;
82 1.1.2.2 yamt syscallarg(int) flags;
83 1.1.2.2 yamt syscallarg(netbsd32_osockaddrp_t) from;
84 1.1.2.2 yamt syscallarg(netbsd32_intp) fromlenaddr;
85 1.1.2.2 yamt };
86 1.1.2.2 yamt
87 1.1.2.2 yamt struct linux32_sys_setsockopt_args {
88 1.1.2.2 yamt syscallarg(int) s;
89 1.1.2.2 yamt syscallarg(int) level;
90 1.1.2.2 yamt syscallarg(int) optname;
91 1.1.2.2 yamt syscallarg(netbsd32_voidp) optval;
92 1.1.2.2 yamt syscallarg(int) optlen;
93 1.1.2.2 yamt };
94 1.1.2.2 yamt
95 1.1.2.2 yamt struct linux32_sys_getsockopt_args {
96 1.1.2.2 yamt syscallarg(int) s;
97 1.1.2.2 yamt syscallarg(int) level;
98 1.1.2.2 yamt syscallarg(int) optname;
99 1.1.2.2 yamt syscallarg(netbsd32_voidp) optval;
100 1.1.2.2 yamt syscallarg(netbsd32_intp) optlen;
101 1.1.2.2 yamt };
102 1.1.2.2 yamt
103 1.1.2.2 yamt struct linux32_sys_bind_args {
104 1.1.2.2 yamt syscallarg(int) s;
105 1.1.2.2 yamt syscallarg(netbsd32_osockaddrp_t) name;
106 1.1.2.2 yamt syscallarg(int) namelen;
107 1.1.2.2 yamt };
108 1.1.2.2 yamt
109 1.1.2.2 yamt struct linux32_sys_connect_args {
110 1.1.2.2 yamt syscallarg(int) s;
111 1.1.2.2 yamt syscallarg(netbsd32_osockaddrp_t) name;
112 1.1.2.2 yamt syscallarg(int) namelen;
113 1.1.2.2 yamt };
114 1.1.2.2 yamt
115 1.1.2.2 yamt struct linux32_sys_accept_args {
116 1.1.2.2 yamt syscallarg(int) s;
117 1.1.2.2 yamt syscallarg(netbsd32_osockaddrp_t) name;
118 1.1.2.2 yamt syscallarg(netbsd32_intp) anamelen;
119 1.1.2.2 yamt };
120 1.1.2.2 yamt
121 1.1.2.2 yamt struct linux32_sys_getsockname_args {
122 1.1.2.2 yamt syscallarg(int) fdec;
123 1.1.2.2 yamt syscallarg(netbsd32_charp) asa;
124 1.1.2.2 yamt syscallarg(netbsd32_intp) alen;
125 1.1.2.2 yamt };
126 1.1.2.2 yamt
127 1.1.2.2 yamt struct linux32_sys_getpeername_args {
128 1.1.2.2 yamt syscallarg(int) fdes;
129 1.1.2.2 yamt syscallarg(netbsd32_sockaddrp_t) asa;
130 1.1.2.2 yamt syscallarg(netbsd32_intp) alen;
131 1.1.2.2 yamt };
132 1.1.2.2 yamt
133 1.1.2.2 yamt struct linux32_sys_sendmsg_args {
134 1.1.2.2 yamt syscallarg(int) s;
135 1.1.2.2 yamt syscallarg(netbsd32_msghdrp_t) msg;
136 1.1.2.2 yamt syscallarg(int) flags;
137 1.1.2.2 yamt };
138 1.1.2.2 yamt
139 1.1.2.2 yamt struct linux32_sys_recvmsg_args {
140 1.1.2.2 yamt syscallarg(int) s;
141 1.1.2.2 yamt syscallarg(netbsd32_msghdrp_t) msg;
142 1.1.2.2 yamt syscallarg(int) flags;
143 1.1.2.2 yamt };
144 1.1.2.2 yamt
145 1.1.2.2 yamt struct linux32_sys_send_args {
146 1.1.2.2 yamt syscallarg(int) s;
147 1.1.2.2 yamt syscallarg(netbsd32_voidp) buf;
148 1.1.2.2 yamt syscallarg(int) len;
149 1.1.2.2 yamt syscallarg(int) flags;
150 1.1.2.2 yamt };
151 1.1.2.2 yamt
152 1.1.2.2 yamt struct linux32_sys_recv_args {
153 1.1.2.2 yamt syscallarg(int) s;
154 1.1.2.2 yamt syscallarg(netbsd32_voidp) buf;
155 1.1.2.2 yamt syscallarg(int) len;
156 1.1.2.2 yamt syscallarg(int) flags;
157 1.1.2.2 yamt };
158 1.1.2.2 yamt
159 1.1.2.2 yamt union linux32_socketcall_args {
160 1.1.2.2 yamt struct linux_sys_socket_args socket_args;
161 1.1.2.2 yamt struct linux32_sys_bind_args bind_args;
162 1.1.2.2 yamt struct linux32_sys_connect_args connect_args;
163 1.1.2.2 yamt struct sys_listen_args listen_args;
164 1.1.2.2 yamt struct linux32_sys_accept_args accept_args;
165 1.1.2.2 yamt struct linux32_sys_getsockname_args getsockname_args;
166 1.1.2.2 yamt struct linux32_sys_getpeername_args getpeername_args;
167 1.1.2.2 yamt struct linux32_sys_socketpair_args socketpair_args;
168 1.1.2.2 yamt struct linux32_sys_send_args send_args;
169 1.1.2.2 yamt struct linux32_sys_recv_args recv_args;
170 1.1.2.2 yamt struct linux32_sys_sendto_args sendto_args;
171 1.1.2.2 yamt struct linux32_sys_recvfrom_args recvfrom_args;
172 1.1.2.2 yamt struct sys_shutdown_args shutdown_args;
173 1.1.2.2 yamt struct linux32_sys_setsockopt_args setsockopt_args;
174 1.1.2.2 yamt struct linux32_sys_getsockopt_args getsockopt_args;
175 1.1.2.2 yamt struct linux32_sys_sendmsg_args sendmsg_args;
176 1.1.2.2 yamt struct linux32_sys_recvmsg_args recvmsg_args;
177 1.1.2.2 yamt };
178 1.1.2.2 yamt
179 1.1.2.2 yamt # ifdef _KERNEL
180 1.1.2.2 yamt __BEGIN_DECLS
181 1.1.2.2 yamt int linux32_sys_socketpair __P((struct lwp *, void *, register_t *));
182 1.1.2.2 yamt int linux32_sys_sendto __P((struct lwp *, void *, register_t *));
183 1.1.2.2 yamt int linux32_sys_recvfrom __P((struct lwp *, void *, register_t *));
184 1.1.2.2 yamt int linux32_sys_setsockopt __P((struct lwp *, void *, register_t *));
185 1.1.2.2 yamt int linux32_sys_getsockopt __P((struct lwp *, void *, register_t *));
186 1.1.2.2 yamt int linux32_sys_connect __P((struct lwp *, void *, register_t *));
187 1.1.2.2 yamt int linux32_sys_socket __P((struct lwp *, void *, register_t *));
188 1.1.2.2 yamt int linux32_sys_bind __P((struct lwp *, void *, register_t *));
189 1.1.2.2 yamt int linux32_sys_getsockname __P((struct lwp *, void *, register_t *));
190 1.1.2.2 yamt int linux32_sys_getpeername __P((struct lwp *, void *, register_t *));
191 1.1.2.2 yamt int linux32_sys_sendmsg __P((struct lwp *, void *, register_t *));
192 1.1.2.2 yamt int linux32_sys_recvmsg __P((struct lwp *, void *, register_t *));
193 1.1.2.2 yamt int linux32_sys_recv __P((struct lwp *, void *, register_t *));
194 1.1.2.2 yamt int linux32_sys_send __P((struct lwp *, void *, register_t *));
195 1.1.2.2 yamt int linux32_sys_accept __P((struct lwp *, void *, register_t *));
196 1.1.2.2 yamt __END_DECLS
197 1.1.2.2 yamt # endif /* !_KERNEL */
198 1.1.2.2 yamt
199 1.1.2.2 yamt #endif /* !_LINUX32_SOCKETCALL_H */
200