FreeBSD kernel IPv4 code
tcp_subr.c File Reference
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_kern_tls.h"
#include "opt_tcpdebug.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/arb.h>
#include <sys/callout.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/qmath.h>
#include <sys/stats.h>
#include <sys/sysctl.h>
#include <sys/jail.h>
#include <sys/malloc.h>
#include <sys/refcount.h>
#include <sys/mbuf.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/sdt.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/protosw.h>
#include <sys/random.h>
#include <vm/uma.h>
#include <net/route.h>
#include <net/route/nhop.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/in_fib.h>
#include <netinet/in_kdtrace.h>
#include <netinet/in_pcb.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_var.h>
#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcp_log_buf.h>
#include <netinet/tcp_syncache.h>
#include <netinet/tcp_hpts.h>
#include <netinet/cc/cc.h>
#include <netinet/tcpip.h>
#include <netinet/tcp_fastopen.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netipsec/ipsec_support.h>
#include <machine/in_cksum.h>
#include <crypto/siphash/siphash.h>
#include <security/mac/mac_framework.h>

Go to the source code of this file.

Data Structures

struct  tcpcb_mem
 

Macros

#define V_icmp_may_rst   VNET(icmp_may_rst)
 
#define V_tcp_isn_reseed_interval   VNET(tcp_isn_reseed_interval)
 
#define V_sack_hole_zone   VNET(sack_hole_zone)
 
#define TS_OFFSET_SECRET_LENGTH   SIPHASH_KEY_LENGTH
 
#define V_ts_offset_secret   VNET(ts_offset_secret)
 
#define TCBHASHSIZE   0
 
#define V_tcpcb_zone   VNET(tcpcb_zone)
 
#define ISN_LOCK_INIT()   mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF)
 
#define ISN_LOCK()   mtx_lock(&isn_mtx)
 
#define ISN_UNLOCK()   mtx_unlock(&isn_mtx)
 
#define TCP_MINPROTOHDR   (sizeof(struct tcpiphdr))
 
#define xchg(a, b, type)   { type t; t=a; a=b; b=t; }
 
#define ISN_BYTES_PER_SECOND   1048576
 
#define ISN_STATIC_INCREMENT   4096
 
#define ISN_RANDOM_INCREMENT   (4096 - 1)
 
#define ISN_SECRET_LENGTH   SIPHASH_KEY_LENGTH
 
#define V_isn_secret   VNET(isn_secret)
 
#define V_isn_last   VNET(isn_last)
 
#define V_isn_last_reseed   VNET(isn_last_reseed)
 
#define V_isn_offset   VNET(isn_offset)
 
#define V_isn_offset_old   VNET(isn_offset_old)
 
#define PAD(len)   ((((len) / 4) + !!((len) % 4)) * 4)
 
#define COPYTIMER(ttt)
 

Functions

 __FBSDID ("$FreeBSD$")
 
 VNET_DEFINE (int, tcp_mssdflt)
 
 SYSCTL_UINT (_net_inet_tcp, OID_AUTO, ack_war_timewindow, CTLFLAG_RW, &tcp_ack_war_time_window, 1000, "If the tcp_stack does ack-war prevention how many milliseconds are in its time window?")
 
 SYSCTL_UINT (_net_inet_tcp, OID_AUTO, ack_war_cnt, CTLFLAG_RW, &tcp_ack_war_cnt, 5, "If the tcp_stack does ack-war prevention how many acks can be sent in its time window?")
 
static int sysctl_net_inet_tcp_mss_check (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_mssdflt), 0, &sysctl_net_inet_tcp_mss_check, "I", "Default TCP Maximum Segment Size")
 
 VNET_DEFINE (int, tcp_minmss)
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, minmss, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_minmss), 0, "Minimum TCP Maximum Segment Size")
 
 VNET_DEFINE (int, tcp_do_rfc1323)
 
 SYSCTL_INT (_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_rfc1323), 0, "Enable rfc1323 (high performance TCP) extensions")
 
 VNET_DEFINE (int, tcp_tolerate_missing_ts)
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, tolerate_missing_ts, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_tolerate_missing_ts), 0, "Tolerate missing TCP timestamps")
 
 VNET_DEFINE (int, tcp_ts_offset_per_conn)
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, ts_offset_per_conn, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_ts_offset_per_conn), 0, "Initialize TCP timestamps per connection instead of per host pair")
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, pacing_limit, CTLFLAG_RW, &tcp_pacing_limit, 1000, "If the TCP stack does pacing, is there a limit (-1 = no, 0 = no pacing N = number of connections)")
 
 SYSCTL_UINT (_net_inet_tcp, OID_AUTO, pacing_count, CTLFLAG_RD, &shadow_num_connections, 0, "Number of TCP connections being paced")
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, &tcp_log_debug, 0, "Log errors caused by incoming TCP segments")
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable")
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, do_tcpdrain, CTLFLAG_RW, &do_tcpdrain, 0, "Enable tcp_drain routine for extra help when low on mbufs")
 
 SYSCTL_UINT (_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_VNET|CTLFLAG_RD, &VNET_NAME(tcbinfo.ipi_count), 0, "Number of active PCBs")
 
 VNET_DEFINE_STATIC (int, icmp_may_rst)
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(icmp_may_rst), 0, "Certain ICMP unreachable messages may abort connections in SYN_SENT")
 
 VNET_DEFINE_STATIC (int, tcp_isn_reseed_interval)=0
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_isn_reseed_interval), 0, "Seconds between reseeding of ISN secret")
 
 SYSCTL_INT (_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, &tcp_soreceive_stream, 0, "Using soreceive_stream for TCP sockets")
 
 VNET_DEFINE (uma_zone_t, sack_hole_zone)
 
 VNET_DEFINE (uint32_t, tcp_map_entries_limit)=0
 
