FreeBSD kernel IPv4 code
|
#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 inpcb * | tcp_notify (struct inpcb *, int) |
static struct inpcb * | tcp_mtudisc_notify (struct inpcb *, int) |
static struct inpcb * | tcp_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_block * | find_tcp_functions_locked (struct tcp_function_set *fs) |
static struct tcp_function_block * | find_tcp_fb_locked (struct tcp_function_block *blk, struct tcp_function **s) |
struct tcp_function_block * | find_and_ref_tcp_functions (struct tcp_function_set *fs) |
struct tcp_function_block * | find_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_block * | find_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 tcptemp * | tcpip_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 tcpcb * | tcp_newtcpcb (struct inpcb *inp) |
struct tcpcb * | tcp_drop (struct tcpcb *tp, int errno) |
void | tcp_discardcb (struct tcpcb *tp) |
bool | tcp_freecb (struct tcpcb *tp) |
struct tcpcb * | tcp_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 inpcb * | tcp_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_block * | tcp_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 |
#define COPYTIMER | ( | ttt | ) |
#define ISN_BYTES_PER_SECOND 1048576 |
Definition at line 3280 of file tcp_subr.c.
#define ISN_LOCK | ( | ) | mtx_lock(&isn_mtx) |
Definition at line 1146 of file tcp_subr.c.
#define ISN_LOCK_INIT | ( | ) | mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF) |
Definition at line 1145 of file tcp_subr.c.
#define ISN_RANDOM_INCREMENT (4096 - 1) |
Definition at line 3282 of file tcp_subr.c.
#define ISN_SECRET_LENGTH SIPHASH_KEY_LENGTH |
Definition at line 3283 of file tcp_subr.c.
#define ISN_STATIC_INCREMENT 4096 |
Definition at line 3281 of file tcp_subr.c.
#define ISN_UNLOCK | ( | ) | mtx_unlock(&isn_mtx) |
Definition at line 1147 of file tcp_subr.c.
#define PAD | ( | len | ) | ((((len) / 4) + !!((len) % 4)) * 4) |
#define TCBHASHSIZE 0 |
Definition at line 1119 of file tcp_subr.c.
#define TCP_MINPROTOHDR (sizeof(struct tcpiphdr)) |
#define TS_OFFSET_SECRET_LENGTH SIPHASH_KEY_LENGTH |
Definition at line 369 of file tcp_subr.c.
#define V_icmp_may_rst VNET(icmp_may_rst) |
Definition at line 319 of file tcp_subr.c.
#define V_isn_last VNET(isn_last) |
Definition at line 3292 of file tcp_subr.c.
#define V_isn_last_reseed VNET(isn_last_reseed) |
Definition at line 3293 of file tcp_subr.c.
#define V_isn_offset VNET(isn_offset) |
Definition at line 3294 of file tcp_subr.c.
#define V_isn_offset_old VNET(isn_offset_old) |
Definition at line 3295 of file tcp_subr.c.
#define V_isn_secret VNET(isn_secret) |
Definition at line 3291 of file tcp_subr.c.
#define V_sack_hole_zone VNET(sack_hole_zone) |
Definition at line 335 of file tcp_subr.c.
#define V_tcp_isn_reseed_interval VNET(tcp_isn_reseed_interval) |
Definition at line 325 of file tcp_subr.c.
#define V_tcpcb_zone VNET(tcpcb_zone) |
Definition at line 1138 of file tcp_subr.c.
#define V_ts_offset_secret VNET(ts_offset_secret) |
Definition at line 371 of file tcp_subr.c.
#define xchg | ( | a, | |
b, | |||
type | |||
) | { type t; t=a; a=b; b=t; } |
__FBSDID | ( | "$FreeBSD$" | ) |
int deregister_tcp_functions | ( | struct tcp_function_block * | blk, |
bool | quiesce, | ||
bool | force | ||
) |
Definition at line 1338 of file tcp_subr.c.
References find_tcp_fb_locked(), INP_ALL_ITERATOR, inpcb::inp_flags, inp_next(), INP_TIMEWAIT, INPLOOKUP_WLOCKPCB, intotcpcb, tcpcb::t_fb, t_functions, tcp_def_funcblk, tcp_fb_cnt, TCP_FUNC_BEING_REMOVED, tcp_func_set_ptr, tcp_function_lock, tcp_switch_back_to_default(), tcp_function::tf_fb, tcp_function_block::tfb_flags, tcp_function_block::tfb_refcnt, and V_tcbinfo.
Referenced by tcp_addbbr(), and tcp_addrack().
|
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().
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().
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().
|
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().
int find_tcp_function_alias | ( | struct tcp_function_block * | blk, |
struct tcp_function_set * | fs | ||
) |
Definition at line 481 of file tcp_subr.c.
References tcp_function_set::function_set_name, t_functions, tcp_function_lock, TCP_FUNCTION_NAME_LEN_MAX, tcp_function::tf_fb, tcp_function::tf_name, and tcp_function_block::tfb_tcp_block_name.
Referenced by tcp_ctloutput_get().
|
static |
Definition at line 421 of file tcp_subr.c.
References tcp_function_set::function_set_name, t_functions, tcp_function::tf_fb, and tcp_function::tf_name.
Referenced by find_and_ref_tcp_functions(), register_tcp_functions_as_names(), and sysctl_net_inet_default_tcp_functions().
INPCBSTORAGE_DEFINE | ( | tcpcbstor | , |
"tcpinp" | , | ||
"tcp_inpcb" | , | ||
"tcp" | , | ||
"tcphash" | |||
) |
|
static |
Definition at line 1156 of file tcp_subr.c.
Referenced by tcp_init().
MALLOC_DEFINE | ( | M_TCPFUNCTIONS | , |
"tcpfunc" | , | ||
"TCP function set memory" | |||
) |
MALLOC_DEFINE | ( | M_TCPLOG | , |
"tcplog" | , | ||
"TCP address and flags print buffers" | |||
) |
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().
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().
int register_tcp_functions_as_names | ( | struct tcp_function_block * | blk, |
int | wait, | ||
const char * | names[], | ||
int * | num_names | ||
) |
Definition at line 1189 of file tcp_subr.c.
References find_tcp_functions_locked(), tcp_function_set::function_set_name, next_tcp_stack_id, t_functions, tcp_fb_cnt, TCP_FUNC_BEING_REMOVED, tcp_function_lock, TCP_FUNCTION_NAME_LEN_MAX, tcp_function::tf_fb, tcp_function::tf_name, tcp_function_block::tfb_flags, tcp_function_block::tfb_id, tcp_function_block::tfb_refcnt, tcp_function_block::tfb_tcp_block_name, tcp_function_block::tfb_tcp_ctloutput, tcp_function_block::tfb_tcp_do_segment, tcp_function_block::tfb_tcp_output, tcp_function_block::tfb_tcp_timer_activate, tcp_function_block::tfb_tcp_timer_active, tcp_function_block::tfb_tcp_timer_stop, and tcp_function_block::tfb_tcp_timer_stop_all.
Referenced by register_tcp_functions_as_name(), tcp_addbbr(), and tcp_addrack().
|
static |
Definition at line 3634 of file tcp_subr.c.
References in_pcblookup(), INP_DROPPED, inpcb::inp_flags, inpcb::inp_socket, INP_TIMEWAIT, INP_WUNLOCK, INPLOOKUP_WLOCKPCB, intotcpcb, intotw, sockaddr_in::sin_addr, sockaddr_in::sin_len, sockaddr_in::sin_port, tcp_drop(), tcp_twclose(), and V_tcbinfo.
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_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
icmp_may_rst | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEicmp_may_rst, | ||
0 | , | ||
"Certain ICMP unreachable messages may abort connections in SYN_SENT" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
isn_reseed_interval | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_isn_reseed_interval, | ||
0 | , | ||
"Seconds between reseeding of ISN secret" | |||
) |
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 | , | ||
minmss | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_minmss, | ||
0 | , | ||
"Minimum TCP Maximum Segment Size" | |||
) |
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 | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
soreceive_stream | , | ||
CTLFLAG_RDTUN | , | ||
& | tcp_soreceive_stream, | ||
0 | , | ||
"Using soreceive_stream for TCP sockets" | |||
) |
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 | , | ||
tolerate_missing_ts | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_tolerate_missing_ts, | ||
0 | , | ||
"Tolerate missing TCP timestamps" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
ts_offset_per_conn | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_ts_offset_per_conn, | ||
0 | , | ||
"Initialize TCP timestamps per connection instead of per host pair" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
TCPCTL_DO_RFC1323 | , | ||
rfc1323 | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_rfc1323, | ||
0 | , | ||
"Enable rfc1323 (high performance TCP) extensions" | |||
) |
|
static |
Definition at line 668 of file tcp_subr.c.
References find_tcp_fb_locked(), find_tcp_functions_locked(), tcp_function_set::function_set_name, tcp_function_set::pcbcnt, TCP_FUNC_BEING_REMOVED, tcp_func_set_ptr, tcp_function_lock, tcp_function_block::tfb_flags, tcp_function_block::tfb_refcnt, and tcp_function_block::tfb_tcp_block_name.
|
static |
Definition at line 709 of file tcp_subr.c.
References t_functions, tcp_func_set_ptr, tcp_function_lock, TCP_FUNCTION_NAME_LEN_MAX, tcp_function::tf_fb, tcp_function::tf_name, tcp_function_block::tfb_refcnt, and tcp_function_block::tfb_tcp_block_name.
|
static |
Definition at line 945 of file tcp_subr.c.
References t_functions, tcp_fb_cnt, tcp_function_lock, tcp_function::tf_fb, tcp_function::tf_name, tcp_function_block::tfb_id, tcp_function_block::tfb_refcnt, tcp_function_block::tfb_tcp_block_name, tcp_function_info::tfi_alias, tcp_function_info::tfi_id, tcp_function_info::tfi_name, and tcp_function_info::tfi_refcnt.
|
static |
Definition at line 338 of file tcp_subr.c.
References TCP_MIN_MAP_ENTRIES_LIMIT, and V_tcp_map_entries_limit.
|
static |
Definition at line 213 of file tcp_subr.c.
References V_tcp_mssdflt.
|
static |
Definition at line 919 of file tcp_subr.c.
References TCP_TUNNELING_OVERHEAD_MAX, TCP_TUNNELING_OVERHEAD_MIN, and V_tcp_udp_tunneling_overhead.
|
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.
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" | |||
) |
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" | |||
) |
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" | |||
) |
SYSCTL_PROC | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
map_limit | , | ||
CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW| | CTLFLAG_NEEDGIANT, | ||
& | VNET_NAMEtcp_map_entries_limit, | ||
0 | , | ||
& | sysctl_net_inet_tcp_map_limit_check, | ||
"IU" | , | ||
"Total sendmap entries limit" | |||
) |
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" | |||
) |
SYSCTL_PROC | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
udp_tunneling_overhead | , | ||
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
& | VNET_NAMEtcp_udp_tunneling_overhead, | ||
0 | , | ||
& | sysctl_net_inet_tcp_udp_tunneling_overhead_check, | ||
"IU" | , | ||
"MSS reduction when using tcp over udp" | |||
) |
SYSCTL_PROC | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
udp_tunneling_port | , | ||
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
& | VNET_NAMEtcp_udp_tunneling_port, | ||
0 | , | ||
& | sysctl_net_inet_tcp_udp_tunneling_port_check, | ||
"IU" | , | ||
"Tunneling port for tcp over udp" | |||
) |
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" | |||
) |
SYSCTL_PROC | ( | _net_inet_tcp | , |
TCPCTL_MSSDFLT | , | ||
mssdflt | , | ||
CTLFLAG_VNET|CTLTYPE_INT|CTLFLAG_RW| | CTLFLAG_NEEDGIANT, | ||
& | VNET_NAMEtcp_mssdflt, | ||
0 | , | ||
& | sysctl_net_inet_tcp_mss_check, | ||
"I" | , | ||
"Default TCP Maximum Segment Size" | |||
) |
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" | |||
) |
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?" | |||
) |
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 | , | ||
pacing_count | , | ||
CTLFLAG_RD | , | ||
& | shadow_num_connections, | ||
0 | , | ||
"Number of TCP connections being paced" | |||
) |
SYSCTL_UINT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
pcbcount | , | ||
CTLFLAG_VNET| | CTLFLAG_RD, | ||
& | VNET_NAMEtcbinfo.ipi_count, | ||
0 | , | ||
"Number of active PCBs" | |||
) |
SYSCTL_UINT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
split_limit | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_map_split_limit, | ||
0 | , | ||
"Total sendmap split entries limit" | |||
) |
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().
Definition at line 2471 of file tcp_subr.c.
References in_pcbdrop(), inpcb::inp_flags, inpcb::inp_socket, INP_SOCKREF, INP_WLOCK_ASSERT, INP_WUNLOCK, tcpcb::t_inpcb, tcpcb::t_state, tcpcb::t_tfo_pending, tcp_fastopen_decrement_counter(), tcp_hpts_remove(), tcp_offload_listen_stop(), tcp_state_change(), TCPS_CLOSED, TCPS_LISTEN, and TCPSTAT_INC.
Referenced by __ctf_process_rst(), bbr_check_data_after_close(), bbr_do_lastack(), bbr_process_ack(), rack_check_data_after_close(), rack_do_compressed_ack_processing(), rack_do_lastack(), rack_process_ack(), tcp_disconnect(), tcp_do_segment(), tcp_drop(), tcp_timer_2msl(), and tcp_usrclosed().
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().
|
static |
Definition at line 1105 of file tcp_subr.c.
References INP_WLOCK_ASSERT, and tcpcb::t_inpcb.
|
static |
Definition at line 1040 of file tcp_subr.c.
References IN_FASTRECOVERY, inpcb::inp_socket, INP_WLOCK_ASSERT, sackhint::recover_fs, tcpcb::sackhint, tcpcb::snd_max, tcpcb::snd_nxt, tcpcb::snd_una, tcpcb::snd_wnd, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_rxtcur, tcpcb::t_state, tcp_setpersist(), tcp_timer_activate(), tcp_timer_active(), TCPS_HAVEESTABLISHED, TCPS_LISTEN, TCPS_TIME_WAIT, TP_KEEPIDLE, TP_KEEPINIT, TT_KEEP, TT_PERSIST, and TT_REXMT.
|
static |
Definition at line 1024 of file tcp_subr.c.
void tcp_discardcb | ( | struct tcpcb * | tp | ) |
Definition at line 2304 of file tcp_subr.c.
References CC_ALGO, CC_DATA, cc_detach(), tcpcb::ccv, inpcb::inp_ppcb, INP_WLOCK_ASSERT, tcpcb::osd, tcpcb::t_fb, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_stats, tcpcb::t_timers, tcp_free_sackholes(), tcp_freecb(), tcp_offload_detach(), tcp_pcap_drain(), tcp_reass_flush(), tcp_timer_stop(), TF_TOE, tcp_function_block::tfb_tcp_timer_stop_all, TT_2MSL, TT_DELACK, tcp_timer::tt_draincnt, TT_KEEP, TT_PERSIST, and TT_REXMT.
Referenced by tcp_twstart(), and tcp_usr_detach().
void tcp_drain | ( | void | ) |
Definition at line 2515 of file tcp_subr.c.
References do_tcpdrain, INP_ALL_ITERATOR, inpcb::inp_flags, inp_next(), INP_TIMEWAIT, INPLOOKUP_WLOCKPCB, intotcpcb, tcp_clean_sackreport(), tcp_log_drain(), tcp_pcap_aggressive_free, tcp_pcap_drain(), tcp_reass_flush(), and V_tcbinfo.
Definition at line 2283 of file tcp_subr.c.
References inpcb::inp_socket, INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_softerror, tcpcb::t_state, tcp_close(), tcp_state_change(), TCPS_CLOSED, TCPS_HAVERCVDSYN, and TCPSTAT_INC.
Referenced by bbr_do_syn_sent(), ctf_challenge_ack(), ctf_do_dropwithreset_conn(), rack_do_compressed_ack_processing(), rack_do_syn_sent(), sysctl_drop(), tcp_disconnect(), tcp_do_segment(), tcp_drop_syn_sent(), tcp_notify(), tcp_timer_keep(), tcp_timer_persist(), tcp_timer_rexmt(), tcp_usr_abort(), and toe_connect_failed().
Definition at line 3336 of file tcp_subr.c.
References INP_DROPPED, inpcb::inp_flags, INP_TIMEWAIT, INP_WLOCK_ASSERT, intotcpcb, IS_FASTOPEN, tcpcb::t_flags, tcpcb::t_state, tcp_drop(), tcp_fastopen_disable_path(), and TCPS_SYN_SENT.
void tcp_fini | ( | void * | xtp | ) |
Definition at line 1626 of file tcp_subr.c.
Referenced by tcp_init().
u_int tcp_fixed_maxseg | ( | const struct tcpcb * | tp | ) |
Definition at line 3587 of file tcp_subr.c.
References PAD, tcpcb::t_flags, tcpcb::t_maxseg, tcpcb::t_state, TCPS_HAVEESTABLISHED, TF_NOOPT, TF_RCVD_TSTMP, TF_REQ_SCALE, TF_REQ_TSTMP, TF_SACK_PERMIT, and TF_SIGNATURE.
Referenced by ctf_fixed_maxseg(), newreno_cc_cong_signal(), and newreno_cong_signal().
bool tcp_freecb | ( | struct tcpcb * | tp | ) |
Definition at line 2379 of file tcp_subr.c.
References INP_IPV6, inpcb::inp_socket, inpcb::inp_vflag, INP_WLOCK_ASSERT, tcpcb::snd_ssthresh, tcpcb::t_fb, tcpcb::t_inpcb, tcpcb::t_maxseg, tcpcb::t_rttupdated, tcpcb::t_state, tcpcb::t_timers, tcp_hc_update(), tcp_log_tcpcbfini(), TCPSTATES_DEC, tcp_function_block::tfb_tcp_fb_fini, and tcp_timer::tt_draincnt.
Referenced by tcp_discardcb(), and tcp_timer_discard().
|
static |
Definition at line 1453 of file tcp_subr.c.
References ISN_LOCK_INIT, maketcp_hashsize(), register_tcp_functions(), t_functions, TCBHASHSIZE, tcp_bad_csums, tcp_comp_total, tcp_def_funcblk, tcp_delacktime, tcp_extra_mbuf, tcp_fini(), tcp_finwait2_timeout, tcp_function_lock, tcp_inp_lro_compressed, tcp_inp_lro_direct_queue, tcp_inp_lro_locks_taken, tcp_inp_lro_wokeup_queue, tcp_keepidle, tcp_keepinit, tcp_keepintvl, tcp_log_init(), tcp_maxpersistidle, TCP_MINPROTOHDR, tcp_pcap_init(), tcp_persmax, tcp_persmin, tcp_reass_global_init(), tcp_rexmit_initial, tcp_rexmit_min, tcp_rexmit_slop, tcp_soreceive_stream, tcp_tcbhashsize, tcp_uncomp_total, tcp_usrreqs, tcp_would_have_but, TCPTV_CPU_VAR, TCPTV_DELACK, TCPTV_FINWAIT2_TIMEOUT, TCPTV_KEEP_IDLE, TCPTV_KEEP_INIT, TCPTV_KEEPINTVL, TCPTV_MIN, TCPTV_PERSMAX, TCPTV_PERSMIN, TCPTV_RTOBASE, and V_ts_offset_secret.
void tcp_inptoxtp | ( | const struct inpcb * | inp, |
struct xtcpcb * | xt | ||
) |
Definition at line 4020 of file tcp_subr.c.
References CC_ALGO, COPYTIMER, in_pcbtoxinpcb(), inpcb::inp_flags, inpcb::inp_socket, INP_TIMEWAIT, intotcpcb, intotw, IPPROTO_TCP, tcpcb::rcv_wnd, tcpcb::snd_cwnd, tcpcb::snd_ssthresh, tcpcb::snd_wnd, tcpcb::t_dsack_bytes, tcpcb::t_dsack_pack, tcpcb::t_dsack_tlp_bytes, tcpcb::t_fb, tcpcb::t_flags, tcpcb::t_flags2, tcpcb::t_logstate, tcpcb::t_maxseg, tcpcb::t_port, tcptw::t_port, tcpcb::t_rcvoopack, tcpcb::t_rcvtime, tcpcb::t_sndrexmitpack, tcpcb::t_sndzerowin, tcpcb::t_state, TCP_FUNCTION_NAME_LEN_MAX, tcp_log_get_id(), TCPS_TIME_WAIT, TF2_ACE_PERMIT, TF2_ECN_PERMIT, and tcp_function_block::tfb_tcp_block_name.
Referenced by tcp_pcblist().
|
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().
|
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().
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().
Definition at line 4081 of file tcp_subr.c.
References tcpcb::t_end_info_bytes, tcpcb::t_end_info_status, TCP_EI_EMPTY_SLOT, TCP_EI_STATUS_MAX_VALUE, and TCP_END_BYTE_INFO.
Referenced by __ctf_process_rst(), bbr_check_data_after_close(), bbr_do_segment_nounlock(), bbr_do_syn_recv(), bbr_do_syn_sent(), bbr_output_wtime(), bbr_process_ack(), bbr_timeout_keepalive(), bbr_timeout_persist(), bbr_timeout_rxt(), ctf_progress_timeout_check(), rack_check_data_after_close(), rack_do_compressed_ack_processing(), rack_do_segment_nounlock(), rack_do_syn_recv(), rack_do_syn_sent(), rack_output(), rack_process_ack(), rack_timeout_keepalive(), rack_timeout_persist(), and rack_timeout_rxt().
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().
u_int tcp_maxseg | ( | const struct tcpcb * | tp | ) |
Definition at line 3538 of file tcp_subr.c.
References tcpcb::rcv_numsacks, tcpcb::t_flags, tcpcb::t_maxseg, tcpcb::t_state, TCPS_HAVEESTABLISHED, TF_NOOPT, TF_RCVD_TSTMP, TF_REQ_SCALE, TF_REQ_TSTMP, TF_SACK_PERMIT, and TF_SIGNATURE.
Referenced by cc_ack_received(), cc_conn_init(), cubic_cong_signal(), dctcp_cong_signal(), htcp_cong_signal(), newreno_cc_after_idle(), rack_get_bw(), rc_init_window(), tcp_default_output(), tcp_do_prr_ack(), tcp_do_segment(), tcp_newreno_partial_ack(), tcp_sack_lost_retransmission(), and tcp_sack_partialack().
Definition at line 3375 of file tcp_subr.c.
References EXIT_FASTRECOVERY, INP_DROPPED, inpcb::inp_flags, inpcb::inp_socket, INP_TIMEWAIT, INP_WLOCK_ASSERT, intotcpcb, tcpcb::snd_max, tcpcb::snd_nxt, tcpcb::snd_recover, tcpcb::snd_una, tcpcb::t_fb, tcpcb::t_flags, tcpcb::t_maxseg, tcpcb::t_rtttime, tcp_free_sackholes(), tcp_mss_update(), TCPSTAT_INC, TF_SACK_PERMIT, and tcp_function_block::tfb_tcp_mtu_chg.
Referenced by tcp_mtudisc_notify().
Definition at line 3368 of file tcp_subr.c.
References tcp_mtudisc().
tcp_seq tcp_new_isn | ( | struct in_conninfo * | inc | ) |
Definition at line 3298 of file tcp_subr.c.
References ISN_BYTES_PER_SECOND, ISN_LOCK, ISN_RANDOM_INCREMENT, ISN_STATIC_INCREMENT, ISN_UNLOCK, SEQ_GT, tcp_keyed_hash(), V_isn_last, V_isn_last_reseed, V_isn_offset, V_isn_offset_old, V_isn_secret, and V_tcp_isn_reseed_interval.
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().
Definition at line 2150 of file tcp_subr.c.
References CC_ALGO, cc_attach(), CC_DEFAULT_ALGO, cc_detach(), tcpcb_mem::ccv, tcpcb::ccv, cc_var::ccvc, in_pcbref(), in_pcbrele_wlocked(), inpcb::inp_ip_ttl, INP_IPV6, inpcb::inp_ppcb, inpcb::inp_vflag, IPPROTO_TCP, tcpcb::osd, tcpcb::snd_cwnd, tcpcb::snd_ssthresh, tcpcb::t_fb, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_maxseg, tcpcb::t_pacing_rate, tcpcb::t_rcvtime, tcpcb::t_rttmin, tcpcb::t_rttvar, tcpcb::t_rxtcur, tcpcb::t_segq, tcpcb::t_srtt, tcpcb::t_stats, tcpcb::t_timers, tcpcb::t_vnet, tcpcb_mem::tcb, cc_var::ccv_container::tcp, tcp_func_set_ptr, tcp_function_lock, tcp_log_tcpcbinit(), tcp_pcap_tcpcb_init(), tcp_rexmit_initial, tcp_rexmit_min, TCP_RTTVAR_SHIFT, TCPTV_SRTTBASE, TF_LRD, TF_REQ_SCALE, TF_REQ_TSTMP, TF_SACK_PERMIT, tcp_function_block::tfb_refcnt, tcp_function_block::tfb_tcp_fb_fini, tcp_function_block::tfb_tcp_fb_init, tcpcb_mem::tt, tcp_timer::tt_2msl, tcp_timer::tt_delack, tcp_timer::tt_keep, tcp_timer::tt_persist, tcp_timer::tt_rexmt, cc_var::type, V_ip_defttl, V_tcp_do_lrd, V_tcp_do_rfc1323, V_tcp_do_sack, V_tcp_mssdflt, and V_tcpcb_zone.
Referenced by tcp_usr_attach().
Definition at line 2570 of file tcp_subr.c.
References INP_DROPPED, inpcb::inp_flags, inpcb::inp_route, INP_TIMEWAIT, INP_WLOCK_ASSERT, intotcpcb, tcpcb::t_rxtshift, tcpcb::t_softerror, tcpcb::t_state, tcp_drop(), and TCPS_ESTABLISHED.
|
static |
Definition at line 797 of file tcp_subr.c.
References IPPROTO_UDP, sockaddr_in::sin_family, sockaddr_in::sin_len, sockaddr_in::sin_port, tcp_ctlinput_viaudp(), tcp_over_udp_stop(), tcp_recv_udp_tunneled_packet(), udp_set_kernel_tunneling(), and V_tcp_udp_tunneling_port.
Referenced by sysctl_net_inet_tcp_udp_tunneling_port_check().
|
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().
|
static |
Definition at line 2617 of file tcp_subr.c.
References cr_canseeinpcb(), INP_ALL_ITERATOR, inpcb::inp_flags, inpcb::inp_gencnt, inp_next(), INP_RUNLOCK, INP_TIMEWAIT, INPLOOKUP_RLOCKPCB, intotw, syncache_pcblist(), tcp_inptoxtp(), TCPS_SYN_RECEIVED, V_tcbinfo, and V_tcps_states.
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().
|
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().
void tcp_respond | ( | struct tcpcb * | tp, |
void * | ipgen, | ||
struct tcphdr * | th, | ||
struct mbuf * | m, | ||
tcp_seq | ack, | ||
tcp_seq | seq, | ||
int | flags | ||
) |
Definition at line 1728 of file tcp_subr.c.
References tcp_log_bbr::delivered, ERRNO_UNK, tcp_log_bbr::flex8, in_pseudo(), tcp_log_bbr::inhpts, inpcb::inp_in_hpts, INP_LOCK_ASSERT, inpcb::inp_socket, INP_WLOCKED, ip6_hdr::ip6_dst, ip6_hdr::ip6_src, IP_DF, ip::ip_dst, ip::ip_len, ip::ip_off, ip_output(), ip::ip_p, ip::ip_ttl, IPPROTO_TCP, IPPROTO_UDP, IPV6_VERSION, tcp_log_bbr::pkts_out, tcpcb::rcv_scale, in_addr::s_addr, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_logstate, tcpcb::t_maxseg, tcpcb::t_port, tcpcb::t_state, TA_OUTPUT, tcp_addoptions(), tcp_get_flags(), tcp_get_usecs(), tcp_log_event_(), TCP_LOG_OUT, TCP_LOG_STATE_OFF, TCP_PROBE3, TCP_PROBE5, tcp_set_flags(), tcp_trace(), tcp_ts_getticks(), TCPS_CLOSED, TCPS_LISTEN, TF_NOOPT, TF_RCVD_TSTMP, TF_SIGNATURE, tcp_log_bbr::timeStamp, tcp_log_buffer::tlb_errno, tcpopt::to_flags, tcpopt::to_signature, tcpopt::to_tsecr, tcpopt::to_tsval, TOF_SIGNATURE, TOF_TS, tcpcb::ts_offset, tcpcb::ts_recent, tcp_log_stackspecific::u_bbr, udphdr::uh_dport, udphdr::uh_sport, udphdr::uh_sum, udphdr::uh_ulen, V_ip_defttl, V_path_mtu_discovery, V_tcp_udp_tunneling_port, and xchg.
Referenced by __ctf_process_rst(), bbr_timeout_keepalive(), bbr_timeout_persist(), ctf_challenge_ack(), rack_timeout_keepalive(), rack_timeout_persist(), tcp_do_segment(), tcp_dropwithreset(), tcp_timer_keep(), and tcp_twcheck().
void tcp_state_change | ( | struct tcpcb * | tp, |
int | newstate | ||
) |
Definition at line 3999 of file tcp_subr.c.
References tcpcb::t_state, TCP_PROBE6, TCPSTATES_DEC, and TCPSTATES_INC.
Referenced by __ctf_process_rst(), bbr_do_fin_wait_1(), bbr_do_syn_recv(), bbr_do_syn_sent(), bbr_process_data(), rack_do_compressed_ack_processing(), rack_do_fin_wait_1(), rack_do_syn_recv(), rack_do_syn_sent(), rack_process_data(), syncache_socket(), tcp_close(), tcp_do_segment(), tcp_drop(), tcp_twstart(), and tcp_usrclosed().
void tcp_switch_back_to_default | ( | struct tcpcb * | tp | ) |
Definition at line 523 of file tcp_subr.c.
References find_and_ref_tcp_default_fb(), find_and_ref_tcp_fb(), tcpcb::t_fb, tcp_def_funcblk, tcp_function_block::tfb_refcnt, tcp_function_block::tfb_tcp_fb_fini, tcp_function_block::tfb_tcp_fb_init, and tcp_function_block::tfb_tcp_handoff_ok.
Referenced by bbr_do_segment_nounlock(), deregister_tcp_functions(), and rack_do_segment_nounlock().
|
static |
Definition at line 3751 of file tcp_subr.c.
References sysctl_setsockopt(), tcp_ctloutput_set(), and V_tcbinfo.
|
static |
Definition at line 1407 of file tcp_subr.c.
References HHOOK_TCP_EST_IN, HHOOK_TCP_EST_OUT, in_pcbinfo_init(), syncache_init(), tcp_fastopen_init(), tcp_hc_init(), TCP_NSTATES, tcp_stats_init(), tcp_tcbhashsize, tcp_tw_init(), TCPTV_MSL, V_sack_hole_zone, V_tcbinfo, V_tcp_do_sack, V_tcp_msl, V_tcpcb_zone, and V_tcps_states.
Definition at line 1637 of file tcp_subr.c.
References inpcb::inp_flow, inpcb::inp_ip_tos, inpcb::inp_ip_ttl, INP_IPV6, inpcb::inp_vflag, INP_WLOCK_ASSERT, ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip::ip_hl, ip::ip_id, ip::ip_len, ip::ip_off, ip::ip_p, ip::ip_sum, ip::ip_tos, ip::ip_ttl, ip::ip_v, IPPROTO_TCP, IPPROTO_UDP, IPV6_FLOWINFO_MASK, IPV6_VERSION, IPV6_VERSION_MASK, IPVERSION, and tcp_set_flags().
Referenced by bbr_output_wtime(), rack_init_fsb_block(), rack_output(), tcp_default_output(), tcp_twrespond(), and tcpip_maketemplate().
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().
VNET_DEFINE | ( | int | , |
tcp_do_rfc1323 | |||
) |
VNET_DEFINE | ( | int | , |
tcp_minmss | |||
) |
VNET_DEFINE | ( | int | , |
tcp_mssdflt | |||
) |
VNET_DEFINE | ( | int | , |
tcp_tolerate_missing_ts | |||
) |
VNET_DEFINE | ( | int | , |
tcp_ts_offset_per_conn | |||
) |
VNET_DEFINE | ( | int | , |
tcp_udp_tunneling_overhead | |||
) |
VNET_DEFINE | ( | int | , |
tcp_udp_tunneling_port | |||
) |
|
pure virtual |
|
pure virtual |
VNET_DEFINE | ( | uma_zone_t | , |
sack_hole_zone | |||
) |
VNET_DEFINE_STATIC | ( | int | , |
icmp_may_rst | |||
) |
VNET_DEFINE_STATIC | ( | int | , |
isn_last | |||
) |
VNET_DEFINE_STATIC | ( | int | , |
isn_last_reseed | |||
) |
|
pure virtual |
VNET_DEFINE_STATIC | ( | u_char | , |
isn_secret | [ISN_SECRET_LENGTH] | ||
) |
VNET_DEFINE_STATIC | ( | u_char | , |
ts_offset_secret | [TS_OFFSET_SECRET_LENGTH] | ||
) |
VNET_DEFINE_STATIC | ( | u_int32_t | , |
isn_offset | |||
) |
VNET_DEFINE_STATIC | ( | u_int32_t | , |
isn_offset_old | |||
) |
VNET_DEFINE_STATIC | ( | uma_zone_t | , |
tcpcb_zone | |||
) |
VNET_SYSINIT | ( | tcp_vnet_init | , |
SI_SUB_PROTO_DOMAIN | , | ||
SI_ORDER_FOURTH | , | ||
tcp_vnet_init | , | ||
NULL | |||
) |
|
static |
Definition at line 311 of file tcp_subr.c.
Referenced by tcp_drain().
|
static |
Definition at line 1143 of file tcp_subr.c.
|
static |
Definition at line 1172 of file tcp_subr.c.
Referenced by register_tcp_functions_as_names().
|
static |
Definition at line 292 of file tcp_subr.c.
Referenced by tcp_can_enable_pacing(), and tcp_decrement_paced_conn().
|
static |
Definition at line 293 of file tcp_subr.c.
Referenced by tcp_can_enable_pacing(), and tcp_decrement_paced_conn().
struct tcp_funchead t_functions |
Definition at line 393 of file tcp_subr.c.
Referenced by deregister_tcp_functions(), find_tcp_fb_locked(), find_tcp_function_alias(), find_tcp_functions_locked(), register_tcp_functions_as_names(), sysctl_net_inet_list_available(), sysctl_net_inet_list_func_info(), and tcp_init().
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().
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().
|
static |
Definition at line 382 of file tcp_subr.c.
Referenced by deregister_tcp_functions(), tcp_init(), and tcp_switch_back_to_default().
|
static |
Definition at line 392 of file tcp_subr.c.
Referenced by deregister_tcp_functions(), register_tcp_functions_as_names(), and sysctl_net_inet_list_func_info().
|
static |
Definition at line 394 of file tcp_subr.c.
Referenced by deregister_tcp_functions(), find_and_ref_tcp_default_fb(), sysctl_net_inet_default_tcp_functions(), sysctl_net_inet_list_available(), and tcp_newtcpcb().
struct rwlock tcp_function_lock |
Definition at line 210 of file tcp_subr.c.
Referenced by deregister_tcp_functions(), find_and_ref_tcp_default_fb(), find_and_ref_tcp_fb(), find_and_ref_tcp_functions(), find_tcp_function_alias(), register_tcp_functions_as_names(), sysctl_net_inet_default_tcp_functions(), sysctl_net_inet_list_available(), sysctl_net_inet_list_func_info(), tcp_init(), and tcp_newtcpcb().
|
static |
Definition at line 303 of file tcp_subr.c.
Referenced by tcp_log_addrs().
|
static |
Definition at line 295 of file tcp_subr.c.
Referenced by tcp_can_enable_pacing(), and tcp_decrement_paced_conn().
|
static |
Definition at line 4123 of file tcp_subr.c.
Referenced by tcp_decrement_paced_conn().
|
static |
Definition at line 330 of file tcp_subr.c.
Referenced by tcp_init().
|
static |
Definition at line 307 of file tcp_subr.c.
Referenced by tcp_init(), and tcp_vnet_init().