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