sockin.c revision 1.3.2.3 1 1.3.2.3 haad /* $NetBSD: sockin.c,v 1.3.2.3 2008/12/13 01:15:34 haad Exp $ */
2 1.3.2.2 haad
3 1.3.2.2 haad /*
4 1.3.2.2 haad * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
5 1.3.2.2 haad *
6 1.3.2.2 haad * Redistribution and use in source and binary forms, with or without
7 1.3.2.2 haad * modification, are permitted provided that the following conditions
8 1.3.2.2 haad * are met:
9 1.3.2.2 haad * 1. Redistributions of source code must retain the above copyright
10 1.3.2.2 haad * notice, this list of conditions and the following disclaimer.
11 1.3.2.2 haad * 2. Redistributions in binary form must reproduce the above copyright
12 1.3.2.2 haad * notice, this list of conditions and the following disclaimer in the
13 1.3.2.2 haad * documentation and/or other materials provided with the distribution.
14 1.3.2.2 haad *
15 1.3.2.2 haad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
16 1.3.2.2 haad * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 1.3.2.2 haad * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 1.3.2.2 haad * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 1.3.2.2 haad * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 1.3.2.2 haad * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 1.3.2.2 haad * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 1.3.2.2 haad * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 1.3.2.2 haad * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 1.3.2.2 haad * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 1.3.2.2 haad * SUCH DAMAGE.
26 1.3.2.2 haad */
27 1.3.2.2 haad
28 1.3.2.2 haad #include <sys/param.h>
29 1.3.2.2 haad #include <sys/condvar.h>
30 1.3.2.2 haad #include <sys/domain.h>
31 1.3.2.2 haad #include <sys/kmem.h>
32 1.3.2.2 haad #include <sys/kthread.h>
33 1.3.2.2 haad #include <sys/mbuf.h>
34 1.3.2.2 haad #include <sys/mutex.h>
35 1.3.2.2 haad #include <sys/poll.h>
36 1.3.2.2 haad #include <sys/protosw.h>
37 1.3.2.2 haad #include <sys/queue.h>
38 1.3.2.2 haad #include <sys/socket.h>
39 1.3.2.2 haad #include <sys/socketvar.h>
40 1.3.2.2 haad #include <sys/time.h>
41 1.3.2.2 haad
42 1.3.2.3 haad #include <net/radix.h>
43 1.3.2.3 haad
44 1.3.2.2 haad #include <netinet/in.h>
45 1.3.2.2 haad #include <netinet/in_systm.h>
46 1.3.2.2 haad #include <netinet/ip.h>
47 1.3.2.2 haad
48 1.3.2.2 haad #include <rump/rumpuser.h>
49 1.3.2.2 haad
50 1.3.2.2 haad /*
51 1.3.2.2 haad * An inet communication domain which uses the socket interface.
52 1.3.2.2 haad * Currently supports only IPv4 UDP, but could easily be extended to
53 1.3.2.2 haad * support IPv6 and TCP by adding more stuff to the protosw.
54 1.3.2.2 haad */
55 1.3.2.2 haad
56 1.3.2.2 haad DOMAIN_DEFINE(sockindomain);
57 1.3.2.2 haad
58 1.3.2.2 haad static void sockin_init(void);
59 1.3.2.2 haad static int sockin_usrreq(struct socket *, int, struct mbuf *,
60 1.3.2.2 haad struct mbuf *, struct mbuf *, struct lwp *);
61 1.3.2.3 haad static int sockin_ctloutput(int op, struct socket *, struct sockopt *);
62 1.3.2.2 haad
63 1.3.2.2 haad const struct protosw sockinsw[] = {
64 1.3.2.2 haad {
65 1.3.2.2 haad .pr_type = SOCK_DGRAM,
66 1.3.2.2 haad .pr_domain = &sockindomain,
67 1.3.2.2 haad .pr_protocol = IPPROTO_UDP,
68 1.3.2.2 haad .pr_flags = PR_ATOMIC|PR_ADDR,
69 1.3.2.2 haad .pr_usrreq = sockin_usrreq,
70 1.3.2.3 haad .pr_ctloutput = sockin_ctloutput,
71 1.3.2.2 haad },
72 1.3.2.2 haad {
73 1.3.2.2 haad .pr_type = SOCK_STREAM,
74 1.3.2.2 haad .pr_domain = &sockindomain,
75 1.3.2.2 haad .pr_protocol = IPPROTO_TCP,
76 1.3.2.2 haad .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS,
77 1.3.2.2 haad .pr_usrreq = sockin_usrreq,
78 1.3.2.3 haad .pr_ctloutput = sockin_ctloutput,
79 1.3.2.2 haad }};
80 1.3.2.2 haad
81 1.3.2.2 haad struct domain sockindomain = {
82 1.3.2.2 haad .dom_family = PF_INET,
83 1.3.2.2 haad .dom_name = "socket_inet",
84 1.3.2.2 haad .dom_init = sockin_init,
85 1.3.2.2 haad .dom_externalize = NULL,
86 1.3.2.2 haad .dom_dispose = NULL,
87 1.3.2.2 haad .dom_protosw = sockinsw,
88 1.3.2.3 haad .dom_protoswNPROTOSW = &sockinsw[__arraycount(sockinsw)],
89 1.3.2.3 haad .dom_rtattach = rn_inithead,
90 1.3.2.3 haad .dom_rtoffset = 32,
91 1.3.2.3 haad .dom_maxrtkey = sizeof(struct sockaddr_in),
92 1.3.2.2 haad .dom_ifattach = NULL,
93 1.3.2.2 haad .dom_ifdetach = NULL,
94 1.3.2.2 haad .dom_ifqueues = { NULL },
95 1.3.2.2 haad .dom_link = { NULL },
96 1.3.2.2 haad .dom_mowner = MOWNER_INIT("",""),
97 1.3.2.2 haad .dom_rtcache = { NULL },
98 1.3.2.2 haad .dom_sockaddr_cmp = NULL
99 1.3.2.2 haad };
100 1.3.2.2 haad
101 1.3.2.2 haad /* only for testing */
102 1.3.2.2 haad #if 0
103 1.3.2.2 haad #define SOCKIN_NOTHREAD
104 1.3.2.2 haad #endif
105 1.3.2.2 haad
106 1.3.2.2 haad #define SO2S(so) ((intptr_t)(so->so_internal))
107 1.3.2.2 haad #define SOCKIN_SBSIZE 65536
108 1.3.2.2 haad
109 1.3.2.3 haad struct sockin_unit {
110 1.3.2.3 haad struct socket *su_so;
111 1.3.2.3 haad
112 1.3.2.3 haad LIST_ENTRY(sockin_unit) su_entries;
113 1.3.2.3 haad };
114 1.3.2.3 haad static LIST_HEAD(, sockin_unit) su_ent = LIST_HEAD_INITIALIZER(su_ent);
115 1.3.2.3 haad static kmutex_t su_mtx;
116 1.3.2.3 haad static bool rebuild;
117 1.3.2.3 haad static int nsock;
118 1.3.2.3 haad
119 1.3.2.3 haad static int
120 1.3.2.3 haad registersock(struct socket *so, int news)
121 1.3.2.3 haad {
122 1.3.2.3 haad struct sockin_unit *su;
123 1.3.2.3 haad
124 1.3.2.3 haad su = kmem_alloc(sizeof(*su), KM_NOSLEEP);
125 1.3.2.3 haad if (!su)
126 1.3.2.3 haad return ENOMEM;
127 1.3.2.3 haad
128 1.3.2.3 haad so->so_internal = (void *)(intptr_t)news;
129 1.3.2.3 haad su->su_so = so;
130 1.3.2.3 haad
131 1.3.2.3 haad mutex_enter(&su_mtx);
132 1.3.2.3 haad LIST_INSERT_HEAD(&su_ent, su, su_entries);
133 1.3.2.3 haad nsock++;
134 1.3.2.3 haad rebuild = true;
135 1.3.2.3 haad mutex_exit(&su_mtx);
136 1.3.2.3 haad
137 1.3.2.3 haad return 0;
138 1.3.2.3 haad }
139 1.3.2.3 haad
140 1.3.2.2 haad static void
141 1.3.2.2 haad sockin_process(struct socket *so)
142 1.3.2.2 haad {
143 1.3.2.2 haad struct sockaddr_in from;
144 1.3.2.2 haad struct iovec io;
145 1.3.2.2 haad struct msghdr rmsg;
146 1.3.2.2 haad struct mbuf *m;
147 1.3.2.2 haad ssize_t n;
148 1.3.2.2 haad size_t plen;
149 1.3.2.2 haad int error;
150 1.3.2.2 haad
151 1.3.2.2 haad plen = IP_MAXPACKET;
152 1.3.2.2 haad m = m_gethdr(M_WAIT, MT_DATA);
153 1.3.2.2 haad MEXTMALLOC(m, plen, M_WAIT);
154 1.3.2.2 haad
155 1.3.2.2 haad memset(&rmsg, 0, sizeof(rmsg));
156 1.3.2.2 haad io.iov_base = mtod(m, void *);
157 1.3.2.2 haad io.iov_len = plen;
158 1.3.2.2 haad rmsg.msg_iov = &io;
159 1.3.2.2 haad rmsg.msg_iovlen = 1;
160 1.3.2.2 haad rmsg.msg_name = (struct sockaddr *)&from;
161 1.3.2.2 haad rmsg.msg_namelen = sizeof(from);
162 1.3.2.2 haad
163 1.3.2.2 haad n = rumpuser_net_recvmsg(SO2S(so), &rmsg, 0, &error);
164 1.3.2.2 haad if (n <= 0) {
165 1.3.2.2 haad m_freem(m);
166 1.3.2.2 haad return;
167 1.3.2.2 haad }
168 1.3.2.2 haad m->m_len = m->m_pkthdr.len = n;
169 1.3.2.2 haad
170 1.3.2.2 haad if (so->so_proto->pr_type == SOCK_DGRAM) {
171 1.3.2.2 haad if (!sbappendaddr(&so->so_rcv, rmsg.msg_name, m, NULL)) {
172 1.3.2.2 haad m_freem(m);
173 1.3.2.2 haad }
174 1.3.2.2 haad } else {
175 1.3.2.2 haad sbappendstream(&so->so_rcv, m);
176 1.3.2.2 haad }
177 1.3.2.2 haad
178 1.3.2.2 haad sorwakeup(so);
179 1.3.2.2 haad }
180 1.3.2.2 haad
181 1.3.2.3 haad #ifndef SOCKIN_NOTHREAD
182 1.3.2.3 haad static void
183 1.3.2.3 haad sockin_accept(struct socket *so)
184 1.3.2.3 haad {
185 1.3.2.3 haad struct socket *nso;
186 1.3.2.3 haad struct sockaddr_in sin;
187 1.3.2.3 haad int news, error, slen;
188 1.3.2.3 haad
189 1.3.2.3 haad slen = sizeof(sin);
190 1.3.2.3 haad news = rumpuser_net_accept(SO2S(so), (struct sockaddr *)&sin,
191 1.3.2.3 haad &slen, &error);
192 1.3.2.3 haad if (news == -1)
193 1.3.2.3 haad return;
194 1.3.2.2 haad
195 1.3.2.3 haad if ((nso = sonewconn(so, SS_ISCONNECTED)) == NULL)
196 1.3.2.3 haad goto errout;
197 1.3.2.3 haad if (registersock(nso, news) != 0)
198 1.3.2.3 haad goto errout;
199 1.3.2.3 haad return;
200 1.3.2.3 haad
201 1.3.2.3 haad errout:
202 1.3.2.3 haad rumpuser_close(news, &error);
203 1.3.2.3 haad if (nso)
204 1.3.2.3 haad soclose(nso);
205 1.3.2.3 haad }
206 1.3.2.2 haad
207 1.3.2.2 haad #define POLLTIMEOUT 100 /* check for new entries every 100ms */
208 1.3.2.2 haad
209 1.3.2.2 haad /* XXX: doesn't handle socket (kernel) locking properly? */
210 1.3.2.2 haad static void
211 1.3.2.2 haad sockinworker(void *arg)
212 1.3.2.2 haad {
213 1.3.2.2 haad struct pollfd *pfds = NULL, *npfds;
214 1.3.2.2 haad struct sockin_unit *su_iter;
215 1.3.2.3 haad struct socket *so;
216 1.3.2.2 haad int cursock = 0, i, rv, error;
217 1.3.2.2 haad
218 1.3.2.2 haad /*
219 1.3.2.2 haad * Loop reading requests. Check for new sockets periodically
220 1.3.2.2 haad * (could be smarter, but I'm lazy).
221 1.3.2.2 haad */
222 1.3.2.2 haad for (;;) {
223 1.3.2.2 haad if (rebuild) {
224 1.3.2.2 haad npfds = NULL;
225 1.3.2.2 haad mutex_enter(&su_mtx);
226 1.3.2.2 haad if (nsock)
227 1.3.2.2 haad npfds = kmem_alloc(nsock * sizeof(*npfds),
228 1.3.2.2 haad KM_NOSLEEP);
229 1.3.2.2 haad if (npfds || nsock == 0) {
230 1.3.2.2 haad if (pfds)
231 1.3.2.2 haad kmem_free(pfds, cursock*sizeof(*pfds));
232 1.3.2.2 haad pfds = npfds;
233 1.3.2.2 haad cursock = nsock;
234 1.3.2.2 haad rebuild = false;
235 1.3.2.2 haad
236 1.3.2.2 haad i = 0;
237 1.3.2.2 haad LIST_FOREACH(su_iter, &su_ent, su_entries) {
238 1.3.2.2 haad pfds[i].fd = SO2S(su_iter->su_so);
239 1.3.2.2 haad pfds[i].events = POLLIN;
240 1.3.2.2 haad pfds[i].revents = 0;
241 1.3.2.2 haad i++;
242 1.3.2.2 haad }
243 1.3.2.2 haad KASSERT(i == nsock);
244 1.3.2.2 haad }
245 1.3.2.2 haad mutex_exit(&su_mtx);
246 1.3.2.2 haad }
247 1.3.2.2 haad
248 1.3.2.2 haad /* find affected sockets & process */
249 1.3.2.2 haad rv = rumpuser_poll(pfds, cursock, POLLTIMEOUT, &error);
250 1.3.2.2 haad for (i = 0; i < cursock && rv > 0; i++) {
251 1.3.2.2 haad if (pfds[i].revents & POLLIN) {
252 1.3.2.2 haad mutex_enter(&su_mtx);
253 1.3.2.2 haad LIST_FOREACH(su_iter, &su_ent, su_entries) {
254 1.3.2.2 haad if (SO2S(su_iter->su_so)==pfds[i].fd) {
255 1.3.2.3 haad so = su_iter->su_so;
256 1.3.2.3 haad mutex_exit(&su_mtx);
257 1.3.2.2 haad mutex_enter(softnet_lock);
258 1.3.2.3 haad if(so->so_options&SO_ACCEPTCONN)
259 1.3.2.3 haad sockin_accept(so);
260 1.3.2.3 haad else
261 1.3.2.3 haad sockin_process(so);
262 1.3.2.2 haad mutex_exit(softnet_lock);
263 1.3.2.3 haad mutex_enter(&su_mtx);
264 1.3.2.2 haad break;
265 1.3.2.2 haad }
266 1.3.2.2 haad }
267 1.3.2.2 haad /* if we can't find it, just wing it */
268 1.3.2.2 haad KASSERT(rebuild || su_iter);
269 1.3.2.2 haad mutex_exit(&su_mtx);
270 1.3.2.2 haad pfds[i].revents = 0;
271 1.3.2.2 haad rv--;
272 1.3.2.2 haad i = -1;
273 1.3.2.2 haad continue;
274 1.3.2.2 haad }
275 1.3.2.2 haad
276 1.3.2.2 haad /* something else? ignore */
277 1.3.2.2 haad if (pfds[i].revents) {
278 1.3.2.2 haad pfds[i].revents = 0;
279 1.3.2.2 haad rv--;
280 1.3.2.2 haad }
281 1.3.2.2 haad }
282 1.3.2.2 haad KASSERT(rv <= 0);
283 1.3.2.2 haad }
284 1.3.2.2 haad
285 1.3.2.2 haad }
286 1.3.2.2 haad #endif /* SOCKIN_NOTHREAD */
287 1.3.2.2 haad
288 1.3.2.2 haad static void
289 1.3.2.2 haad sockin_init()
290 1.3.2.2 haad {
291 1.3.2.2 haad #ifndef SOCKIN_NOTHREAD
292 1.3.2.2 haad int rv;
293 1.3.2.2 haad
294 1.3.2.2 haad if ((rv = kthread_create(PRI_NONE, 0, NULL, sockinworker,
295 1.3.2.2 haad NULL, NULL, "sockwork")) != 0)
296 1.3.2.2 haad panic("sockin_init: could not create worker thread\n");
297 1.3.2.2 haad #endif
298 1.3.2.2 haad mutex_init(&su_mtx, MUTEX_DEFAULT, IPL_NONE);
299 1.3.2.2 haad }
300 1.3.2.2 haad
301 1.3.2.2 haad static int
302 1.3.2.2 haad sockin_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
303 1.3.2.2 haad struct mbuf *control, struct lwp *l)
304 1.3.2.2 haad {
305 1.3.2.2 haad int error = 0, rv;
306 1.3.2.2 haad
307 1.3.2.2 haad switch (req) {
308 1.3.2.2 haad case PRU_ATTACH:
309 1.3.2.2 haad {
310 1.3.2.2 haad int news;
311 1.3.2.2 haad
312 1.3.2.2 haad sosetlock(so);
313 1.3.2.2 haad if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
314 1.3.2.2 haad error = soreserve(so, SOCKIN_SBSIZE, SOCKIN_SBSIZE);
315 1.3.2.2 haad if (error)
316 1.3.2.2 haad break;
317 1.3.2.2 haad }
318 1.3.2.2 haad
319 1.3.2.2 haad news = rumpuser_net_socket(PF_INET, so->so_proto->pr_type,
320 1.3.2.2 haad 0, &error);
321 1.3.2.3 haad if (news == -1)
322 1.3.2.2 haad break;
323 1.3.2.2 haad
324 1.3.2.3 haad if ((error = registersock(so, news)) != 0)
325 1.3.2.3 haad rumpuser_close(news, &error);
326 1.3.2.3 haad
327 1.3.2.2 haad break;
328 1.3.2.2 haad }
329 1.3.2.2 haad
330 1.3.2.3 haad case PRU_ACCEPT:
331 1.3.2.3 haad /* we do all the work in the worker thread */
332 1.3.2.3 haad break;
333 1.3.2.3 haad
334 1.3.2.3 haad case PRU_BIND:
335 1.3.2.3 haad rumpuser_net_bind(SO2S(so), mtod(nam, const struct sockaddr *),
336 1.3.2.3 haad sizeof(struct sockaddr_in), &error);
337 1.3.2.3 haad break;
338 1.3.2.3 haad
339 1.3.2.2 haad case PRU_CONNECT:
340 1.3.2.2 haad /* don't bother to connect udp sockets, always sendmsg */
341 1.3.2.2 haad if (so->so_proto->pr_type == SOCK_DGRAM)
342 1.3.2.2 haad break;
343 1.3.2.2 haad
344 1.3.2.2 haad rv = rumpuser_net_connect(SO2S(so),
345 1.3.2.2 haad mtod(nam, struct sockaddr *), sizeof(struct sockaddr_in),
346 1.3.2.2 haad &error);
347 1.3.2.2 haad if (rv == 0)
348 1.3.2.2 haad soisconnected(so);
349 1.3.2.2 haad break;
350 1.3.2.2 haad
351 1.3.2.3 haad case PRU_LISTEN:
352 1.3.2.3 haad rumpuser_net_listen(SO2S(so), so->so_qlimit, &error);
353 1.3.2.3 haad break;
354 1.3.2.3 haad
355 1.3.2.2 haad case PRU_SEND:
356 1.3.2.2 haad {
357 1.3.2.2 haad struct sockaddr *saddr;
358 1.3.2.2 haad struct msghdr mhdr;
359 1.3.2.2 haad struct iovec iov[16];
360 1.3.2.2 haad struct mbuf *m2;
361 1.3.2.2 haad size_t tot;
362 1.3.2.2 haad int i, s;
363 1.3.2.2 haad
364 1.3.2.2 haad memset(&mhdr, 0, sizeof(mhdr));
365 1.3.2.2 haad
366 1.3.2.2 haad tot = 0;
367 1.3.2.2 haad for (i = 0, m2 = m; m2; m2 = m2->m_next, i++) {
368 1.3.2.2 haad if (i > 16)
369 1.3.2.2 haad panic("lazy bum");
370 1.3.2.2 haad iov[i].iov_base = m2->m_data;
371 1.3.2.2 haad iov[i].iov_len = m2->m_len;
372 1.3.2.2 haad tot += m2->m_len;
373 1.3.2.2 haad
374 1.3.2.2 haad }
375 1.3.2.2 haad mhdr.msg_iov = iov;
376 1.3.2.2 haad mhdr.msg_iovlen = i;
377 1.3.2.2 haad s = SO2S(so);
378 1.3.2.2 haad
379 1.3.2.2 haad if (so->so_proto->pr_type == SOCK_DGRAM) {
380 1.3.2.2 haad saddr = mtod(nam, struct sockaddr *);
381 1.3.2.2 haad mhdr.msg_name = saddr;
382 1.3.2.2 haad mhdr.msg_namelen = saddr->sa_len;
383 1.3.2.2 haad }
384 1.3.2.2 haad
385 1.3.2.2 haad rumpuser_net_sendmsg(s, &mhdr, 0, &error);
386 1.3.2.2 haad
387 1.3.2.2 haad m_freem(m);
388 1.3.2.2 haad m_freem(control);
389 1.3.2.2 haad #ifdef SOCKIN_NOTHREAD
390 1.3.2.2 haad /* this assumes too many things to list.. buthey, testing */
391 1.3.2.2 haad sockin_process(so);
392 1.3.2.2 haad #endif
393 1.3.2.2 haad }
394 1.3.2.2 haad break;
395 1.3.2.2 haad
396 1.3.2.2 haad case PRU_SHUTDOWN:
397 1.3.2.2 haad {
398 1.3.2.2 haad struct sockin_unit *su_iter;
399 1.3.2.2 haad
400 1.3.2.2 haad mutex_enter(&su_mtx);
401 1.3.2.2 haad LIST_FOREACH(su_iter, &su_ent, su_entries) {
402 1.3.2.2 haad if (su_iter->su_so == so)
403 1.3.2.2 haad break;
404 1.3.2.2 haad }
405 1.3.2.2 haad if (!su_iter)
406 1.3.2.2 haad panic("no such socket");
407 1.3.2.2 haad
408 1.3.2.2 haad LIST_REMOVE(su_iter, su_entries);
409 1.3.2.2 haad nsock--;
410 1.3.2.2 haad rebuild = true;
411 1.3.2.2 haad mutex_exit(&su_mtx);
412 1.3.2.2 haad
413 1.3.2.2 haad rumpuser_close(SO2S(su_iter->su_so), &error);
414 1.3.2.2 haad kmem_free(su_iter, sizeof(*su_iter));
415 1.3.2.2 haad }
416 1.3.2.2 haad break;
417 1.3.2.2 haad
418 1.3.2.2 haad default:
419 1.3.2.2 haad panic("sockin_usrreq: IMPLEMENT ME, req %d not supported", req);
420 1.3.2.2 haad }
421 1.3.2.2 haad
422 1.3.2.2 haad return error;
423 1.3.2.2 haad }
424 1.3.2.3 haad
425 1.3.2.3 haad static int
426 1.3.2.3 haad sockin_ctloutput(int op, struct socket *so, struct sockopt *sopt)
427 1.3.2.3 haad {
428 1.3.2.3 haad
429 1.3.2.3 haad /* XXX: we should also do something here */
430 1.3.2.3 haad return 0;
431 1.3.2.3 haad }
432