static int sysctl_net_inet_tcp_map_limit_check (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, map_limit, CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_map_entries_limit), 0, &sysctl_net_inet_tcp_map_limit_check, "IU", "Total sendmap entries limit")
 
 VNET_DEFINE (uint32_t, tcp_map_split_limit)=0
 
 SYSCTL_UINT (_net_inet_tcp, OID_AUTO, split_limit, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_map_split_limit), 0, "Total sendmap split entries limit")
 
 VNET_DEFINE_STATIC (u_char, ts_offset_secret[TS_OFFSET_SECRET_LENGTH])
 
static int tcp_default_fb_init (struct tcpcb *tp)
 
static void tcp_default_fb_fini (struct tcpcb *tp, int tcb_is_purged)
 
static int tcp_default_handoff_ok (struct tcpcb *tp)
 
static struct inpcbtcp_notify (struct inpcb *, int)
 
static struct inpcbtcp_mtudisc_notify (struct inpcb *, int)
 
static struct inpcbtcp_mtudisc (struct inpcb *, int)
 
static char * tcp_log_addr (struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr)
 
void tcp_record_dsack (struct tcpcb *tp, tcp_seq start, tcp_seq end, int tlp)
 
static struct tcp_function_blockfind_tcp_functions_locked (struct tcp_function_set *fs)
 
static struct tcp_function_blockfind_tcp_fb_locked (struct tcp_function_block *blk, struct tcp_function **s)
 
struct tcp_function_blockfind_and_ref_tcp_functions (struct tcp_function_set *fs)
 
struct tcp_function_blockfind_and_ref_tcp_fb (struct tcp_function_block *blk)
 
int find_tcp_function_alias (struct tcp_function_block *blk, struct tcp_function_set *fs)
 
static struct tcp_function_blockfind_and_ref_tcp_default_fb (void)
 
void tcp_switch_back_to_default (struct tcpcb *tp)
 
static void tcp_recv_udp_tunneled_packet (struct mbuf *m, int off, struct inpcb *inp, const struct sockaddr *sa, void *ctx)
 
static int sysctl_net_inet_default_tcp_functions (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, functions_default, CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_NEEDGIANT, NULL, 0, sysctl_net_inet_default_tcp_functions, "A", "Set/get the default TCP functions")
 
static int sysctl_net_inet_list_available (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, functions_available, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_NEEDGIANT, NULL, 0, sysctl_net_inet_list_available, "A", "list available TCP Function sets")
 
 VNET_DEFINE (int, tcp_udp_tunneling_port)
 
static void tcp_over_udp_stop (void)
 
static int tcp_over_udp_start (void)
 
static int sysctl_net_inet_tcp_udp_tunneling_port_check (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, udp_tunneling_port, CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, &VNET_NAME(tcp_udp_tunneling_port), 0, &sysctl_net_inet_tcp_udp_tunneling_port_check, "IU", "Tunneling port for tcp over udp")
 
 VNET_DEFINE (int, tcp_udp_tunneling_overhead)
 
static int sysctl_net_inet_tcp_udp_tunneling_overhead_check (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, udp_tunneling_overhead, CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, &VNET_NAME(tcp_udp_tunneling_overhead), 0, &sysctl_net_inet_tcp_udp_tunneling_overhead_check, "IU", "MSS reduction when using tcp over udp")
 
static int sysctl_net_inet_list_func_info (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, function_info, CTLTYPE_OPAQUE|CTLFLAG_SKIP|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_net_inet_list_func_info, "S,tcp_function_info", "List TCP function block name-to-ID mappings")
 
 VNET_DEFINE_STATIC (uma_zone_t, tcpcb_zone)
 
 MALLOC_DEFINE (M_TCPLOG, "tcplog", "TCP address and flags print buffers")
 
 MALLOC_DEFINE (M_TCPFUNCTIONS, "tcpfunc", "TCP function set memory")
 
 INPCBSTORAGE_DEFINE (tcpcbstor, "tcpinp", "tcp_inpcb", "tcp", "tcphash")
 
static int maketcp_hashsize (int size)
 
int register_tcp_functions_as_names (struct tcp_function_block *blk, int wait, const char *names[], int *num_names)
 
int register_tcp_functions_as_name (struct tcp_function_block *blk, const char *name, int wait)
 
int register_tcp_functions (struct tcp_function_block *blk, int wait)
 
int deregister_tcp_functions (struct tcp_function_block *blk, bool quiesce, bool force)
 
static void tcp_vnet_init (void *arg __unused)
 
 VNET_SYSINIT (tcp_vnet_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, tcp_vnet_init, NULL)
 
static void tcp_init (void *arg __unused)
 
 SYSINIT (tcp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, tcp_init, NULL)
 
void tcp_fini (void *xtp)
 
void tcpip_fillheaders (struct inpcb *inp, uint16_t port, void *ip_ptr, void *tcp_ptr)
 
struct tcptemptcpip_maketemplate (struct inpcb *inp)
 
void tcp_respond (struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags)
 
struct tcpcbtcp_newtcpcb (struct inpcb *inp)
 
struct tcpcbtcp_drop (struct tcpcb *tp, int errno)
 
void tcp_discardcb (struct tcpcb *tp)
 
bool tcp_freecb (struct tcpcb *tp)
 
struct tcpcbtcp_close (struct tcpcb *tp)
 
