* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* This file attempts to centralize all the various variables that have
* a hand in controlling the operation of IP and its ULPs.
* IPFORWARDING controls whether the IP layer will forward packets received
* by us but not addressed to one of our addresses.
* IPSENDREDIRECTS controls whether the IP layer will send ICMP Redirect
* GATEWAY turns both of these on, and also allocates more memory for some
#define IPFORWARDING 1 /* forward IP packets not for us */
#define IPFORWARDING 0 /* don't forward IP packets not for us */
#endif /* not IPFORWARDING */
* NB: RFC 1122, ``Requirements for Internet Hosts: Communication Layers'',
* absolutely forbids hosts (which are not acting as gateways) from sending
#define IPSENDREDIRECTS 1
#define IPSENDREDIRECTS 0
#endif /* not IPSENDREDIRECTS */
int ipforwarding
= IPFORWARDING
;
int ipsendredirects
= IPSENDREDIRECTS
;
* ip_protox[] maps from IP protocol number to an index in inetsw[].
u_char ip_protox
[IPPROTO_MAX
];
* ipqmaxlen is the maximum length of the IP input queue.
* ipintrq is the queue itself.
int ipqmaxlen
= IFQ_MAXLEN
;
* the IP reassembly queue
* in_ifaddr points to a linked list of IP interface addresses, managed
struct in_ifaddr
*in_ifaddr
; /* first inet address */
* statistics for netstat and management
* ip_id is the next IP packet id number to be assigned (used in fragmentation
* When acting as a gateway, the IP layer keeps track of how many packets
* are forwarded for each (in-ifp, out-ifp) pair. This code needs to get
* updated or junked now that interfaces can come and go like the wind.
* ipaddr is a sockaddr_in used by various bits of code when they
* need to convert a `struct in_addr' to a `struct sockaddr_in'.
* ipforward_rt is a route used when forwarding packets. It functions
* as a route cache of order one, if you want to think of it that way.
struct sockaddr_in ipaddr
= { sizeof(ipaddr
), AF_INET
};
struct route ipforward_rt
;
* inetctlerrmap[] maps control input commands to errno values. 0 means
u_char inetctlerrmap
[PRC_NCMDS
] = {
EHOSTDOWN
, /* hostdead */
EHOSTUNREACH
, /* hostunreach */
EHOSTUNREACH
, /* unreachnet */
EHOSTUNREACH
, /* unreachhost */
ECONNREFUSED
, /* unreachproto */
ECONNREFUSED
, /* unreachport */
EMSGSIZE
, /* old needfrag */
EHOSTUNREACH
, /* srcfail */
EHOSTUNREACH
, /* netunknown */
EHOSTUNREACH
, /* hostunknown */
EHOSTUNREACH
, /* isolated */
ECONNREFUSED
, /* net admin. prohibited */
ECONNREFUSED
, /* host admin. prohibited */
EHOSTUNREACH
, /* tos net unreachable */
EHOSTUNREACH
, /* tos host unreachable */
0, /* redirect toshost */
0, /* reassembly timeout */
ENOPROTOOPT
, /* parameter problem */
ENOPROTOOPT
, /* required option missing */
/* NB: this means that this error will only
get propagated by in_mtunotify(), which
doesn't bother to check. */
* SUBNETSARELOCAL determines where IP subnets are considered to be ``local''
* or not. This option is obsolete.
#define SUBNETSARELOCAL 1
int subnetsarelocal
= SUBNETSARELOCAL
;
* MTUTIMER1 is the number of minutes to wait after having incremented
* the MTU estimate before trying again. MTUTIMER2 is the number
* of minutes to wait after having decremented the MTU estimate
* before trying to increment it.
int in_mtutimer1
= MTUTIMER1
;
int in_mtutimer2
= MTUTIMER2
;
* and a zero in_addr to make some code happy...
struct in_addr zeroin_addr
;
* ICMPPRINTFS enables some debugging printfs in ip_icmp.c.
* IPBROADCASTECHO controls whether ICMP Echo Reply packets are sent
* in response to ICMP Echo packets which were addressed to a multicast
* IPMASKAGENT controls whether ICMP Mask Reply packets are sent.
* It should only be enabled on the machine which is the authoritative
* mask agent for a subnet.
#define IPBROADCASTECHO 0
int ipbroadcastecho
= IPBROADCASTECHO
;
int ipmaskagent
= IPMASKAGENT
;
struct icmpstat icmpstat
;
* Yet Another sockaddr_in filled in by various routines when convenient.
struct sockaddr_in icmpmask
= { 8, 0 };
* Print out TCP debugging messages on the console.
* tcp_ttl is the default IP TTL for TCP segments.
* tcp_mssdflt is the default max segment size.
* tcp_rttdflt is the initial round trip time estimate when there is no RTT
int tcp_mssdflt
= TCP_MSS
;
int tcp_rttdflt
= TCPTV_SRTTDFLT
/ PR_SLOWHZ
;
* When KPROF is defined (god only knows why), TCP keeps track of
* protocol requests in this matrix.
int tcp_acounts
[TCP_NSTATES
][PRU_NREQ
];
* tcp_keepidle is the a fraction of the length of non-response time in a
* in a keepalive situation after which TCP abandons the connection.
* tcp_keepintvl is the interval between keepalives.
* tcp_maxidle is the time after which a connection will be dropped in
* certain states. It is computed as `TCPTV_KEEPCNT * tcp_keepintvl'.
int tcp_keepidle
= TCPTV_KEEP_IDLE
;
int tcp_keepintvl
= TCPTV_KEEPINTVL
;
* tcp_sendspace and tcp_recvspace are the default send and receive window
* sizes, respectively. These are obsolescent (this information should
u_long tcp_sendspace
= 1024*4;
u_long tcp_recvspace
= 1024*4;
u_long tcp_sendspace
= 1024*16;
u_long tcp_recvspace
= 1024*16;
#endif /* TCP_SMALLSPACE */
* udpcksum tells whether to do UDP checksums. It should always be
* turned on, except as required for compatibility with ancient
* 4.2-based systems like SunOS 3.5 and Ultrix 2.0.
int udpcksum
= 0; /* XXX */
* udp_ttl is the default IP TTL for UDP packets.
* UDP statistics for netstat.
* udp_sendspace is the maximum datagram size the UDP layer is willing to
* udp_recvspace is the amount of buffer space the UDP layer will
* reserve for holding received packets.
u_long udp_sendspace
= 9216; /* really max datagram size */
u_long udp_recvspace
= 40 * (1024 + sizeof(struct sockaddr_in
));