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 --- 17 unchanged lines hidden (view full) --- 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 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
34 * $Id: ip_input.c,v 1.117 1999/04/20 13:32:05 peter Exp $ |
35 */ 36 37#define _IP_VHL 38 39#include "opt_bootp.h" 40#include "opt_ipfw.h" 41#include "opt_ipdn.h" 42#include "opt_ipdivert.h" --- 37 unchanged lines hidden (view full) --- 80#endif 81 82int rsvp_on = 0; 83static int ip_rsvp_on; 84struct socket *ip_rsvpd; 85 86int ipforwarding = 0; 87SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, |
88 &ipforwarding, 0, "Enable IP forwarding between interfaces"); |
89 90static int ipsendredirects = 1; /* XXX */ 91SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW, |
92 &ipsendredirects, 0, "Enable sending IP redirects"); |
93 94int ip_defttl = IPDEFTTL; 95SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW, |
96 &ip_defttl, 0, "Maximum TTL on IP packets"); |
97 98static int ip_dosourceroute = 0; 99SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, |
100 &ip_dosourceroute, 0, "Enable forwarding source routed IP packets"); |
101 102static int ip_acceptsourceroute = 0; |
103SYSCTL_INT(_net_inet_ip, IPCTL_ACCEPTSOURCEROUTE, accept_sourceroute, 104 CTLFLAG_RW, &ip_acceptsourceroute, 0, 105 "Enable accepting source routed IP packets"); |
106#ifdef DIAGNOSTIC 107static int ipprintfs = 0; 108#endif 109 110extern struct domain inetdomain; 111extern struct protosw inetsw[]; 112u_char ip_protox[IPPROTO_MAX]; 113static int ipqmaxlen = IFQ_MAXLEN; 114struct in_ifaddrhead in_ifaddrhead; /* first inet address */ 115struct ifqueue ipintrq; 116SYSCTL_INT(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, CTLFLAG_RD, |
117 &ipintrq.ifq_maxlen, 0, "Maximum size of the IP input queue"); |
118SYSCTL_INT(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, CTLFLAG_RD, |
119 &ipintrq.ifq_drops, 0, "Number of packets dropped from the IP input queue"); |
120 121struct ipstat ipstat; 122SYSCTL_STRUCT(_net_inet_ip, IPCTL_STATS, stats, CTLFLAG_RD, |
123 &ipstat, ipstat, "IP statistics (struct ipstat, netinet/ip_var.h)"); |
124 125/* Packet reassembly stuff */ 126#define IPREASS_NHASH_LOG2 6 127#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2) 128#define IPREASS_HMASK (IPREASS_NHASH - 1) 129#define IPREASS_HASH(x,y) \ 130 (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK) 131 132static struct ipq ipq[IPREASS_NHASH]; 133static int nipq = 0; /* total # of reass queues */ 134static int maxnipq; 135 136#ifdef IPCTL_DEFMTU 137SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, |
138 &ip_mtu, 0, "Default MTU"); |
139#endif 140 141#ifdef IPSTEALTH 142static int ipstealth = 0; 143SYSCTL_INT(_net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW, 144 &ipstealth, 0, ""); 145#endif 146 --- 1486 unchanged lines hidden --- |