void tcp_drain (void)
 
static int tcp_pcblist (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, TCPCTL_PCBLIST, pcblist, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_NEEDGIANT, NULL, 0, tcp_pcblist, "S,xtcpcb", "List of active TCP connections")
 
static uint32_t tcp_keyed_hash (struct in_conninfo *inc, u_char *key, u_int len)
 
uint32_t tcp_new_ts_offset (struct in_conninfo *inc)
 
 VNET_DEFINE_STATIC (u_char, isn_secret[ISN_SECRET_LENGTH])
 
 VNET_DEFINE_STATIC (int, isn_last)
 
 VNET_DEFINE_STATIC (int, isn_last_reseed)
 
 VNET_DEFINE_STATIC (u_int32_t, isn_offset)
 
 VNET_DEFINE_STATIC (u_int32_t, isn_offset_old)
 
tcp_seq tcp_new_isn (struct in_conninfo *inc)
 
struct inpcbtcp_drop_syn_sent (struct inpcb *inp, int errno)
 
u_int tcp_maxseg (const struct tcpcb *tp)
 
u_int tcp_fixed_maxseg (const struct tcpcb *tp)
 
static int sysctl_drop (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, TCPCTL_DROP, drop, CTLFLAG_VNET|CTLTYPE_STRUCT|CTLFLAG_WR|CTLFLAG_SKIP|CTLFLAG_NEEDGIANT, NULL, 0, sysctl_drop, "", "Drop TCP connection")
 
static int tcp_sysctl_setsockopt (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_inet_tcp, OID_AUTO, setsockopt, CTLFLAG_VNET|CTLTYPE_STRUCT|CTLFLAG_WR|CTLFLAG_SKIP|CTLFLAG_MPSAFE, NULL, 0, tcp_sysctl_setsockopt, "", "Set socket option for TCP endpoint")
 
char * tcp_log_vain (struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr)
 
char * tcp_log_addrs (struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr)
 
void tcp_state_change (struct tcpcb *tp, int newstate)
 
void tcp_inptoxtp (const struct inpcb *inp, struct xtcpcb *xt)
 
void tcp_log_end_status (struct tcpcb *tp, uint8_t status)
 
int tcp_can_enable_pacing (void)
 
void tcp_decrement_paced_conn (void)
 

Variables

uint32_t tcp_ack_war_time_window = 1000
 
uint32_t tcp_ack_war_cnt = 5
 
struct rwlock tcp_function_lock
 
static volatile uint32_t number_of_tcp_connections_pacing = 0
 
static uint32_t shadow_num_connections = 0
 
static int tcp_pacing_limit = 10000
 
static int tcp_log_debug = 0
 
static int tcp_tcbhashsize
 
static int do_tcpdrain = 1
 
static int tcp_soreceive_stream
 
static struct tcp_function_block tcp_def_funcblk
 
static int tcp_fb_cnt = 0
 
struct tcp_funchead t_functions
 
static struct tcp_function_blocktcp_func_set_ptr = &tcp_def_funcblk
 
static struct mtx isn_mtx
 
static volatile int next_tcp_stack_id = 1
 
static uint8_t tcp_pacing_warning = 0
 

Macro Definition Documentation

◆ COPYTIMER

#define COPYTIMER (   ttt)
Value:
do { \
if (callout_active(&tp->t_timers->ttt)) \
xt->ttt = (tp->t_timers->ttt.c_time - now) / \
SBT_1MS; \
else \
xt->ttt = 0; \
} while (0)

◆ ISN_BYTES_PER_SECOND

#define ISN_BYTES_PER_SECOND   1048576

Definition at line 3280 of file tcp_subr.c.

◆ ISN_LOCK

#define ISN_LOCK ( )    mtx_lock(&isn_mtx)

Definition at line 1146 of file tcp_subr.c.

◆ ISN_LOCK_INIT

#define ISN_LOCK_INIT ( )    mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF)

Definition at line 1145 of file tcp_subr.c.

◆ ISN_RANDOM_INCREMENT

#define ISN_RANDOM_INCREMENT   (4096 - 1)

Definition at line 3282 of file tcp_subr.c.

◆ ISN_SECRET_LENGTH

#define ISN_SECRET_LENGTH   SIPHASH_KEY_LENGTH

Definition at line 3283 of file tcp_subr.c.

◆ ISN_STATIC_INCREMENT

#define ISN_STATIC_INCREMENT   4096

Definition at line 3281 of file tcp_subr.c.

◆ ISN_UNLOCK

#define ISN_UNLOCK ( )    mtx_unlock(&isn_mtx)

Definition at line 1147 of file tcp_subr.c.

◆ PAD

#define PAD (   len)    ((((len) / 4) + !!((len) % 4)) * 4)

◆ TCBHASHSIZE

#define TCBHASHSIZE   0

Definition at line 1119 of file tcp_subr.c.

◆ TCP_MINPROTOHDR

#define TCP_MINPROTOHDR   (sizeof(struct tcpiphdr))

◆ TS_OFFSET_SECRET_LENGTH

#define TS_OFFSET_SECRET_LENGTH   SIPHASH_KEY_LENGTH

Definition at line 369 of file tcp_subr.c.

◆ V_icmp_may_rst

#define V_icmp_may_rst   VNET(icmp_may_rst)

Definition at line 319 of file tcp_subr.c.

◆ V_isn_last

#define V_isn_last   VNET(isn_last)

Definition at line 3292 of file tcp_subr.c.

◆ V_isn_last_reseed

#define V_isn_last_reseed   VNET(isn_last_reseed)

