udp_usrreq.c (157374) | udp_usrreq.c (157927) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 |
30 * $FreeBSD: head/sys/netinet/udp_usrreq.c 157374 2006-04-01 16:20:54Z rwatson $ | 30 * $FreeBSD: head/sys/netinet/udp_usrreq.c 157927 2006-04-21 09:25:40Z ps $ |
31 */ 32 33#include "opt_ipfw.h" 34#include "opt_ipsec.h" 35#include "opt_inet6.h" 36#include "opt_mac.h" 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/domain.h> | 31 */ 32 33#include "opt_ipfw.h" 34#include "opt_ipsec.h" 35#include "opt_inet6.h" 36#include "opt_mac.h" 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/domain.h> |
41#include <sys/eventhandler.h> |
|
41#include <sys/jail.h> 42#include <sys/kernel.h> 43#include <sys/lock.h> 44#include <sys/mac.h> 45#include <sys/malloc.h> 46#include <sys/mbuf.h> 47#include <sys/proc.h> 48#include <sys/protosw.h> --- 75 unchanged lines hidden (view full) --- 124 125static void udp_append(struct inpcb *last, struct ip *ip, struct mbuf *n, 126 int off, struct sockaddr_in *udp_in); 127 128static void udp_detach(struct socket *so); 129static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, 130 struct mbuf *, struct thread *); 131 | 42#include <sys/jail.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> --- 75 unchanged lines hidden (view full) --- 125 126static void udp_append(struct inpcb *last, struct ip *ip, struct mbuf *n, 127 int off, struct sockaddr_in *udp_in); 128 129static void udp_detach(struct socket *so); 130static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, 131 struct mbuf *, struct thread *); 132 |
133static void 134udp_zone_change(void *tag) 135{ 136 137 uma_zone_set_max(udbinfo.ipi_zone, maxsockets); 138} 139 |
|
132void 133udp_init() 134{ 135 INP_INFO_LOCK_INIT(&udbinfo, "udp"); 136 LIST_INIT(&udb); 137 udbinfo.listhead = &udb; 138 udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask); 139 udbinfo.porthashbase = hashinit(UDBHASHSIZE, M_PCB, 140 &udbinfo.porthashmask); 141 udbinfo.ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL, 142 NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); 143 uma_zone_set_max(udbinfo.ipi_zone, maxsockets); | 140void 141udp_init() 142{ 143 INP_INFO_LOCK_INIT(&udbinfo, "udp"); 144 LIST_INIT(&udb); 145 udbinfo.listhead = &udb; 146 udbinfo.hashbase = hashinit(UDBHASHSIZE, M_PCB, &udbinfo.hashmask); 147 udbinfo.porthashbase = hashinit(UDBHASHSIZE, M_PCB, 148 &udbinfo.porthashmask); 149 udbinfo.ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL, 150 NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); 151 uma_zone_set_max(udbinfo.ipi_zone, maxsockets); |
152 EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL, 153 EVENTHANDLER_PRI_ANY); |
|
144} 145 146void 147udp_input(m, off) 148 register struct mbuf *m; 149 int off; 150{ 151 int iphlen = off; --- 963 unchanged lines hidden --- | 154} 155 156void 157udp_input(m, off) 158 register struct mbuf *m; 159 int off; 160{ 161 int iphlen = off; --- 963 unchanged lines hidden --- |