raw_ip.c revision 101919
1/*
2 * Copyright (c) 1982, 1986, 1988, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 *    must display the following acknowledgement:
15 *	This product includes software developed by the University of
16 *	California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 *    may be used to endorse or promote products derived from this software
19 *    without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 *	@(#)raw_ip.c	8.7 (Berkeley) 5/15/95
34 * $FreeBSD: head/sys/netinet/raw_ip.c 101919 2002-08-15 14:27:46Z rwatson $
35 */
36
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39#include "opt_mac.h"
40#include "opt_random_ip_id.h"
41
42#include <sys/param.h>
43#include <sys/kernel.h>
44#include <sys/lock.h>
45#include <sys/mac.h>
46#include <sys/malloc.h>
47#include <sys/mbuf.h>
48#include <sys/proc.h>
49#include <sys/protosw.h>
50#include <sys/signalvar.h>
51#include <sys/socket.h>
52#include <sys/socketvar.h>
53#include <sys/sx.h>
54#include <sys/sysctl.h>
55#include <sys/systm.h>
56
57#include <vm/uma.h>
58
59#include <net/if.h>
60#include <net/route.h>
61
62#define _IP_VHL
63#include <netinet/in.h>
64#include <netinet/in_systm.h>
65#include <netinet/in_pcb.h>
66#include <netinet/in_var.h>
67#include <netinet/ip.h>
68#include <netinet/ip_var.h>
69#include <netinet/ip_mroute.h>
70
71#include <netinet/ip_fw.h>
72#include <netinet/ip_dummynet.h>
73
74#ifdef IPSEC
75#include <netinet6/ipsec.h>
76#endif /*IPSEC*/
77
78struct	inpcbhead ripcb;
79struct	inpcbinfo ripcbinfo;
80
81/* control hooks for ipfw and dummynet */
82ip_fw_ctl_t *ip_fw_ctl_ptr;
83ip_dn_ctl_t *ip_dn_ctl_ptr;
84
85/*
86 * Nominal space allocated to a raw ip socket.
87 */
88#define	RIPSNDQ		8192
89#define	RIPRCVQ		8192
90
91/*
92 * Raw interface to IP protocol.
93 */
94
95/*
96 * Initialize raw connection block q.
97 */
98void
99rip_init()
100{
101	INP_INFO_LOCK_INIT(&ripcbinfo, "rip");
102	LIST_INIT(&ripcb);
103	ripcbinfo.listhead = &ripcb;
104	/*
105	 * XXX We don't use the hash list for raw IP, but it's easier
106	 * to allocate a one entry hash list than it is to check all
107	 * over the place for hashbase == NULL.
108	 */
109	ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask);
110	ripcbinfo.porthashbase = hashinit(1, M_PCB, &ripcbinfo.porthashmask);
111	ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb),
112	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
113	uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets);
114}
115
116static struct	sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET };
117/*
118 * Setup generic address and protocol structures
119 * for raw_input routine, then pass them along with
120 * mbuf chain.
121 */
122void
123rip_input(m, off)
124	struct mbuf *m;
125	int off;
126{
127	register struct ip *ip = mtod(m, struct ip *);
128	register struct inpcb *inp;
129	struct inpcb *last = 0;
130	struct mbuf *opts = 0;
131	int proto = ip->ip_p;
132
133	ripsrc.sin_addr = ip->ip_src;
134	LIST_FOREACH(inp, &ripcb, inp_list) {
135#ifdef INET6
136		if ((inp->inp_vflag & INP_IPV4) == 0)
137			continue;
138#endif
139		if (inp->inp_ip_p && inp->inp_ip_p != proto)
140			continue;
141		if (inp->inp_laddr.s_addr &&
142                  inp->inp_laddr.s_addr != ip->ip_dst.s_addr)
143			continue;
144		if (inp->inp_faddr.s_addr &&
145                  inp->inp_faddr.s_addr != ip->ip_src.s_addr)
146			continue;
147		if (last) {
148			struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
149			int policyfail = 0;
150
151			if (n != NULL) {
152#ifdef IPSSEC
153				/* check AH/ESP integrity. */
154				if (ipsec4_in_reject_so(n, last->inp_socket)) {
155					policyfail = 1;
156					ipsecstat.in_polvio++;
157					/* do not inject data to pcb */
158				}
159#endif /*IPSEC*/
160#ifdef MAC
161				if (policyfail == 0 &&
162				    mac_check_socket_receive(last->inp_socket,
163				    n) != 0)
164					policyfail = 1;
165#endif
166			}
167			if (policyfail)
168				m_freem(n);
169			else if (n) {
170				if (last->inp_flags & INP_CONTROLOPTS ||
171				    last->inp_socket->so_options & SO_TIMESTAMP)
172				    ip_savecontrol(last, &opts, ip, n);
173				if (sbappendaddr(&last->inp_socket->so_rcv,
174				    (struct sockaddr *)&ripsrc, n,
175				    opts) == 0) {
176					/* should notify about lost packet */
177					m_freem(n);
178					if (opts)
179					    m_freem(opts);
180				} else
181					sorwakeup(last->inp_socket);
182				opts = 0;
183			}
184		}
185		last = inp;
186	}
187	if (last) {
188#ifdef IPSEC
189		/* check AH/ESP integrity. */
190		if (ipsec4_in_reject_so(m, last->inp_socket)) {
191			m_freem(m);
192			ipsecstat.in_polvio++;
193			ipstat.ips_delivered--;
194			/* do not inject data to pcb */
195			return;
196		}
197#endif /*IPSEC*/
198#ifdef MAC
199		if (mac_check_socket_receive(last->inp_socket, m) != 0) {
200			m_freem(m);
201			ipstat.ips_delivered--;
202			return;
203		}
204#endif
205		if (last->inp_flags & INP_CONTROLOPTS ||
206		    last->inp_socket->so_options & SO_TIMESTAMP)
207			ip_savecontrol(last, &opts, ip, m);
208		if (sbappendaddr(&last->inp_socket->so_rcv,
209		    (struct sockaddr *)&ripsrc, m, opts) == 0) {
210			m_freem(m);
211			if (opts)
212			    m_freem(opts);
213		} else
214			sorwakeup(last->inp_socket);
215	} else {
216		m_freem(m);
217		ipstat.ips_noproto++;
218		ipstat.ips_delivered--;
219	}
220}
221
222/*
223 * Generate IP header and pass packet to ip_output.
224 * Tack on options user may have setup with control call.
225 */
226int
227rip_output(m, so, dst)
228	struct mbuf *m;
229	struct socket *so;
230	u_long dst;
231{
232	register struct ip *ip;
233	register struct inpcb *inp = sotoinpcb(so);
234	int flags = (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST;
235
236#ifdef MAC
237	mac_create_mbuf_from_socket(so, m);
238#endif
239
240	/*
241	 * If the user handed us a complete IP packet, use it.
242	 * Otherwise, allocate an mbuf for a header and fill it in.
243	 */
244	if ((inp->inp_flags & INP_HDRINCL) == 0) {
245		if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
246			m_freem(m);
247			return(EMSGSIZE);
248		}
249		M_PREPEND(m, sizeof(struct ip), M_TRYWAIT);
250		ip = mtod(m, struct ip *);
251		ip->ip_tos = inp->inp_ip_tos;
252		ip->ip_off = 0;
253		ip->ip_p = inp->inp_ip_p;
254		ip->ip_len = m->m_pkthdr.len;
255		ip->ip_src = inp->inp_laddr;
256		ip->ip_dst.s_addr = dst;
257		ip->ip_ttl = inp->inp_ip_ttl;
258	} else {
259		if (m->m_pkthdr.len > IP_MAXPACKET) {
260			m_freem(m);
261			return(EMSGSIZE);
262		}
263		ip = mtod(m, struct ip *);
264		/* don't allow both user specified and setsockopt options,
265		   and don't allow packet length sizes that will crash */
266		if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2))
267		     && inp->inp_options)
268		    || (ip->ip_len > m->m_pkthdr.len)
269		    || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) {
270			m_freem(m);
271			return EINVAL;
272		}
273		if (ip->ip_id == 0)
274#ifdef RANDOM_IP_ID
275			ip->ip_id = ip_randomid();
276#else
277			ip->ip_id = htons(ip_id++);
278#endif
279		/* XXX prevent ip_output from overwriting header fields */
280		flags |= IP_RAWOUTPUT;
281		ipstat.ips_rawout++;
282	}
283
284#ifdef IPSEC
285	if (ipsec_setsocket(m, so) != 0) {
286		m_freem(m);
287		return ENOBUFS;
288	}
289#endif /*IPSEC*/
290
291	return (ip_output(m, inp->inp_options, &inp->inp_route, flags,
292			  inp->inp_moptions));
293}
294
295/*
296 * Raw IP socket option processing.
297 */
298int
299rip_ctloutput(so, sopt)
300	struct socket *so;
301	struct sockopt *sopt;
302{
303	struct	inpcb *inp = sotoinpcb(so);
304	int	error, optval;
305
306	if (sopt->sopt_level != IPPROTO_IP)
307		return (EINVAL);
308
309	error = 0;
310
311	switch (sopt->sopt_dir) {
312	case SOPT_GET:
313		switch (sopt->sopt_name) {
314		case IP_HDRINCL:
315			optval = inp->inp_flags & INP_HDRINCL;
316			error = sooptcopyout(sopt, &optval, sizeof optval);
317			break;
318
319		case IP_FW_ADD:	/* ADD actually returns the body... */
320		case IP_FW_GET:
321			if (IPFW_LOADED)
322				error = ip_fw_ctl_ptr(sopt);
323			else
324				error = ENOPROTOOPT;
325			break;
326
327		case IP_DUMMYNET_GET:
328			if (DUMMYNET_LOADED)
329				error = ip_dn_ctl_ptr(sopt);
330			else
331				error = ENOPROTOOPT;
332			break ;
333
334		case MRT_INIT:
335		case MRT_DONE:
336		case MRT_ADD_VIF:
337		case MRT_DEL_VIF:
338		case MRT_ADD_MFC:
339		case MRT_DEL_MFC:
340		case MRT_VERSION:
341		case MRT_ASSERT:
342			error = ip_mrouter_get(so, sopt);
343			break;
344
345		default:
346			error = ip_ctloutput(so, sopt);
347			break;
348		}
349		break;
350
351	case SOPT_SET:
352		switch (sopt->sopt_name) {
353		case IP_HDRINCL:
354			error = sooptcopyin(sopt, &optval, sizeof optval,
355					    sizeof optval);
356			if (error)
357				break;
358			if (optval)
359				inp->inp_flags |= INP_HDRINCL;
360			else
361				inp->inp_flags &= ~INP_HDRINCL;
362			break;
363
364		case IP_FW_ADD:
365		case IP_FW_DEL:
366		case IP_FW_FLUSH:
367		case IP_FW_ZERO:
368		case IP_FW_RESETLOG:
369			if (IPFW_LOADED)
370				error = ip_fw_ctl_ptr(sopt);
371			else
372				error = ENOPROTOOPT;
373			break;
374
375		case IP_DUMMYNET_CONFIGURE:
376		case IP_DUMMYNET_DEL:
377		case IP_DUMMYNET_FLUSH:
378			if (DUMMYNET_LOADED)
379				error = ip_dn_ctl_ptr(sopt);
380			else
381				error = ENOPROTOOPT ;
382			break ;
383
384		case IP_RSVP_ON:
385			error = ip_rsvp_init(so);
386			break;
387
388		case IP_RSVP_OFF:
389			error = ip_rsvp_done();
390			break;
391
392			/* XXX - should be combined */
393		case IP_RSVP_VIF_ON:
394			error = ip_rsvp_vif_init(so, sopt);
395			break;
396
397		case IP_RSVP_VIF_OFF:
398			error = ip_rsvp_vif_done(so, sopt);
399			break;
400
401		case MRT_INIT:
402		case MRT_DONE:
403		case MRT_ADD_VIF:
404		case MRT_DEL_VIF:
405		case MRT_ADD_MFC:
406		case MRT_DEL_MFC:
407		case MRT_VERSION:
408		case MRT_ASSERT:
409			error = ip_mrouter_set(so, sopt);
410			break;
411
412		default:
413			error = ip_ctloutput(so, sopt);
414			break;
415		}
416		break;
417	}
418
419	return (error);
420}
421
422/*
423 * This function exists solely to receive the PRC_IFDOWN messages which
424 * are sent by if_down().  It looks for an ifaddr whose ifa_addr is sa,
425 * and calls in_ifadown() to remove all routes corresponding to that address.
426 * It also receives the PRC_IFUP messages from if_up() and reinstalls the
427 * interface routes.
428 */
429void
430rip_ctlinput(cmd, sa, vip)
431	int cmd;
432	struct sockaddr *sa;
433	void *vip;
434{
435	struct in_ifaddr *ia;
436	struct ifnet *ifp;
437	int err;
438	int flags;
439
440	switch (cmd) {
441	case PRC_IFDOWN:
442		TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) {
443			if (ia->ia_ifa.ifa_addr == sa
444			    && (ia->ia_flags & IFA_ROUTE)) {
445				/*
446				 * in_ifscrub kills the interface route.
447				 */
448				in_ifscrub(ia->ia_ifp, ia);
449				/*
450				 * in_ifadown gets rid of all the rest of
451				 * the routes.  This is not quite the right
452				 * thing to do, but at least if we are running
453				 * a routing process they will come back.
454				 */
455				in_ifadown(&ia->ia_ifa, 0);
456				break;
457			}
458		}
459		break;
460
461	case PRC_IFUP:
462		TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) {
463			if (ia->ia_ifa.ifa_addr == sa)
464				break;
465		}
466		if (ia == 0 || (ia->ia_flags & IFA_ROUTE))
467			return;
468		flags = RTF_UP;
469		ifp = ia->ia_ifa.ifa_ifp;
470
471		if ((ifp->if_flags & IFF_LOOPBACK)
472		    || (ifp->if_flags & IFF_POINTOPOINT))
473			flags |= RTF_HOST;
474
475		err = rtinit(&ia->ia_ifa, RTM_ADD, flags);
476		if (err == 0)
477			ia->ia_flags |= IFA_ROUTE;
478		break;
479	}
480}
481
482u_long	rip_sendspace = RIPSNDQ;
483u_long	rip_recvspace = RIPRCVQ;
484
485SYSCTL_INT(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW,
486    &rip_sendspace, 0, "Maximum outgoing raw IP datagram size");
487SYSCTL_INT(_net_inet_raw, OID_AUTO, recvspace, CTLFLAG_RW,
488    &rip_recvspace, 0, "Maximum incoming raw IP datagram size");
489
490static int
491rip_attach(struct socket *so, int proto, struct thread *td)
492{
493	struct inpcb *inp;
494	int error, s;
495
496	inp = sotoinpcb(so);
497	if (inp)
498		panic("rip_attach");
499	if (td && (error = suser(td)) != 0)
500		return error;
501
502	error = soreserve(so, rip_sendspace, rip_recvspace);
503	if (error)
504		return error;
505	s = splnet();
506	error = in_pcballoc(so, &ripcbinfo, td);
507	splx(s);
508	if (error)
509		return error;
510	inp = (struct inpcb *)so->so_pcb;
511	inp->inp_vflag |= INP_IPV4;
512	inp->inp_ip_p = proto;
513	inp->inp_ip_ttl = ip_defttl;
514	return 0;
515}
516
517static int
518rip_detach(struct socket *so)
519{
520	struct inpcb *inp;
521
522	inp = sotoinpcb(so);
523	if (inp == 0)
524		panic("rip_detach");
525	if (so == ip_mrouter)
526		ip_mrouter_done();
527	ip_rsvp_force_done(so);
528	if (so == ip_rsvpd)
529		ip_rsvp_done();
530	in_pcbdetach(inp);
531	return 0;
532}
533
534static int
535rip_abort(struct socket *so)
536{
537	soisdisconnected(so);
538	return rip_detach(so);
539}
540
541static int
542rip_disconnect(struct socket *so)
543{
544	if ((so->so_state & SS_ISCONNECTED) == 0)
545		return ENOTCONN;
546	return rip_abort(so);
547}
548
549static int
550rip_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
551{
552	struct inpcb *inp = sotoinpcb(so);
553	struct sockaddr_in *addr = (struct sockaddr_in *)nam;
554
555	if (nam->sa_len != sizeof(*addr))
556		return EINVAL;
557
558	if (TAILQ_EMPTY(&ifnet) || ((addr->sin_family != AF_INET) &&
559				    (addr->sin_family != AF_IMPLINK)) ||
560	    (addr->sin_addr.s_addr &&
561	     ifa_ifwithaddr((struct sockaddr *)addr) == 0))
562		return EADDRNOTAVAIL;
563	inp->inp_laddr = addr->sin_addr;
564	return 0;
565}
566
567static int
568rip_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
569{
570	struct inpcb *inp = sotoinpcb(so);
571	struct sockaddr_in *addr = (struct sockaddr_in *)nam;
572
573	if (nam->sa_len != sizeof(*addr))
574		return EINVAL;
575	if (TAILQ_EMPTY(&ifnet))
576		return EADDRNOTAVAIL;
577	if ((addr->sin_family != AF_INET) &&
578	    (addr->sin_family != AF_IMPLINK))
579		return EAFNOSUPPORT;
580	inp->inp_faddr = addr->sin_addr;
581	soisconnected(so);
582	return 0;
583}
584
585static int
586rip_shutdown(struct socket *so)
587{
588	socantsendmore(so);
589	return 0;
590}
591
592static int
593rip_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
594	 struct mbuf *control, struct thread *td)
595{
596	struct inpcb *inp = sotoinpcb(so);
597	register u_long dst;
598
599	if (so->so_state & SS_ISCONNECTED) {
600		if (nam) {
601			m_freem(m);
602			return EISCONN;
603		}
604		dst = inp->inp_faddr.s_addr;
605	} else {
606		if (nam == NULL) {
607			m_freem(m);
608			return ENOTCONN;
609		}
610		dst = ((struct sockaddr_in *)nam)->sin_addr.s_addr;
611	}
612	return rip_output(m, so, dst);
613}
614
615static int
616rip_pcblist(SYSCTL_HANDLER_ARGS)
617{
618	int error, i, n, s;
619	struct inpcb *inp, **inp_list;
620	inp_gen_t gencnt;
621	struct xinpgen xig;
622
623	/*
624	 * The process of preparing the TCB list is too time-consuming and
625	 * resource-intensive to repeat twice on every request.
626	 */
627	if (req->oldptr == 0) {
628		n = ripcbinfo.ipi_count;
629		req->oldidx = 2 * (sizeof xig)
630			+ (n + n/8) * sizeof(struct xinpcb);
631		return 0;
632	}
633
634	if (req->newptr != 0)
635		return EPERM;
636
637	/*
638	 * OK, now we're committed to doing something.
639	 */
640	s = splnet();
641	gencnt = ripcbinfo.ipi_gencnt;
642	n = ripcbinfo.ipi_count;
643	splx(s);
644
645	xig.xig_len = sizeof xig;
646	xig.xig_count = n;
647	xig.xig_gen = gencnt;
648	xig.xig_sogen = so_gencnt;
649	error = SYSCTL_OUT(req, &xig, sizeof xig);
650	if (error)
651		return error;
652
653	inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
654	if (inp_list == 0)
655		return ENOMEM;
656
657	s = splnet();
658	for (inp = LIST_FIRST(ripcbinfo.listhead), i = 0; inp && i < n;
659	     inp = LIST_NEXT(inp, inp_list)) {
660		if (inp->inp_gencnt <= gencnt) {
661			if (cr_canseesocket(req->td->td_ucred,
662			    inp->inp_socket))
663				continue;
664			inp_list[i++] = inp;
665		}
666	}
667	splx(s);
668	n = i;
669
670	error = 0;
671	for (i = 0; i < n; i++) {
672		inp = inp_list[i];
673		if (inp->inp_gencnt <= gencnt) {
674			struct xinpcb xi;
675			xi.xi_len = sizeof xi;
676			/* XXX should avoid extra copy */
677			bcopy(inp, &xi.xi_inp, sizeof *inp);
678			if (inp->inp_socket)
679				sotoxsocket(inp->inp_socket, &xi.xi_socket);
680			error = SYSCTL_OUT(req, &xi, sizeof xi);
681		}
682	}
683	if (!error) {
684		/*
685		 * Give the user an updated idea of our state.
686		 * If the generation differs from what we told
687		 * her before, she knows that something happened
688		 * while we were processing this request, and it
689		 * might be necessary to retry.
690		 */
691		s = splnet();
692		xig.xig_gen = ripcbinfo.ipi_gencnt;
693		xig.xig_sogen = so_gencnt;
694		xig.xig_count = ripcbinfo.ipi_count;
695		splx(s);
696		error = SYSCTL_OUT(req, &xig, sizeof xig);
697	}
698	free(inp_list, M_TEMP);
699	return error;
700}
701
702/*
703 * This is the wrapper function for in_setsockaddr.  We just pass down
704 * the pcbinfo for in_setpeeraddr to lock.
705 */
706static int
707rip_sockaddr(struct socket *so, struct sockaddr **nam)
708{
709	return (in_setsockaddr(so, nam, &ripcbinfo));
710}
711
712/*
713 * This is the wrapper function for in_setpeeraddr.  We just pass down
714 * the pcbinfo for in_setpeeraddr to lock.
715 */
716static int
717rip_peeraddr(struct socket *so, struct sockaddr **nam)
718{
719	return (in_setpeeraddr(so, nam, &ripcbinfo));
720}
721
722
723SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, 0, 0,
724	    rip_pcblist, "S,xinpcb", "List of active raw IP sockets");
725
726struct pr_usrreqs rip_usrreqs = {
727	rip_abort, pru_accept_notsupp, rip_attach, rip_bind, rip_connect,
728	pru_connect2_notsupp, in_control, rip_detach, rip_disconnect,
729	pru_listen_notsupp, rip_peeraddr, pru_rcvd_notsupp,
730	pru_rcvoob_notsupp, rip_send, pru_sense_null, rip_shutdown,
731	rip_sockaddr, sosend, soreceive, sopoll
732};
733