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 --- 16 unchanged lines hidden (view full) --- 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 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_subr.c 215701 2010-11-22 19:32:54Z dim $"); |
34 35#include "opt_compat.h" 36#include "opt_inet.h" 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_tcpdebug.h" 40 41#include <sys/param.h> --- 146 unchanged lines hidden (view full) --- 188 189static int do_tcpdrain = 1; 190SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_tcpdrain, CTLFLAG_RW, &do_tcpdrain, 0, 191 "Enable tcp_drain routine for extra help when low on mbufs"); 192 193SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_RD, 194 &VNET_NAME(tcbinfo.ipi_count), 0, "Number of active PCBs"); 195 |
196static VNET_DEFINE(int, icmp_may_rst) = 1; |
197#define V_icmp_may_rst VNET(icmp_may_rst) 198SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_RW, 199 &VNET_NAME(icmp_may_rst), 0, 200 "Certain ICMP unreachable messages may abort connections in SYN_SENT"); 201 |
202static VNET_DEFINE(int, tcp_isn_reseed_interval) = 0; |
203#define V_tcp_isn_reseed_interval VNET(tcp_isn_reseed_interval) 204SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW, 205 &VNET_NAME(tcp_isn_reseed_interval), 0, 206 "Seconds between reseeding of ISN secret"); 207 208#ifdef TCP_SORECEIVE_STREAM 209static int tcp_soreceive_stream = 0; 210SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, --- 25 unchanged lines hidden (view full) --- 236 * parsing purposes, which do not know about callouts. 237 */ 238struct tcpcb_mem { 239 struct tcpcb tcb; 240 struct tcp_timer tt; 241 struct cc_var ccv; 242}; 243 |
244static VNET_DEFINE(uma_zone_t, tcpcb_zone); |
245#define V_tcpcb_zone VNET(tcpcb_zone) 246 247MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); 248struct callout isn_callout; 249static struct mtx isn_mtx; 250 251#define ISN_LOCK_INIT() mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF) 252#define ISN_LOCK() mtx_lock(&isn_mtx) --- 1256 unchanged lines hidden (view full) --- 1509 * isn_offset_old, and isn_ctx is performed using the TCP pcbinfo lock. In 1510 * general, this means holding an exclusive (write) lock. 1511 */ 1512 1513#define ISN_BYTES_PER_SECOND 1048576 1514#define ISN_STATIC_INCREMENT 4096 1515#define ISN_RANDOM_INCREMENT (4096 - 1) 1516 |
1517static VNET_DEFINE(u_char, isn_secret[32]); 1518static VNET_DEFINE(int, isn_last_reseed); 1519static VNET_DEFINE(u_int32_t, isn_offset); 1520static VNET_DEFINE(u_int32_t, isn_offset_old); |
1521 1522#define V_isn_secret VNET(isn_secret) 1523#define V_isn_last_reseed VNET(isn_last_reseed) 1524#define V_isn_offset VNET(isn_offset) 1525#define V_isn_offset_old VNET(isn_offset_old) 1526 1527tcp_seq 1528tcp_new_isn(struct tcpcb *tp) --- 678 unchanged lines hidden --- |