2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 * Copyright (c) 1982, 1986, 1988, 1993
32 * The Regents of the University of California. All rights reserved.
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions
37 * 1. Redistributions of source code must retain the above copyright
38 * notice, this list of conditions and the following disclaimer.
39 * 2. Redistributions in binary form must reproduce the above copyright
40 * notice, this list of conditions and the following disclaimer in the
41 * documentation and/or other materials provided with the distribution.
42 * 3. All advertising materials mentioning features or use of this software
43 * must display the following acknowledgement:
44 * This product includes software developed by the University of
45 * California, Berkeley and its contributors.
46 * 4. Neither the name of the University nor the names of its contributors
47 * may be used to endorse or promote products derived from this software
48 * without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
51 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
65 #include <sys/param.h>
66 #include <sys/systm.h>
67 #include <sys/kernel.h>
68 #include <sys/malloc.h>
71 #include <sys/domain.h>
72 #include <sys/protosw.h>
73 #include <sys/socket.h>
74 #include <sys/socketvar.h>
75 #include <sys/sysctl.h>
78 #include <vm/vm_zone.h>
82 #include <net/route.h>
85 #include <netinet/in.h>
86 #include <netinet/in_systm.h>
87 #include <netinet/ip.h>
88 #include <netinet/in_pcb.h>
89 #include <netinet/in_var.h>
90 #include <netinet/ip_var.h>
91 #include <netinet/ip_mroute.h>
93 #include <netinet/ip_fw.h>
96 #include <netinet6/ipsec.h>
100 #include <netinet/ip_dummynet.h>
104 extern int ipsec_bypass
;
105 extern lck_mtx_t
*sadb_mutex
;
108 extern u_long route_generation
;
109 struct inpcbhead ripcb
;
110 struct inpcbinfo ripcbinfo
;
112 /* control hooks for ipfw and dummynet */
113 ip_fw_ctl_t
*ip_fw_ctl_ptr
;
115 ip_dn_ctl_t
*ip_dn_ctl_ptr
;
116 #endif /* DUMMYNET */
119 * Nominal space allocated to a raw ip socket.
125 * Raw interface to IP protocol.
129 * Initialize raw connection block q.
134 struct inpcbinfo
*pcbinfo
;
137 ripcbinfo
.listhead
= &ripcb
;
139 * XXX We don't use the hash list for raw IP, but it's easier
140 * to allocate a one entry hash list than it is to check all
141 * over the place for hashbase == NULL.
143 ripcbinfo
.hashbase
= hashinit(1, M_PCB
, &ripcbinfo
.hashmask
);
144 ripcbinfo
.porthashbase
= hashinit(1, M_PCB
, &ripcbinfo
.porthashmask
);
146 ripcbinfo
.ipi_zone
= (void *) zinit(sizeof(struct inpcb
),
147 (4096 * sizeof(struct inpcb
)),
150 pcbinfo
= &ripcbinfo
;
152 * allocate lock group attribute and group for udp pcb mutexes
154 pcbinfo
->mtx_grp_attr
= lck_grp_attr_alloc_init();
156 pcbinfo
->mtx_grp
= lck_grp_alloc_init("ripcb", pcbinfo
->mtx_grp_attr
);
159 * allocate the lock attribute for udp pcb mutexes
161 pcbinfo
->mtx_attr
= lck_attr_alloc_init();
163 if ((pcbinfo
->mtx
= lck_rw_alloc_init(pcbinfo
->mtx_grp
, pcbinfo
->mtx_attr
)) == NULL
)
164 return; /* pretty much dead if this fails... */
168 static struct sockaddr_in ripsrc
= { sizeof(ripsrc
), AF_INET
};
170 * Setup generic address and protocol structures
171 * for raw_input routine, then pass them along with
179 register struct ip
*ip
= mtod(m
, struct ip
*);
180 register struct inpcb
*inp
;
181 struct inpcb
*last
= 0;
182 struct mbuf
*opts
= 0;
185 ripsrc
.sin_addr
= ip
->ip_src
;
186 lck_rw_lock_shared(ripcbinfo
.mtx
);
187 LIST_FOREACH(inp
, &ripcb
, inp_list
) {
189 if ((inp
->inp_vflag
& INP_IPV4
) == 0)
192 if (inp
->inp_ip_p
&& (inp
->inp_ip_p
!= ip
->ip_p
))
194 if (inp
->inp_laddr
.s_addr
&&
195 inp
->inp_laddr
.s_addr
!= ip
->ip_dst
.s_addr
)
197 if (inp
->inp_faddr
.s_addr
&&
198 inp
->inp_faddr
.s_addr
!= ip
->ip_src
.s_addr
)
201 struct mbuf
*n
= m_copy(m
, 0, (int)M_COPYALL
);
204 /* check AH/ESP integrity. */
206 if (ipsec_bypass
== 0 && n
) {
207 lck_mtx_lock(sadb_mutex
);
208 if (ipsec4_in_reject_so(n
, last
->inp_socket
)) {
210 ipsecstat
.in_polvio
++;
211 /* do not inject data to pcb */
214 lck_mtx_unlock(sadb_mutex
);
217 if (n
&& skipit
== 0) {
219 if (last
->inp_flags
& INP_CONTROLOPTS
||
220 last
->inp_socket
->so_options
& SO_TIMESTAMP
)
221 ip_savecontrol(last
, &opts
, ip
, n
);
222 if (last
->inp_flags
& INP_STRIPHDR
) {
224 n
->m_pkthdr
.len
-= iphlen
;
227 // ###LOCK need to lock that socket?
228 if (sbappendaddr(&last
->inp_socket
->so_rcv
,
229 (struct sockaddr
*)&ripsrc
, n
,
230 opts
, &error
) != 0) {
231 sorwakeup(last
->inp_socket
);
235 /* should notify about lost packet */
236 kprintf("rip_input can't append to socket\n");
244 lck_rw_done(ripcbinfo
.mtx
);
246 /* check AH/ESP integrity. */
248 if (ipsec_bypass
== 0 && last
) {
249 lck_mtx_lock(sadb_mutex
);
250 if (ipsec4_in_reject_so(m
, last
->inp_socket
)) {
252 ipsecstat
.in_polvio
++;
253 ipstat
.ips_delivered
--;
254 /* do not inject data to pcb */
257 lck_mtx_unlock(sadb_mutex
);
262 if (last
->inp_flags
& INP_CONTROLOPTS
||
263 last
->inp_socket
->so_options
& SO_TIMESTAMP
)
264 ip_savecontrol(last
, &opts
, ip
, m
);
265 if (last
->inp_flags
& INP_STRIPHDR
) {
267 m
->m_pkthdr
.len
-= iphlen
;
270 if (sbappendaddr(&last
->inp_socket
->so_rcv
,
271 (struct sockaddr
*)&ripsrc
, m
, opts
, NULL
) != 0) {
272 sorwakeup(last
->inp_socket
);
274 kprintf("rip_input(2) can't append to socket\n");
278 ipstat
.ips_noproto
++;
279 ipstat
.ips_delivered
--;
285 * Generate IP header and pass packet to ip_output.
286 * Tack on options user may have setup with control call.
289 rip_output(m
, so
, dst
)
290 register struct mbuf
*m
;
294 register struct ip
*ip
;
295 register struct inpcb
*inp
= sotoinpcb(so
);
296 int flags
= (so
->so_options
& SO_DONTROUTE
) | IP_ALLOWBROADCAST
;
299 * If the user handed us a complete IP packet, use it.
300 * Otherwise, allocate an mbuf for a header and fill it in.
302 if ((inp
->inp_flags
& INP_HDRINCL
) == 0) {
303 if (m
->m_pkthdr
.len
+ sizeof(struct ip
) > IP_MAXPACKET
) {
307 M_PREPEND(m
, sizeof(struct ip
), M_WAIT
);
308 ip
= mtod(m
, struct ip
*);
309 ip
->ip_tos
= inp
->inp_ip_tos
;
311 ip
->ip_p
= inp
->inp_ip_p
;
312 ip
->ip_len
= m
->m_pkthdr
.len
;
313 ip
->ip_src
= inp
->inp_laddr
;
314 ip
->ip_dst
.s_addr
= dst
;
315 ip
->ip_ttl
= inp
->inp_ip_ttl
;
317 if (m
->m_pkthdr
.len
> IP_MAXPACKET
) {
321 ip
= mtod(m
, struct ip
*);
322 /* don't allow both user specified and setsockopt options,
323 and don't allow packet length sizes that will crash */
324 if (((IP_VHL_HL(ip
->ip_vhl
) != (sizeof (*ip
) >> 2))
326 || (ip
->ip_len
> m
->m_pkthdr
.len
)
327 || (ip
->ip_len
< (IP_VHL_HL(ip
->ip_vhl
) << 2))) {
333 ip
->ip_id
= ip_randomid();
335 ip
->ip_id
= htons(ip_id
++);
337 /* XXX prevent ip_output from overwriting header fields */
338 flags
|= IP_RAWOUTPUT
;
343 if (ipsec_bypass
== 0 && ipsec_setsocket(m
, so
) != 0) {
349 if (inp
->inp_route
.ro_rt
&& inp
->inp_route
.ro_rt
->generation_id
!= route_generation
) {
350 rtfree(inp
->inp_route
.ro_rt
);
351 inp
->inp_route
.ro_rt
= (struct rtentry
*)0;
354 return (ip_output_list(m
, 0, inp
->inp_options
, &inp
->inp_route
, flags
,
366 if (!DUMMYNET_LOADED
)
368 #endif /* DUMMYNET */
371 return err
== 0 && ip_fw_ctl_ptr
== NULL
? -1 : err
;
375 * Raw IP socket option processing.
378 rip_ctloutput(so
, sopt
)
380 struct sockopt
*sopt
;
382 struct inpcb
*inp
= sotoinpcb(so
);
385 if (sopt
->sopt_level
!= IPPROTO_IP
)
390 switch (sopt
->sopt_dir
) {
392 switch (sopt
->sopt_name
) {
394 optval
= inp
->inp_flags
& INP_HDRINCL
;
395 error
= sooptcopyout(sopt
, &optval
, sizeof optval
);
399 optval
= inp
->inp_flags
& INP_STRIPHDR
;
400 error
= sooptcopyout(sopt
, &optval
, sizeof optval
);
407 if (ip_fw_ctl_ptr
== 0)
409 if (ip_fw_ctl_ptr
&& error
== 0)
410 error
= ip_fw_ctl_ptr(sopt
);
416 case IP_DUMMYNET_GET
:
418 error
= ip_dn_ctl_ptr(sopt
);
422 #endif /* DUMMYNET */
432 error
= ip_mrouter_get(so
, sopt
);
436 error
= ip_ctloutput(so
, sopt
);
442 switch (sopt
->sopt_name
) {
444 error
= sooptcopyin(sopt
, &optval
, sizeof optval
,
449 inp
->inp_flags
|= INP_HDRINCL
;
451 inp
->inp_flags
&= ~INP_HDRINCL
;
455 error
= sooptcopyin(sopt
, &optval
, sizeof optval
,
460 inp
->inp_flags
|= INP_STRIPHDR
;
462 inp
->inp_flags
&= ~INP_STRIPHDR
;
473 case IP_OLD_FW_FLUSH
:
475 case IP_OLD_FW_RESETLOG
:
476 if (ip_fw_ctl_ptr
== 0)
478 if (ip_fw_ctl_ptr
&& error
== 0)
479 error
= ip_fw_ctl_ptr(sopt
);
485 case IP_DUMMYNET_CONFIGURE
:
486 case IP_DUMMYNET_DEL
:
487 case IP_DUMMYNET_FLUSH
:
489 error
= ip_dn_ctl_ptr(sopt
);
491 error
= ENOPROTOOPT
;
496 error
= ip_rsvp_init(so
);
500 error
= ip_rsvp_done();
503 /* XXX - should be combined */
505 error
= ip_rsvp_vif_init(so
, sopt
);
508 case IP_RSVP_VIF_OFF
:
509 error
= ip_rsvp_vif_done(so
, sopt
);
520 error
= ip_mrouter_set(so
, sopt
);
524 error
= ip_ctloutput(so
, sopt
);
534 * This function exists solely to receive the PRC_IFDOWN messages which
535 * are sent by if_down(). It looks for an ifaddr whose ifa_addr is sa,
536 * and calls in_ifadown() to remove all routes corresponding to that address.
537 * It also receives the PRC_IFUP messages from if_up() and reinstalls the
541 rip_ctlinput(cmd
, sa
, vip
)
546 struct in_ifaddr
*ia
;
553 lck_mtx_lock(rt_mtx
);
554 for (ia
= in_ifaddrhead
.tqh_first
; ia
;
555 ia
= ia
->ia_link
.tqe_next
) {
556 if (ia
->ia_ifa
.ifa_addr
== sa
557 && (ia
->ia_flags
& IFA_ROUTE
)) {
559 * in_ifscrub kills the interface route.
561 in_ifscrub(ia
->ia_ifp
, ia
, 1);
563 * in_ifadown gets rid of all the rest of
564 * the routes. This is not quite the right
565 * thing to do, but at least if we are running
566 * a routing process they will come back.
568 in_ifadown(&ia
->ia_ifa
, 1);
572 lck_mtx_unlock(rt_mtx
);
576 lck_mtx_lock(rt_mtx
);
577 for (ia
= in_ifaddrhead
.tqh_first
; ia
;
578 ia
= ia
->ia_link
.tqe_next
) {
579 if (ia
->ia_ifa
.ifa_addr
== sa
)
582 if (ia
== 0 || (ia
->ia_flags
& IFA_ROUTE
)) {
583 lck_mtx_unlock(rt_mtx
);
587 ifp
= ia
->ia_ifa
.ifa_ifp
;
589 if ((ifp
->if_flags
& IFF_LOOPBACK
)
590 || (ifp
->if_flags
& IFF_POINTOPOINT
))
593 err
= rtinit_locked(&ia
->ia_ifa
, RTM_ADD
, flags
);
594 lck_mtx_unlock(rt_mtx
);
596 ia
->ia_flags
|= IFA_ROUTE
;
601 u_long rip_sendspace
= RIPSNDQ
;
602 u_long rip_recvspace
= RIPRCVQ
;
604 SYSCTL_INT(_net_inet_raw
, OID_AUTO
, maxdgram
, CTLFLAG_RW
,
605 &rip_sendspace
, 0, "Maximum outgoing raw IP datagram size");
606 SYSCTL_INT(_net_inet_raw
, OID_AUTO
, recvspace
, CTLFLAG_RW
,
607 &rip_recvspace
, 0, "Maximum incoming raw IP datagram size");
610 rip_attach(struct socket
*so
, int proto
, struct proc
*p
)
619 if ((so
->so_state
& SS_PRIV
) == 0)
622 if (p
&& (error
= suser(p
)) != 0)
626 error
= soreserve(so
, rip_sendspace
, rip_recvspace
);
630 error
= in_pcballoc(so
, &ripcbinfo
, p
);
634 inp
= (struct inpcb
*)so
->so_pcb
;
635 inp
->inp_vflag
|= INP_IPV4
;
636 inp
->inp_ip_p
= proto
;
637 inp
->inp_ip_ttl
= ip_defttl
;
641 __private_extern__
int
642 rip_detach(struct socket
*so
)
649 if (so
== ip_mrouter
)
651 ip_rsvp_force_done(so
);
658 __private_extern__
int
659 rip_abort(struct socket
*so
)
661 soisdisconnected(so
);
662 return rip_detach(so
);
665 __private_extern__
int
666 rip_disconnect(struct socket
*so
)
668 if ((so
->so_state
& SS_ISCONNECTED
) == 0)
670 return rip_abort(so
);
673 __private_extern__
int
674 rip_bind(struct socket
*so
, struct sockaddr
*nam
, struct proc
*p
)
676 struct inpcb
*inp
= sotoinpcb(so
);
677 struct sockaddr_in
*addr
= (struct sockaddr_in
*)nam
;
678 struct ifaddr
*ifa
= NULL
;
680 if (nam
->sa_len
!= sizeof(*addr
))
683 if (TAILQ_EMPTY(&ifnet_head
) || ((addr
->sin_family
!= AF_INET
) &&
684 (addr
->sin_family
!= AF_IMPLINK
)) ||
685 (addr
->sin_addr
.s_addr
&&
686 (ifa
= ifa_ifwithaddr((struct sockaddr
*)addr
)) == 0)) {
687 return EADDRNOTAVAIL
;
693 inp
->inp_laddr
= addr
->sin_addr
;
697 __private_extern__
int
698 rip_connect(struct socket
*so
, struct sockaddr
*nam
, struct proc
*p
)
700 struct inpcb
*inp
= sotoinpcb(so
);
701 struct sockaddr_in
*addr
= (struct sockaddr_in
*)nam
;
703 if (nam
->sa_len
!= sizeof(*addr
))
705 if (TAILQ_EMPTY(&ifnet_head
))
706 return EADDRNOTAVAIL
;
707 if ((addr
->sin_family
!= AF_INET
) &&
708 (addr
->sin_family
!= AF_IMPLINK
))
710 inp
->inp_faddr
= addr
->sin_addr
;
715 __private_extern__
int
716 rip_shutdown(struct socket
*so
)
722 __private_extern__
int
723 rip_send(struct socket
*so
, int flags
, struct mbuf
*m
, struct sockaddr
*nam
,
724 struct mbuf
*control
, struct proc
*p
)
726 struct inpcb
*inp
= sotoinpcb(so
);
729 if (so
->so_state
& SS_ISCONNECTED
) {
734 dst
= inp
->inp_faddr
.s_addr
;
740 dst
= ((struct sockaddr_in
*)nam
)->sin_addr
.s_addr
;
742 return rip_output(m
, so
, dst
);
745 /* note: rip_unlock is called from different protos instead of the generic socket_unlock,
746 * it will handle the socket dealloc on last reference
749 rip_unlock(struct socket
*so
, int refcount
, int debug
)
752 struct inpcb
*inp
= sotoinpcb(so
);
755 lr_saved
= (unsigned int) __builtin_return_address(0);
756 else lr_saved
= debug
;
759 if (so
->so_usecount
<= 0)
760 panic("rip_unlock: bad refoucnt so=%x val=%x\n", so
, so
->so_usecount
);
762 if (so
->so_usecount
== 0 && (inp
->inp_wantcnt
== WNT_STOPUSING
)) {
763 /* cleanup after last reference */
764 lck_mtx_unlock(so
->so_proto
->pr_domain
->dom_mtx
);
765 lck_rw_lock_exclusive(ripcbinfo
.mtx
);
767 lck_rw_done(ripcbinfo
.mtx
);
771 so
->unlock_lr
[so
->next_unlock_lr
] = (u_int
*)lr_saved
;
772 so
->next_unlock_lr
= (so
->next_unlock_lr
+1) % SO_LCKDBG_MAX
;
773 lck_mtx_unlock(so
->so_proto
->pr_domain
->dom_mtx
);
778 rip_pcblist SYSCTL_HANDLER_ARGS
781 struct inpcb
*inp
, **inp_list
;
786 * The process of preparing the TCB list is too time-consuming and
787 * resource-intensive to repeat twice on every request.
789 lck_rw_lock_exclusive(ripcbinfo
.mtx
);
790 if (req
->oldptr
== USER_ADDR_NULL
) {
791 n
= ripcbinfo
.ipi_count
;
792 req
->oldidx
= 2 * (sizeof xig
)
793 + (n
+ n
/8) * sizeof(struct xinpcb
);
794 lck_rw_done(ripcbinfo
.mtx
);
798 if (req
->newptr
!= USER_ADDR_NULL
) {
799 lck_rw_done(ripcbinfo
.mtx
);
804 * OK, now we're committed to doing something.
806 gencnt
= ripcbinfo
.ipi_gencnt
;
807 n
= ripcbinfo
.ipi_count
;
809 bzero(&xig
, sizeof(xig
));
810 xig
.xig_len
= sizeof xig
;
812 xig
.xig_gen
= gencnt
;
813 xig
.xig_sogen
= so_gencnt
;
814 error
= SYSCTL_OUT(req
, &xig
, sizeof xig
);
816 lck_rw_done(ripcbinfo
.mtx
);
820 * We are done if there is no pcb
823 lck_rw_done(ripcbinfo
.mtx
);
827 inp_list
= _MALLOC(n
* sizeof *inp_list
, M_TEMP
, M_WAITOK
);
829 lck_rw_done(ripcbinfo
.mtx
);
833 for (inp
= ripcbinfo
.listhead
->lh_first
, i
= 0; inp
&& i
< n
;
834 inp
= inp
->inp_list
.le_next
) {
835 if (inp
->inp_gencnt
<= gencnt
&& inp
->inp_state
!= INPCB_STATE_DEAD
)
841 for (i
= 0; i
< n
; i
++) {
843 if (inp
->inp_gencnt
<= gencnt
&& inp
->inp_state
!= INPCB_STATE_DEAD
) {
846 bzero(&xi
, sizeof(xi
));
847 xi
.xi_len
= sizeof xi
;
848 /* XXX should avoid extra copy */
849 inpcb_to_compat(inp
, &xi
.xi_inp
);
851 sotoxsocket(inp
->inp_socket
, &xi
.xi_socket
);
852 error
= SYSCTL_OUT(req
, &xi
, sizeof xi
);
857 * Give the user an updated idea of our state.
858 * If the generation differs from what we told
859 * her before, she knows that something happened
860 * while we were processing this request, and it
861 * might be necessary to retry.
863 bzero(&xig
, sizeof(xig
));
864 xig
.xig_len
= sizeof xig
;
865 xig
.xig_gen
= ripcbinfo
.ipi_gencnt
;
866 xig
.xig_sogen
= so_gencnt
;
867 xig
.xig_count
= ripcbinfo
.ipi_count
;
868 error
= SYSCTL_OUT(req
, &xig
, sizeof xig
);
870 FREE(inp_list
, M_TEMP
);
871 lck_rw_done(ripcbinfo
.mtx
);
875 SYSCTL_PROC(_net_inet_raw
, OID_AUTO
/*XXX*/, pcblist
, CTLFLAG_RD
, 0, 0,
876 rip_pcblist
, "S,xinpcb", "List of active raw IP sockets");
878 struct pr_usrreqs rip_usrreqs
= {
879 rip_abort
, pru_accept_notsupp
, rip_attach
, rip_bind
, rip_connect
,
880 pru_connect2_notsupp
, in_control
, rip_detach
, rip_disconnect
,
881 pru_listen_notsupp
, in_setpeeraddr
, pru_rcvd_notsupp
,
882 pru_rcvoob_notsupp
, rip_send
, pru_sense_null
, rip_shutdown
,
883 in_setsockaddr
, sosend
, soreceive
, pru_sopoll_notsupp