Definition at line 3293 of file tcp_subr.c.

◆ V_isn_offset

#define V_isn_offset   VNET(isn_offset)

Definition at line 3294 of file tcp_subr.c.

◆ V_isn_offset_old

#define V_isn_offset_old   VNET(isn_offset_old)

Definition at line 3295 of file tcp_subr.c.

◆ V_isn_secret

#define V_isn_secret   VNET(isn_secret)

Definition at line 3291 of file tcp_subr.c.

◆ V_sack_hole_zone

#define V_sack_hole_zone   VNET(sack_hole_zone)

Definition at line 335 of file tcp_subr.c.

◆ V_tcp_isn_reseed_interval

#define V_tcp_isn_reseed_interval   VNET(tcp_isn_reseed_interval)

Definition at line 325 of file tcp_subr.c.

◆ V_tcpcb_zone

#define V_tcpcb_zone   VNET(tcpcb_zone)

Definition at line 1138 of file tcp_subr.c.

◆ V_ts_offset_secret

#define V_ts_offset_secret   VNET(ts_offset_secret)

Definition at line 371 of file tcp_subr.c.

◆ xchg

#define xchg (   a,
  b,
  type 
)    { type t; t=a; a=b; b=t; }

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ deregister_tcp_functions()

int deregister_tcp_functions ( struct tcp_function_block blk,
bool  quiesce,
bool  force 
)

◆ find_and_ref_tcp_default_fb()

static struct tcp_function_block * find_and_ref_tcp_default_fb ( void  )
static

Definition at line 511 of file tcp_subr.c.

References tcp_func_set_ptr, tcp_function_lock, and tcp_function_block::tfb_refcnt.

Referenced by tcp_switch_back_to_default().

Here is the caller graph for this function:

◆ find_and_ref_tcp_fb()

struct tcp_function_block * find_and_ref_tcp_fb ( struct tcp_function_block blk)

Definition at line 467 of file tcp_subr.c.

References find_tcp_fb_locked(), tcp_function_lock, and tcp_function_block::tfb_refcnt.

Referenced by syncache_socket(), and tcp_switch_back_to_default().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_and_ref_tcp_functions()

struct tcp_function_block * find_and_ref_tcp_functions ( struct tcp_function_set fs)

Definition at line 454 of file tcp_subr.c.

References find_tcp_functions_locked(), tcp_function_lock, and tcp_function_block::tfb_refcnt.

Referenced by tcp_ctloutput_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_tcp_fb_locked()

static struct tcp_function_block * find_tcp_fb_locked ( struct tcp_function_block blk,
struct tcp_function **  s 
)
static

Definition at line 436 of file tcp_subr.c.

References t_functions, and tcp_function::tf_fb.

Referenced by deregister_tcp_functions(), find_and_ref_tcp_fb(), and sysctl_net_inet_default_tcp_functions().

Here is the caller graph for this function:

◆ find_tcp_function_alias()

int find_tcp_function_alias ( struct tcp_function_block blk,
struct tcp_function_set fs 
)

◆ find_tcp_functions_locked()

static struct tcp_function_block * find_tcp_functions_locked ( struct tcp_function_set fs)
static

◆ INPCBSTORAGE_DEFINE()

INPCBSTORAGE_DEFINE ( tcpcbstor  ,
"tcpinp"  ,
"tcp_inpcb"  ,
"tcp"  ,
"tcphash"   
)

◆ maketcp_hashsize()

static int maketcp_hashsize ( int  size)
static

Definition at line 1156 of file tcp_subr.c.

Referenced by tcp_init().

Here is the caller graph for this function:

◆ MALLOC_DEFINE() [1/2]

MALLOC_DEFINE ( M_TCPFUNCTIONS  ,
"tcpfunc"  ,
"TCP function set memory"   
)

◆ MALLOC_DEFINE() [2/2]

MALLOC_DEFINE ( M_TCPLOG  ,
"tcplog"  ,
"TCP address and flags print buffers"   
)

◆ register_tcp_functions()

int register_tcp_functions ( struct tcp_function_block blk,
int  wait 
)

Definition at line 1314 of file tcp_subr.c.

References register_tcp_functions_as_name().

Referenced by tcp_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_tcp_functions_as_name()

int register_tcp_functions_as_name ( struct tcp_function_block blk,
const char *  name,
int  wait 
)

Definition at line 1292 of file tcp_subr.c.

References register_tcp_functions_as_names(), and tcp_function_block::tfb_tcp_block_name.

Referenced by register_tcp_functions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_tcp_functions_as_names()

◆ sysctl_drop()

static int sysctl_drop ( SYSCTL_HANDLER_ARGS  )
static

◆ SYSCTL_INT() [1/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
do_tcpdrain  ,
CTLFLAG_RW  ,
do_tcpdrain,
,
"Enable tcp_drain routine for extra help when low on mbufs"   
)

◆ SYSCTL_INT() [2/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
icmp_may_rst  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEicmp_may_rst,
,
"Certain ICMP unreachable messages may abort connections in SYN_SENT"   
)

◆ SYSCTL_INT() [3/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
isn_reseed_interval  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEtcp_isn_reseed_interval,
,
"Seconds between reseeding of ISN secret"   
)

◆ SYSCTL_INT() [4/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
log_debug  ,
CTLFLAG_RW  ,
tcp_log_debug,
,
"Log errors caused by incoming TCP segments"   
)

◆ SYSCTL_INT() [5/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
minmss  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEtcp_minmss,
,
"Minimum TCP Maximum Segment Size"   
)

