2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Copyright (c) 1982, 1986, 1988, 1993
30 * The Regents of the University of California. All rights reserved.
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 * 3. All advertising materials mentioning features or use of this software
41 * must display the following acknowledgement:
42 * This product includes software developed by the University of
43 * California, Berkeley and its contributors.
44 * 4. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
63 #include <sys/param.h>
64 #include <sys/systm.h>
65 #include <sys/kernel.h>
66 #include <sys/malloc.h>
69 #include <sys/domain.h>
70 #include <sys/protosw.h>
71 #include <sys/socket.h>
72 #include <sys/socketvar.h>
73 #include <sys/sysctl.h>
76 #include <vm/vm_zone.h>
80 #include <net/route.h>
83 #include <netinet/in.h>
84 #include <netinet/in_systm.h>
85 #include <netinet/ip.h>
86 #include <netinet/in_pcb.h>
87 #include <netinet/in_var.h>
88 #include <netinet/ip_var.h>
89 #include <netinet/ip_mroute.h>
91 #include <netinet/ip_fw.h>
94 #include <netinet6/ipsec.h>
98 #include <netinet/ip_dummynet.h>
102 extern int ipsec_bypass
;
103 extern lck_mtx_t
*sadb_mutex
;
106 extern u_long route_generation
;
107 struct inpcbhead ripcb
;
108 struct inpcbinfo ripcbinfo
;
110 /* control hooks for ipfw and dummynet */
111 ip_fw_ctl_t
*ip_fw_ctl_ptr
;
113 ip_dn_ctl_t
*ip_dn_ctl_ptr
;
114 #endif /* DUMMYNET */
117 * Nominal space allocated to a raw ip socket.
123 * Raw interface to IP protocol.
127 * Initialize raw connection block q.
132 struct inpcbinfo
*pcbinfo
;
135 ripcbinfo
.listhead
= &ripcb
;
137 * XXX We don't use the hash list for raw IP, but it's easier
138 * to allocate a one entry hash list than it is to check all
139 * over the place for hashbase == NULL.
141 ripcbinfo
.hashbase
= hashinit(1, M_PCB
, &ripcbinfo
.hashmask
);
142 ripcbinfo
.porthashbase
= hashinit(1, M_PCB
, &ripcbinfo
.porthashmask
);
144 ripcbinfo
.ipi_zone
= (void *) zinit(sizeof(struct inpcb
),
145 (4096 * sizeof(struct inpcb
)),
148 pcbinfo
= &ripcbinfo
;
150 * allocate lock group attribute and group for udp pcb mutexes
152 pcbinfo
->mtx_grp_attr
= lck_grp_attr_alloc_init();
154 pcbinfo
->mtx_grp
= lck_grp_alloc_init("ripcb", pcbinfo
->mtx_grp_attr
);
157 * allocate the lock attribute for udp pcb mutexes
159 pcbinfo
->mtx_attr
= lck_attr_alloc_init();
161 if ((pcbinfo
->mtx
= lck_rw_alloc_init(pcbinfo
->mtx_grp
, pcbinfo
->mtx_attr
)) == NULL
)
162 return; /* pretty much dead if this fails... */
166 static struct sockaddr_in ripsrc
= { sizeof(ripsrc
), AF_INET
};
168 * Setup generic address and protocol structures
169 * for raw_input routine, then pass them along with
177 register struct ip
*ip
= mtod(m
, struct ip
*);
178 register struct inpcb
*inp
;
179 struct inpcb
*last
= 0;
180 struct mbuf
*opts
= 0;
183 ripsrc
.sin_addr
= ip
->ip_src
;
184 lck_rw_lock_shared(ripcbinfo
.mtx
);
185 LIST_FOREACH(inp
, &ripcb
, inp_list
) {
187 if ((inp
->inp_vflag
& INP_IPV4
) == 0)
190 if (inp
->inp_ip_p
&& (inp
->inp_ip_p
!= ip
->ip_p
))
192 if (inp
->inp_laddr
.s_addr
&&
193 inp
->inp_laddr
.s_addr
!= ip
->ip_dst
.s_addr
)
195 if (inp
->inp_faddr
.s_addr
&&
196 inp
->inp_faddr
.s_addr
!= ip
->ip_src
.s_addr
)
199 struct mbuf
*n
= m_copy(m
, 0, (int)M_COPYALL
);
202 /* check AH/ESP integrity. */
204 if (ipsec_bypass
== 0 && n
) {
205 lck_mtx_lock(sadb_mutex
);
206 if (ipsec4_in_reject_so(n
, last
->inp_socket
)) {
208 ipsecstat
.in_polvio
++;
209 /* do not inject data to pcb */
212 lck_mtx_unlock(sadb_mutex
);
215 if (n
&& skipit
== 0) {
217 if (last
->inp_flags
& INP_CONTROLOPTS
||
218 last
->inp_socket
->so_options
& SO_TIMESTAMP
)
219 ip_savecontrol(last
, &opts
, ip
, n
);
220 if (last
->inp_flags
& INP_STRIPHDR
) {
222 n
->m_pkthdr
.len
-= iphlen
;
225 // ###LOCK need to lock that socket?
226 if (sbappendaddr(&last
->inp_socket
->so_rcv
,
227 (struct sockaddr
*)&ripsrc
, n
,
228 opts
, &error
) != 0) {
229 sorwakeup(last
->inp_socket
);
233 /* should notify about lost packet */
234 kprintf("rip_input can't append to socket\n");
242 lck_rw_done(ripcbinfo
.mtx
);
244 /* check AH/ESP integrity. */
246 if (ipsec_bypass
== 0 && last
) {
247 lck_mtx_lock(sadb_mutex
);
248 if (ipsec4_in_reject_so(m
, last
->inp_socket
)) {
250 ipsecstat
.in_polvio
++;
251 ipstat
.ips_delivered
--;
252 /* do not inject data to pcb */
255 lck_mtx_unlock(sadb_mutex
);
260 if (last
->inp_flags
& INP_CONTROLOPTS
||
261 last
->inp_socket
->so_options
& SO_TIMESTAMP
)
262 ip_savecontrol(last
, &opts
, ip
, m
);
263 if (last
->inp_flags
& INP_STRIPHDR
) {
265 m
->m_pkthdr
.len
-= iphlen
;
268 if (sbappendaddr(&last
->inp_socket
->so_rcv
,
269 (struct sockaddr
*)&ripsrc
, m
, opts
, NULL
) != 0) {
270 sorwakeup(last
->inp_socket
);
272 kprintf("rip_input(2) can't append to socket\n");
276 ipstat
.ips_noproto
++;
277 ipstat
.ips_delivered
--;
283 * Generate IP header and pass packet to ip_output.
284 * Tack on options user may have setup with control call.
287 rip_output(m
, so
, dst
)
288 register struct mbuf
*m
;
292 register struct ip
*ip
;
293 register struct inpcb
*inp
= sotoinpcb(so
);
294 int flags
= (so
->so_options
& SO_DONTROUTE
) | IP_ALLOWBROADCAST
;
297 * If the user handed us a complete IP packet, use it.
298 * Otherwise, allocate an mbuf for a header and fill it in.
300 if ((inp
->inp_flags
& INP_HDRINCL
) == 0) {
301 if (m
->m_pkthdr
.len
+ sizeof(struct ip
) > IP_MAXPACKET
) {
305 M_PREPEND(m
, sizeof(struct ip
), M_WAIT
);
306 ip
= mtod(m
, struct ip
*);
307 ip
->ip_tos
= inp
->inp_ip_tos
;
309 ip
->ip_p
= inp
->inp_ip_p
;
310 ip
->ip_len
= m
->m_pkthdr
.len
;
311 ip
->ip_src
= inp
->inp_laddr
;
312 ip
->ip_dst
.s_addr
= dst
;
313 ip
->ip_ttl
= inp
->inp_ip_ttl
;
315 if (m
->m_pkthdr
.len
> IP_MAXPACKET
) {
319 ip
= mtod(m
, struct ip
*);
320 /* don't allow both user specified and setsockopt options,
321 and don't allow packet length sizes that will crash */
322 if (((IP_VHL_HL(ip
->ip_vhl
) != (sizeof (*ip
) >> 2))
324 || (ip
->ip_len
> m
->m_pkthdr
.len
)
325 || (ip
->ip_len
< (IP_VHL_HL(ip
->ip_vhl
) << 2))) {
331 ip
->ip_id
= ip_randomid();
333 ip
->ip_id
= htons(ip_id
++);
335 /* XXX prevent ip_output from overwriting header fields */
336 flags
|= IP_RAWOUTPUT
;
341 if (ipsec_bypass
== 0 && ipsec_setsocket(m
, so
) != 0) {
347 if (inp
->inp_route
.ro_rt
&& inp
->inp_route
.ro_rt
->generation_id
!= route_generation
) {
348 rtfree(inp
->inp_route
.ro_rt
);
349 inp
->inp_route
.ro_rt
= (struct rtentry
*)0;
352 return (ip_output_list(m
, 0, inp
->inp_options
, &inp
->inp_route
, flags
,
364 if (!DUMMYNET_LOADED
)
366 #endif /* DUMMYNET */
369 return err
== 0 && ip_fw_ctl_ptr
== NULL
? -1 : err
;
373 * Raw IP socket option processing.
376 rip_ctloutput(so
, sopt
)
378 struct sockopt
*sopt
;
380 struct inpcb
*inp
= sotoinpcb(so
);
383 if (sopt
->sopt_level
!= IPPROTO_IP
)
388 switch (sopt
->sopt_dir
) {
390 switch (sopt
->sopt_name
) {
392 optval
= inp
->inp_flags
& INP_HDRINCL
;
393 error
= sooptcopyout(sopt
, &optval
, sizeof optval
);
397 optval
= inp
->inp_flags
& INP_STRIPHDR
;
398 error
= sooptcopyout(sopt
, &optval
, sizeof optval
);
405 if (ip_fw_ctl_ptr
== 0)
407 if (ip_fw_ctl_ptr
&& error
== 0)
408 error
= ip_fw_ctl_ptr(sopt
);
414 case IP_DUMMYNET_GET
:
416 error
= ip_dn_ctl_ptr(sopt
);
420 #endif /* DUMMYNET */
430 error
= ip_mrouter_get(so
, sopt
);
434 error
= ip_ctloutput(so
, sopt
);
440 switch (sopt
->sopt_name
) {
442 error
= sooptcopyin(sopt
, &optval
, sizeof optval
,
447 inp
->inp_flags
|= INP_HDRINCL
;
449 inp
->inp_flags
&= ~INP_HDRINCL
;
453 error
= sooptcopyin(sopt
, &optval
, sizeof optval
,
458 inp
->inp_flags
|= INP_STRIPHDR
;
460 inp
->inp_flags
&= ~INP_STRIPHDR
;
471 case IP_OLD_FW_FLUSH
:
473 case IP_OLD_FW_RESETLOG
:
474 if (ip_fw_ctl_ptr
== 0)
476 if (ip_fw_ctl_ptr
&& error
== 0)
477 error
= ip_fw_ctl_ptr(sopt
);
483 case IP_DUMMYNET_CONFIGURE
:
484 case IP_DUMMYNET_DEL
:
485 case IP_DUMMYNET_FLUSH
:
487 error
= ip_dn_ctl_ptr(sopt
);
489 error
= ENOPROTOOPT
;
494 error
= ip_rsvp_init(so
);
498 error
= ip_rsvp_done();
501 /* XXX - should be combined */
503 error
= ip_rsvp_vif_init(so
, sopt
);
506 case IP_RSVP_VIF_OFF
:
507 error
= ip_rsvp_vif_done(so
, sopt
);
518 error
= ip_mrouter_set(so
, sopt
);
522 error
= ip_ctloutput(so
, sopt
);
532 * This function exists solely to receive the PRC_IFDOWN messages which
533 * are sent by if_down(). It looks for an ifaddr whose ifa_addr is sa,
534 * and calls in_ifadown() to remove all routes corresponding to that address.
535 * It also receives the PRC_IFUP messages from if_up() and reinstalls the
539 rip_ctlinput(cmd
, sa
, vip
)
544 struct in_ifaddr
*ia
;
551 lck_mtx_lock(rt_mtx
);
552 for (ia
= in_ifaddrhead
.tqh_first
; ia
;
553 ia
= ia
->ia_link
.tqe_next
) {
554 if (ia
->ia_ifa
.ifa_addr
== sa
555 && (ia
->ia_flags
& IFA_ROUTE
)) {
557 * in_ifscrub kills the interface route.
559 in_ifscrub(ia
->ia_ifp
, ia
, 1);
561 * in_ifadown gets rid of all the rest of
562 * the routes. This is not quite the right
563 * thing to do, but at least if we are running
564 * a routing process they will come back.
566 in_ifadown(&ia
->ia_ifa
, 1);
570 lck_mtx_unlock(rt_mtx
);
574 lck_mtx_lock(rt_mtx
);
575 for (ia
= in_ifaddrhead
.tqh_first
; ia
;
576 ia
= ia
->ia_link
.tqe_next
) {
577 if (ia
->ia_ifa
.ifa_addr
== sa
)
580 if (ia
== 0 || (ia
->ia_flags
& IFA_ROUTE
)) {
581 lck_mtx_unlock(rt_mtx
);
585 ifp
= ia
->ia_ifa
.ifa_ifp
;
587 if ((ifp
->if_flags
& IFF_LOOPBACK
)
588 || (ifp
->if_flags
& IFF_POINTOPOINT
))
591 err
= rtinit_locked(&ia
->ia_ifa
, RTM_ADD
, flags
);
592 lck_mtx_unlock(rt_mtx
);
594 ia
->ia_flags
|= IFA_ROUTE
;
599 u_long rip_sendspace
= RIPSNDQ
;
600 u_long rip_recvspace
= RIPRCVQ
;
602 SYSCTL_INT(_net_inet_raw
, OID_AUTO
, maxdgram
, CTLFLAG_RW
,
603 &rip_sendspace
, 0, "Maximum outgoing raw IP datagram size");
604 SYSCTL_INT(_net_inet_raw
, OID_AUTO
, recvspace
, CTLFLAG_RW
,
605 &rip_recvspace
, 0, "Maximum incoming raw IP datagram size");
608 rip_attach(struct socket
*so
, int proto
, struct proc
*p
)
617 if ((so
->so_state
& SS_PRIV
) == 0)
620 if (p
&& (error
= suser(p
)) != 0)
624 error
= soreserve(so
, rip_sendspace
, rip_recvspace
);
628 error
= in_pcballoc(so
, &ripcbinfo
, p
);
632 inp
= (struct inpcb
*)so
->so_pcb
;
633 inp
->inp_vflag
|= INP_IPV4
;
634 inp
->inp_ip_p
= proto
;
635 inp
->inp_ip_ttl
= ip_defttl
;
639 __private_extern__
int
640 rip_detach(struct socket
*so
)
647 if (so
== ip_mrouter
)
649 ip_rsvp_force_done(so
);
656 __private_extern__
int
657 rip_abort(struct socket
*so
)
659 soisdisconnected(so
);
660 return rip_detach(so
);
663 __private_extern__
int
664 rip_disconnect(struct socket
*so
)
666 if ((so
->so_state
& SS_ISCONNECTED
) == 0)
668 return rip_abort(so
);
671 __private_extern__
int
672 rip_bind(struct socket
*so
, struct sockaddr
*nam
, struct proc
*p
)
674 struct inpcb
*inp
= sotoinpcb(so
);
675 struct sockaddr_in
*addr
= (struct sockaddr_in
*)nam
;
676 struct ifaddr
*ifa
= NULL
;
678 if (nam
->sa_len
!= sizeof(*addr
))
681 if (TAILQ_EMPTY(&ifnet_head
) || ((addr
->sin_family
!= AF_INET
) &&
682 (addr
->sin_family
!= AF_IMPLINK
)) ||
683 (addr
->sin_addr
.s_addr
&&
684 (ifa
= ifa_ifwithaddr((struct sockaddr
*)addr
)) == 0)) {
685 return EADDRNOTAVAIL
;
691 inp
->inp_laddr
= addr
->sin_addr
;
695 __private_extern__
int
696 rip_connect(struct socket
*so
, struct sockaddr
*nam
, struct proc
*p
)
698 struct inpcb
*inp
= sotoinpcb(so
);
699 struct sockaddr_in
*addr
= (struct sockaddr_in
*)nam
;
701 if (nam
->sa_len
!= sizeof(*addr
))
703 if (TAILQ_EMPTY(&ifnet_head
))
704 return EADDRNOTAVAIL
;
705 if ((addr
->sin_family
!= AF_INET
) &&
706 (addr
->sin_family
!= AF_IMPLINK
))
708 inp
->inp_faddr
= addr
->sin_addr
;
713 __private_extern__
int
714 rip_shutdown(struct socket
*so
)
720 __private_extern__
int
721 rip_send(struct socket
*so
, int flags
, struct mbuf
*m
, struct sockaddr
*nam
,
722 struct mbuf
*control
, struct proc
*p
)
724 struct inpcb
*inp
= sotoinpcb(so
);
727 if (so
->so_state
& SS_ISCONNECTED
) {
732 dst
= inp
->inp_faddr
.s_addr
;
738 dst
= ((struct sockaddr_in
*)nam
)->sin_addr
.s_addr
;
740 return rip_output(m
, so
, dst
);
743 /* note: rip_unlock is called from different protos instead of the generic socket_unlock,
744 * it will handle the socket dealloc on last reference
747 rip_unlock(struct socket
*so
, int refcount
, int debug
)
750 struct inpcb
*inp
= sotoinpcb(so
);
753 lr_saved
= (unsigned int) __builtin_return_address(0);
754 else lr_saved
= debug
;
757 if (so
->so_usecount
<= 0)
758 panic("rip_unlock: bad refoucnt so=%x val=%x\n", so
, so
->so_usecount
);
760 if (so
->so_usecount
== 0 && (inp
->inp_wantcnt
== WNT_STOPUSING
)) {
761 /* cleanup after last reference */
762 lck_mtx_unlock(so
->so_proto
->pr_domain
->dom_mtx
);
763 lck_rw_lock_exclusive(ripcbinfo
.mtx
);
765 lck_rw_done(ripcbinfo
.mtx
);
769 so
->unlock_lr
[so
->next_unlock_lr
] = (u_int
*)lr_saved
;
770 so
->next_unlock_lr
= (so
->next_unlock_lr
+1) % SO_LCKDBG_MAX
;
771 lck_mtx_unlock(so
->so_proto
->pr_domain
->dom_mtx
);
776 rip_pcblist SYSCTL_HANDLER_ARGS
779 struct inpcb
*inp
, **inp_list
;
784 * The process of preparing the TCB list is too time-consuming and
785 * resource-intensive to repeat twice on every request.
787 lck_rw_lock_exclusive(ripcbinfo
.mtx
);
788 if (req
->oldptr
== USER_ADDR_NULL
) {
789 n
= ripcbinfo
.ipi_count
;
790 req
->oldidx
= 2 * (sizeof xig
)
791 + (n
+ n
/8) * sizeof(struct xinpcb
);
792 lck_rw_done(ripcbinfo
.mtx
);
796 if (req
->newptr
!= USER_ADDR_NULL
) {
797 lck_rw_done(ripcbinfo
.mtx
);
802 * OK, now we're committed to doing something.
804 gencnt
= ripcbinfo
.ipi_gencnt
;
805 n
= ripcbinfo
.ipi_count
;
807 bzero(&xig
, sizeof(xig
));
808 xig
.xig_len
= sizeof xig
;
810 xig
.xig_gen
= gencnt
;
811 xig
.xig_sogen
= so_gencnt
;
812 error
= SYSCTL_OUT(req
, &xig
, sizeof xig
);
814 lck_rw_done(ripcbinfo
.mtx
);
818 * We are done if there is no pcb
821 lck_rw_done(ripcbinfo
.mtx
);
825 inp_list
= _MALLOC(n
* sizeof *inp_list
, M_TEMP
, M_WAITOK
);
827 lck_rw_done(ripcbinfo
.mtx
);
831 for (inp
= ripcbinfo
.listhead
->lh_first
, i
= 0; inp
&& i
< n
;
832 inp
= inp
->inp_list
.le_next
) {
833 if (inp
->inp_gencnt
<= gencnt
&& inp
->inp_state
!= INPCB_STATE_DEAD
)
839 for (i
= 0; i
< n
; i
++) {
841 if (inp
->inp_gencnt
<= gencnt
&& inp
->inp_state
!= INPCB_STATE_DEAD
) {
844 bzero(&xi
, sizeof(xi
));
845 xi
.xi_len
= sizeof xi
;
846 /* XXX should avoid extra copy */
847 inpcb_to_compat(inp
, &xi
.xi_inp
);
849 sotoxsocket(inp
->inp_socket
, &xi
.xi_socket
);
850 error
= SYSCTL_OUT(req
, &xi
, sizeof xi
);
855 * Give the user an updated idea of our state.
856 * If the generation differs from what we told
857 * her before, she knows that something happened
858 * while we were processing this request, and it
859 * might be necessary to retry.
861 bzero(&xig
, sizeof(xig
));
862 xig
.xig_len
= sizeof xig
;
863 xig
.xig_gen
= ripcbinfo
.ipi_gencnt
;
864 xig
.xig_sogen
= so_gencnt
;
865 xig
.xig_count
= ripcbinfo
.ipi_count
;
866 error
= SYSCTL_OUT(req
, &xig
, sizeof xig
);
868 FREE(inp_list
, M_TEMP
);
869 lck_rw_done(ripcbinfo
.mtx
);
873 SYSCTL_PROC(_net_inet_raw
, OID_AUTO
/*XXX*/, pcblist
, CTLFLAG_RD
, 0, 0,
874 rip_pcblist
, "S,xinpcb", "List of active raw IP sockets");
876 struct pr_usrreqs rip_usrreqs
= {
877 rip_abort
, pru_accept_notsupp
, rip_attach
, rip_bind
, rip_connect
,
878 pru_connect2_notsupp
, in_control
, rip_detach
, rip_disconnect
,
879 pru_listen_notsupp
, in_setpeeraddr
, pru_rcvd_notsupp
,
880 pru_rcvoob_notsupp
, rip_send
, pru_sense_null
, rip_shutdown
,
881 in_setsockaddr
, sosend
, soreceive
, pru_sopoll_notsupp