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