◆ SYSCTL_INT() [6/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
pacing_limit  ,
CTLFLAG_RW  ,
tcp_pacing_limit,
1000  ,
"If the TCP stack does  pacing,
is there a limit(-1=no, 0=no pacing N=number of connections)"   
)

◆ SYSCTL_INT() [7/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
soreceive_stream  ,
CTLFLAG_RDTUN  ,
tcp_soreceive_stream,
,
"Using soreceive_stream for TCP sockets"   
)

◆ SYSCTL_INT() [8/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
tcbhashsize  ,
CTLFLAG_RDTUN|  CTLFLAG_NOFETCH,
tcp_tcbhashsize,
,
"Size of TCP control-block hashtable"   
)

◆ SYSCTL_INT() [9/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
tolerate_missing_ts  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEtcp_tolerate_missing_ts,
,
"Tolerate missing TCP timestamps"   
)

◆ SYSCTL_INT() [10/11]

SYSCTL_INT ( _net_inet_tcp  ,
OID_AUTO  ,
ts_offset_per_conn  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEtcp_ts_offset_per_conn,
,
"Initialize TCP timestamps per connection instead of per host pair"   
)

◆ SYSCTL_INT() [11/11]

SYSCTL_INT ( _net_inet_tcp  ,
TCPCTL_DO_RFC1323  ,
rfc1323  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEtcp_do_rfc1323,
,
"Enable rfc1323 (high performance TCP) extensions"   
)

◆ sysctl_net_inet_default_tcp_functions()

static int sysctl_net_inet_default_tcp_functions ( SYSCTL_HANDLER_ARGS  )
static

◆ sysctl_net_inet_list_available()

static int sysctl_net_inet_list_available ( SYSCTL_HANDLER_ARGS  )
static

◆ sysctl_net_inet_list_func_info()

◆ sysctl_net_inet_tcp_map_limit_check()

static int sysctl_net_inet_tcp_map_limit_check ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 338 of file tcp_subr.c.

References TCP_MIN_MAP_ENTRIES_LIMIT, and V_tcp_map_entries_limit.

◆ sysctl_net_inet_tcp_mss_check()

static int sysctl_net_inet_tcp_mss_check ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 213 of file tcp_subr.c.

References V_tcp_mssdflt.

◆ sysctl_net_inet_tcp_udp_tunneling_overhead_check()

static int sysctl_net_inet_tcp_udp_tunneling_overhead_check ( SYSCTL_HANDLER_ARGS  )
static

◆ sysctl_net_inet_tcp_udp_tunneling_port_check()

static int sysctl_net_inet_tcp_udp_tunneling_port_check ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 884 of file tcp_subr.c.

References tcp_over_udp_start(), tcp_over_udp_stop(), TCP_TUNNELING_PORT_MAX, TCP_TUNNELING_PORT_MIN, and V_tcp_udp_tunneling_port.

Here is the call graph for this function:

◆ SYSCTL_PROC() [1/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
function_info  ,
CTLTYPE_OPAQUE|CTLFLAG_SKIP|CTLFLAG_RD|  CTLFLAG_MPSAFE,
NULL  ,
,
sysctl_net_inet_list_func_info  ,
S,
tcp_function_info ,
"List TCP function block name-to-ID mappings"   
)

◆ SYSCTL_PROC() [2/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
functions_available  ,
CTLTYPE_STRING|CTLFLAG_RD|  CTLFLAG_NEEDGIANT,
NULL  ,
,
sysctl_net_inet_list_available  ,
"A"  ,
"list available TCP Function sets"   
)

◆ SYSCTL_PROC() [3/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
functions_default  ,
CTLTYPE_STRING|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
NULL  ,
,
sysctl_net_inet_default_tcp_functions  ,
"A"  ,
"Set/get the default TCP functions"   
)

◆ SYSCTL_PROC() [4/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
map_limit  ,
CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
VNET_NAMEtcp_map_entries_limit,
,
sysctl_net_inet_tcp_map_limit_check,
"IU"  ,
"Total sendmap entries limit"   
)

◆ SYSCTL_PROC() [5/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
setsockopt  ,
CTLFLAG_VNET|CTLTYPE_STRUCT|CTLFLAG_WR|CTLFLAG_SKIP|  CTLFLAG_MPSAFE,
NULL  ,
,
tcp_sysctl_setsockopt  ,
""  ,
"Set socket option for TCP endpoint"   
)

◆ SYSCTL_PROC() [6/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
udp_tunneling_overhead  ,
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_MPSAFE,
VNET_NAMEtcp_udp_tunneling_overhead,
,
sysctl_net_inet_tcp_udp_tunneling_overhead_check,
"IU"  ,
"MSS reduction when using tcp over udp"   
)

◆ SYSCTL_PROC() [7/10]

SYSCTL_PROC ( _net_inet_tcp  ,
OID_AUTO  ,
udp_tunneling_port  ,
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_MPSAFE,
VNET_NAMEtcp_udp_tunneling_port,
,
sysctl_net_inet_tcp_udp_tunneling_port_check,
"IU"  ,
"Tunneling port for tcp over udp"   
)

◆ SYSCTL_PROC() [8/10]

SYSCTL_PROC ( _net_inet_tcp  ,
TCPCTL_DROP  ,
drop  ,
CTLFLAG_VNET|CTLTYPE_STRUCT|CTLFLAG_WR|CTLFLAG_SKIP|  CTLFLAG_NEEDGIANT,
NULL  ,
,
sysctl_drop  ,
""  ,
"Drop TCP connection"   
)

◆ SYSCTL_PROC() [9/10]

