ip_divert.c (34923) | ip_divert.c (36079) |
---|---|
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 --- 16 unchanged lines hidden (view full) --- 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 * | 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 --- 16 unchanged lines hidden (view full) --- 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 * $Id: ip_divert.c,v 1.21 1998/03/24 18:06:15 wollman Exp $ | 33 * $Id: ip_divert.c,v 1.22 1998/03/28 10:18:23 bde Exp $ |
34 */ 35 36#include "opt_inet.h" 37 38#ifndef INET | 34 */ 35 36#include "opt_inet.h" 37 38#ifndef INET |
39#error IPDIVERT requires INET. | 39#error "IPDIVERT requires INET." |
40#endif 41 42#include <sys/param.h> 43#include <sys/malloc.h> 44#include <sys/mbuf.h> 45#include <sys/socket.h> 46#include <sys/protosw.h> 47#include <sys/socketvar.h> --- 66 unchanged lines hidden (view full) --- 114 /* 115 * XXX We don't use the hash list for divert IP, but it's easier 116 * to allocate a one entry hash list than it is to check all 117 * over the place for hashbase == NULL. 118 */ 119 divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask); 120 divcbinfo.porthashbase = hashinit(1, M_PCB, &divcbinfo.porthashmask); 121 divcbinfo.ipi_zone = zinit("divcb", sizeof(struct inpcb), | 40#endif 41 42#include <sys/param.h> 43#include <sys/malloc.h> 44#include <sys/mbuf.h> 45#include <sys/socket.h> 46#include <sys/protosw.h> 47#include <sys/socketvar.h> --- 66 unchanged lines hidden (view full) --- 114 /* 115 * XXX We don't use the hash list for divert IP, but it's easier 116 * to allocate a one entry hash list than it is to check all 117 * over the place for hashbase == NULL. 118 */ 119 divcbinfo.hashbase = hashinit(1, M_PCB, &divcbinfo.hashmask); 120 divcbinfo.porthashbase = hashinit(1, M_PCB, &divcbinfo.porthashmask); 121 divcbinfo.ipi_zone = zinit("divcb", sizeof(struct inpcb), |
122 nmbclusters / 4, ZONE_INTERRUPT, 0); | 122 maxsockets, ZONE_INTERRUPT, 0); |
123} 124 125/* 126 * Setup generic address and protocol structures 127 * for div_input routine, then pass them along with 128 * mbuf chain. ip->ip_len is assumed to have had 129 * the header length (hlen) subtracted out already. 130 * We tell whether the packet was incoming or outgoing --- 248 unchanged lines hidden --- | 123} 124 125/* 126 * Setup generic address and protocol structures 127 * for div_input routine, then pass them along with 128 * mbuf chain. ip->ip_len is assumed to have had 129 * the header length (hlen) subtracted out already. 130 * We tell whether the packet was incoming or outgoing --- 248 unchanged lines hidden --- |