SYSCTL_PROC ( _net_inet_tcp  ,
TCPCTL_MSSDFLT  ,
mssdflt  ,
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW|  CTLFLAG_NEEDGIANT,
VNET_NAMEtcp_mssdflt,
,
sysctl_net_inet_tcp_mss_check,
"I"  ,
"Default TCP Maximum Segment Size"   
)

◆ SYSCTL_PROC() [10/10]

SYSCTL_PROC ( _net_inet_tcp  ,
TCPCTL_PCBLIST  ,
pcblist  ,
CTLTYPE_OPAQUE|CTLFLAG_RD|  CTLFLAG_NEEDGIANT,
NULL  ,
,
tcp_pcblist  ,
S,
xtcpcb"  ,
"List of active TCP connections"   
)

◆ SYSCTL_UINT() [1/5]

SYSCTL_UINT ( _net_inet_tcp  ,
OID_AUTO  ,
ack_war_cnt  ,
CTLFLAG_RW  ,
tcp_ack_war_cnt,
,
"If the tcp_stack does ack-war prevention how many acks can be sent in its time window?"   
)

◆ SYSCTL_UINT() [2/5]

SYSCTL_UINT ( _net_inet_tcp  ,
OID_AUTO  ,
ack_war_timewindow  ,
CTLFLAG_RW  ,
tcp_ack_war_time_window,
1000  ,
"If the tcp_stack does ack-war prevention how many milliseconds are in its time window?"   
)

◆ SYSCTL_UINT() [3/5]

SYSCTL_UINT ( _net_inet_tcp  ,
OID_AUTO  ,
pacing_count  ,
CTLFLAG_RD  ,
shadow_num_connections,
,
"Number of TCP connections being paced"   
)

◆ SYSCTL_UINT() [4/5]

SYSCTL_UINT ( _net_inet_tcp  ,
OID_AUTO  ,
pcbcount  ,
CTLFLAG_VNET|  CTLFLAG_RD,
VNET_NAMEtcbinfo.ipi_count,
,
"Number of active PCBs"   
)

◆ SYSCTL_UINT() [5/5]

SYSCTL_UINT ( _net_inet_tcp  ,
OID_AUTO  ,
split_limit  ,
CTLFLAG_VNET|  CTLFLAG_RW,
VNET_NAMEtcp_map_split_limit,
,
"Total sendmap split entries limit"   
)

◆ SYSINIT()

SYSINIT ( tcp_init  ,
SI_SUB_PROTO_DOMAIN  ,
SI_ORDER_THIRD  ,
tcp_init  ,
NULL   
)

◆ tcp_can_enable_pacing()

int tcp_can_enable_pacing ( void  )

Definition at line 4110 of file tcp_subr.c.

References number_of_tcp_connections_pacing, shadow_num_connections, and tcp_pacing_limit.

Referenced by rack_init(), rack_process_option(), and rack_set_profile().

Here is the caller graph for this function:

◆ tcp_close()

◆ tcp_decrement_paced_conn()

void tcp_decrement_paced_conn ( void  )

Definition at line 4126 of file tcp_subr.c.

References number_of_tcp_connections_pacing, shadow_num_connections, tcp_pacing_limit, and tcp_pacing_warning.

Referenced by rack_fini(), rack_process_option(), and rack_set_profile().

Here is the caller graph for this function:

◆ tcp_default_fb_fini()

static void tcp_default_fb_fini ( struct tcpcb tp,
int  tcb_is_purged 
)
static

Definition at line 1105 of file tcp_subr.c.

References INP_WLOCK_ASSERT, and tcpcb::t_inpcb.

◆ tcp_default_fb_init()

◆ tcp_default_handoff_ok()

static int tcp_default_handoff_ok ( struct tcpcb tp)
static

Definition at line 1024 of file tcp_subr.c.

◆ tcp_discardcb()

◆ tcp_drain()

void tcp_drain ( void  )

◆ tcp_drop()

◆ tcp_drop_syn_sent()

struct inpcb * tcp_drop_syn_sent ( struct inpcb inp,
int  errno 
)

◆ tcp_fini()

void tcp_fini ( void *  xtp)

Definition at line 1626 of file tcp_subr.c.

Referenced by tcp_init().

Here is the caller graph for this function:

◆ tcp_fixed_maxseg()

u_int tcp_fixed_maxseg ( const struct tcpcb tp)

◆ tcp_freecb()

bool tcp_freecb ( struct tcpcb tp)

◆ tcp_init()

◆ tcp_inptoxtp()

◆ tcp_keyed_hash()

static uint32_t tcp_keyed_hash ( struct in_conninfo inc,
u_char *  key,
u_int  len 
)
static

Definition at line 3189 of file tcp_subr.c.

References in_conninfo::inc_flags, and INC_ISIPV6.

Referenced by tcp_new_isn(), and tcp_new_ts_offset().

Here is the caller graph for this function:

◆ tcp_log_addr()

static char * tcp_log_addr ( struct in_conninfo inc,
struct tcphdr *  th,
void *  ip4hdr,
const void *  ip6hdr 
)
static

Definition at line 3913 of file tcp_subr.c.

References in_conninfo::inc_flags, INC_ISIPV6, inet_ntoa_r(), ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, and tcp_get_flags().

Referenced by tcp_log_addrs(), and tcp_log_vain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcp_log_addrs()

char * tcp_log_addrs ( struct in_conninfo inc,
struct tcphdr *  th,
void *  ip4hdr,
const void *  ip6hdr 
)

Definition at line 3901 of file tcp_subr.c.

References tcp_log_addr(), and tcp_log_debug.

Referenced by syncache_add(), syncache_chkrst(), syncache_expand(), syncache_pause(), syncache_socket(), syncache_timer(), tcp_do_segment(), tcp_input_with_port(), and tcp_reass().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcp_log_end_status()

◆ tcp_log_vain()

char * tcp_log_vain ( struct in_conninfo inc,
struct tcphdr *  th,
void *  ip4hdr,
const void *  ip6hdr 
)

Definition at line 3889 of file tcp_subr.c.

References tcp_log_addr(), and V_tcp_log_in_vain.

Referenced by tcp_input_with_port().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcp_maxseg()

◆ tcp_mtudisc()

static struct inpcb * tcp_mtudisc ( struct inpcb inp,
int  mtuoffer 
)
static

◆ tcp_mtudisc_notify()

static struct inpcb * tcp_mtudisc_notify ( struct inpcb inp,
int  error 
)
static

Definition at line 3368 of file tcp_subr.c.

References tcp_mtudisc().

Here is the call graph for this function:

◆ tcp_new_isn()

tcp_seq tcp_new_isn ( struct in_conninfo inc)

◆ tcp_new_ts_offset()

uint32_t tcp_new_ts_offset ( struct in_conninfo inc)

Definition at line 3220 of file tcp_subr.c.

References tcp_keyed_hash(), V_tcp_ts_offset_per_conn, and V_ts_offset_secret.

Referenced by syncache_add(), and syncookie_lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcp_newtcpcb()

◆ tcp_notify()

static struct inpcb * tcp_notify ( struct inpcb inp,
int  error 
)
static

◆ tcp_over_udp_start()

static int tcp_over_udp_start ( void  )
static

◆ tcp_over_udp_stop()

static void tcp_over_udp_stop ( void  )
static

Definition at line 776 of file tcp_subr.c.

Referenced by sysctl_net_inet_tcp_udp_tunneling_port_check(), and tcp_over_udp_start().

Here is the caller graph for this function:

◆ tcp_pcblist()

static int tcp_pcblist ( SYSCTL_HANDLER_ARGS  )
static

◆ tcp_record_dsack()

void tcp_record_dsack ( struct tcpcb tp,
tcp_seq  start,
tcp_seq  end,
int  tlp 
)

Definition at line 397 of file tcp_subr.c.

References SEQ_GT, tcpcb::t_dsack_bytes, tcpcb::t_dsack_pack, tcpcb::t_dsack_tlp_bytes, TCPSTAT_ADD, and TCPSTAT_INC.

Referenced by bbr_log_ack(), rack_log_ack(), and tcp_sack_doack().

Here is the caller graph for this function:

◆ tcp_recv_udp_tunneled_packet()

static void tcp_recv_udp_tunneled_packet ( struct mbuf *  m,
int  off,
struct inpcb inp,
const struct sockaddr *  sa,
void *  ctx 
)
static

Definition at line 594 of file tcp_subr.c.

References ip::ip_len, ip::ip_v, IPPROTO_TCP, IPV6_VERSION, IPVERSION, tcp_input_with_port(), TCPSTAT_INC, and udphdr::uh_sport.

Referenced by tcp_over_udp_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcp_respond()

void tcp_respond ( struct tcpcb tp,
void *  ipgen,
struct tcphdr *  th,
struct mbuf *  m,
tcp_seq  ack,
tcp_seq  seq,
int  flags 
)

◆ tcp_state_change()

◆ tcp_switch_back_to_default()

void tcp_switch_back_to_default ( struct tcpcb tp)

◆ tcp_sysctl_setsockopt()

static int tcp_sysctl_setsockopt ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 3751 of file tcp_subr.c.

References sysctl_setsockopt(), tcp_ctloutput_set(), and V_tcbinfo.

Here is the call graph for this function:

◆ tcp_vnet_init()

static void tcp_vnet_init ( void *arg  __unused)
static

◆ tcpip_fillheaders()

void tcpip_fillheaders ( struct inpcb inp,
uint16_t  port,
void *  ip_ptr,
void *  tcp_ptr 
)

◆ tcpip_maketemplate()

struct tcptemp * tcpip_maketemplate ( struct inpcb inp)

Definition at line 1702 of file tcp_subr.c.

References tcpip_fillheaders(), tcptemp::tt_ipgen, and tcptemp::tt_t.

Referenced by bbr_timeout_keepalive(), bbr_timeout_persist(), rack_timeout_keepalive(), rack_timeout_persist(), and tcp_timer_keep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VNET_DEFINE() [1/10]

VNET_DEFINE ( int  ,
tcp_do_rfc1323   
)

◆ VNET_DEFINE() [2/10]

VNET_DEFINE ( int  ,
tcp_minmss   
)

◆ VNET_DEFINE() [3/10]

VNET_DEFINE ( int  ,
tcp_mssdflt   
)

◆ VNET_DEFINE() [4/10]

VNET_DEFINE ( int  ,
tcp_tolerate_missing_ts   
)

◆ VNET_DEFINE() [5/10]

VNET_DEFINE ( int  ,
tcp_ts_offset_per_conn   
)

◆ VNET_DEFINE() [6/10]

VNET_DEFINE ( int  ,
tcp_udp_tunneling_overhead   
)

◆ VNET_DEFINE() [7/10]

VNET_DEFINE ( int  ,
tcp_udp_tunneling_port   
)

◆ VNET_DEFINE() [8/10]

VNET_DEFINE ( uint32_t  ,
tcp_map_entries_limit   
)
pure virtual

◆ VNET_DEFINE() [9/10]

VNET_DEFINE ( uint32_t  ,
tcp_map_split_limit   
)
pure virtual

◆ VNET_DEFINE() [10/10]

VNET_DEFINE ( uma_zone_t  ,
sack_hole_zone   
)

◆ VNET_DEFINE_STATIC() [1/9]

VNET_DEFINE_STATIC ( int  ,
icmp_may_rst   
)

◆ VNET_DEFINE_STATIC() [2/9]

VNET_DEFINE_STATIC ( int  ,
isn_last   
)

◆ VNET_DEFINE_STATIC() [3/9]

VNET_DEFINE_STATIC ( int  ,
isn_last_reseed   
)

◆ VNET_DEFINE_STATIC() [4/9]

VNET_DEFINE_STATIC ( int  ,
tcp_isn_reseed_interval   
)
pure virtual

◆ VNET_DEFINE_STATIC() [5/9]

VNET_DEFINE_STATIC ( u_char  ,
isn_secret  [ISN_SECRET_LENGTH] 
)

◆ VNET_DEFINE_STATIC() [6/9]

VNET_DEFINE_STATIC ( u_char  ,
ts_offset_secret  [TS_OFFSET_SECRET_LENGTH] 
)

◆ VNET_DEFINE_STATIC() [7/9]

VNET_DEFINE_STATIC ( u_int32_t  ,
isn_offset   
)

◆ VNET_DEFINE_STATIC() [8/9]

VNET_DEFINE_STATIC ( u_int32_t  ,
isn_offset_old   
)

◆ VNET_DEFINE_STATIC() [9/9]

VNET_DEFINE_STATIC ( uma_zone_t  ,
tcpcb_zone   
)

◆ VNET_SYSINIT()

VNET_SYSINIT ( tcp_vnet_init  ,
SI_SUB_PROTO_DOMAIN  ,
SI_ORDER_FOURTH  ,
tcp_vnet_init  ,
NULL   
)

Variable Documentation

◆ do_tcpdrain

int do_tcpdrain = 1
static

Definition at line 311 of file tcp_subr.c.

Referenced by tcp_drain().

◆ isn_mtx

struct mtx isn_mtx
static

Definition at line 1143 of file tcp_subr.c.

◆ next_tcp_stack_id

volatile int next_tcp_stack_id = 1
static

Definition at line 1172 of file tcp_subr.c.

Referenced by register_tcp_functions_as_names().

◆ number_of_tcp_connections_pacing

volatile uint32_t number_of_tcp_connections_pacing = 0
static

Definition at line 292 of file tcp_subr.c.

Referenced by tcp_can_enable_pacing(), and tcp_decrement_paced_conn().

◆ shadow_num_connections

uint32_t shadow_num_connections = 0
static

Definition at line 293 of file tcp_subr.c.

Referenced by tcp_can_enable_pacing(), and tcp_decrement_paced_conn().

◆ t_functions

◆ tcp_ack_war_cnt

uint32_t tcp_ack_war_cnt = 5

Definition at line 204 of file tcp_subr.c.

Referenced by __ctf_process_rst(), and ctf_ack_war_checks().

◆ tcp_ack_war_time_window

uint32_t tcp_ack_war_time_window = 1000

Definition at line 199 of file tcp_subr.c.

Referenced by __ctf_process_rst(), and ctf_ack_war_checks().

◆ tcp_def_funcblk

struct tcp_function_block tcp_def_funcblk
static
Initial value:
= {
.tfb_tcp_block_name = "freebsd",
.tfb_tcp_output = tcp_default_output,
.tfb_tcp_do_segment = tcp_do_segment,
.tfb_tcp_ctloutput = tcp_default_ctloutput,
.tfb_tcp_handoff_ok = tcp_default_handoff_ok,
.tfb_tcp_fb_init = tcp_default_fb_init,
.tfb_tcp_fb_fini = tcp_default_fb_fini,
}
void tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos)
Definition: tcp_input.c:1518
int tcp_default_output(struct tcpcb *tp)
Definition: tcp_output.c:199
static void tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged)
Definition: tcp_subr.c:1105
static int tcp_default_handoff_ok(struct tcpcb *tp)
Definition: tcp_subr.c:1024
static int tcp_default_fb_init(struct tcpcb *tp)
Definition: tcp_subr.c:1040
int tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
Definition: tcp_usrreq.c:2120

Definition at line 382 of file tcp_subr.c.

Referenced by deregister_tcp_functions(), tcp_init(), and tcp_switch_back_to_default().

◆ tcp_fb_cnt

int tcp_fb_cnt = 0
static

◆ tcp_func_set_ptr

◆ tcp_function_lock

◆ tcp_log_debug

int tcp_log_debug = 0
static

Definition at line 303 of file tcp_subr.c.

Referenced by tcp_log_addrs().

◆ tcp_pacing_limit

int tcp_pacing_limit = 10000
static

Definition at line 295 of file tcp_subr.c.

Referenced by tcp_can_enable_pacing(), and tcp_decrement_paced_conn().

◆ tcp_pacing_warning

uint8_t tcp_pacing_warning = 0
static

Definition at line 4123 of file tcp_subr.c.

Referenced by tcp_decrement_paced_conn().

◆ tcp_soreceive_stream

int tcp_soreceive_stream
static

Definition at line 330 of file tcp_subr.c.

Referenced by tcp_init().

◆ tcp_tcbhashsize

int tcp_tcbhashsize
static

Definition at line 307 of file tcp_subr.c.

Referenced by tcp_init(), and tcp_vnet_init().