FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_tcpdebug.h"
#include <sys/param.h>
#include <sys/arb.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/qmath.h>
#include <sys/sdt.h>
#include <sys/signalvar.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/stats.h>
#include <machine/cpu.h>
#include <vm/uma.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/route.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/in_kdtrace.h>
#include <netinet/in_pcb.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/icmp_var.h>
#include <netinet/ip_var.h>
#include <netinet/ip_options.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#include <netinet6/in6_pcb.h>
#include <netinet6/in6_var.h>
#include <netinet6/ip6_var.h>
#include <netinet6/nd6.h>
#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_log_buf.h>
#include <netinet/tcp_seq.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet6/tcp6_var.h>
#include <netinet/tcpip.h>
#include <netinet/cc/cc.h>
#include <netinet/tcp_fastopen.h>
#include <netinet/tcp_syncache.h>
#include <netinet/tcp_ecn.h>
#include <netinet/udp.h>
#include <netipsec/ipsec_support.h>
#include <machine/in_cksum.h>
#include <security/mac/mac_framework.h>
Go to the source code of this file.
Macros | |
#define | TCPSTATES /* for logging */ |
#define | V_blackhole VNET(blackhole) |
#define | V_blackhole_local VNET(blackhole_local) |
#define | V_tcp_recvspace VNET(tcp_recvspace) |
#define | DELAY_ACK(tp, tlen) |
Functions | |
__FBSDID ("$FreeBSD$") | |
VNET_DEFINE (int, tcp_log_in_vain)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, log_in_vain, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_log_in_vain), 0, "Log all incoming TCP segments to closed ports") | |
VNET_DEFINE (int, blackhole)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, blackhole, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(blackhole), 0, "Do not send RST on segments to closed ports") | |
VNET_DEFINE (bool, blackhole_local) | |
SYSCTL_BOOL (_net_inet_tcp, OID_AUTO, blackhole_local, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(blackhole_local), false, "Enforce net.inet.tcp.blackhole for locally originated packets") | |
VNET_DEFINE (int, tcp_delack_enabled) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_delack_enabled), 0, "Delay ACK to try and piggyback it onto a data packet") | |
VNET_DEFINE (int, drop_synfin)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set") | |
VNET_DEFINE (int, tcp_do_prr_conservative)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, do_prr_conservative, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_prr_conservative), 0, "Do conservative Proportional Rate Reduction") | |
VNET_DEFINE (int, tcp_do_prr) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, do_prr, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_prr), 1, "Enable Proportional Rate Reduction per RFC 6937") | |
VNET_DEFINE (int, tcp_do_lrd)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, do_lrd, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_lrd), 1, "Perform Lost Retransmission Detection") | |
VNET_DEFINE (int, tcp_do_newcwv)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, newcwv, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_newcwv), 0, "Enable New Congestion Window Validation per RFC7661") | |
VNET_DEFINE (int, tcp_do_rfc3042) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3042), 0, "Enable RFC 3042 (Limited Transmit)") | |
VNET_DEFINE (int, tcp_do_rfc3390) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)") | |
VNET_DEFINE (int, tcp_initcwnd_segments) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, initcwnd_segments, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_initcwnd_segments), 0, "Slow-start flight size (initial congestion window) in number of segments") | |
VNET_DEFINE (int, tcp_do_rfc3465) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, "Enable RFC 3465 (Appropriate Byte Counting)") | |
VNET_DEFINE (int, tcp_abc_l_var) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments") | |
static | SYSCTL_NODE (_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "TCP ECN") |
VNET_DEFINE (int, tcp_do_ecn) | |
SYSCTL_INT (_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_ecn), 0, "TCP ECN support") | |
VNET_DEFINE (int, tcp_ecn_maxretries) | |
SYSCTL_INT (_net_inet_tcp_ecn, OID_AUTO, maxretries, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_ecn_maxretries), 0, "Max retries before giving up on ECN") | |
VNET_DEFINE (int, tcp_insecure_syn)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_insecure_syn), 0, "Follow RFC793 instead of RFC5961 criteria for accepting SYN packets") | |
VNET_DEFINE (int, tcp_insecure_rst)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, "Follow RFC793 instead of RFC5961 criteria for accepting RST packets") | |
VNET_DEFINE (int, tcp_recvspace) | |
SYSCTL_INT (_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size") | |
VNET_DEFINE (int, tcp_do_autorcvbuf) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing") | |
VNET_DEFINE (int, tcp_autorcvbuf_max) | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET|CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, "Max size of automatic receive buffer") | |
VNET_DEFINE (struct inpcbinfo, tcbinfo) | |
VNET_PCPUSTAT_DEFINE (struct tcpstat, tcpstat) | |
SYSCTL_VNET_PCPUSTAT (_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat, tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)") | |
VNET_DEFINE (counter_u64_t, tcps_states[TCP_NSTATES]) | |
SYSCTL_COUNTER_U64_ARRAY (_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD|CTLFLAG_VNET, &VNET_NAME(tcps_states)[0], TCP_NSTATES, "TCP connection counts by TCP state") | |
void | kmod_tcpstat_add (int statnum, int val) |
void | cc_ack_received (struct tcpcb *tp, struct tcphdr *th, uint16_t nsegs, uint16_t type) |
void | cc_conn_init (struct tcpcb *tp) |
void | cc_cong_signal (struct tcpcb *tp, struct tcphdr *th, uint32_t type) |
void | cc_post_recovery (struct tcpcb *tp, struct tcphdr *th) |
void | cc_ecnpkt_handler_flags (struct tcpcb *tp, uint16_t flags, uint8_t iptos) |
void | cc_ecnpkt_handler (struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) |
int | tcp_input_with_port (struct mbuf **mp, int *offp, int proto, uint16_t port) |
int | tcp_autorcvbuf (struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int tlen) |
int | tcp_input (struct mbuf **mp, int *offp, int proto) |
void | tcp_handle_wakeup (struct tcpcb *tp, struct socket *so) |
void | tcp_do_segment (struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos) |
void | tcp_dropwithreset (struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int tlen, int rstreason) |
void | tcp_dooptions (struct tcpopt *to, u_char *cp, int cnt, int flags) |
void | tcp_pulloutofband (struct socket *so, struct tcphdr *th, struct mbuf *m, int off) |
void | tcp_xmit_timer (struct tcpcb *tp, int rtt) |
void | tcp_mss_update (struct tcpcb *tp, int offer, int mtuoffer, struct hc_metrics_lite *metricptr, struct tcp_ifcap *cap) |
void | tcp_mss (struct tcpcb *tp, int offer) |
int | tcp_mssopt (struct in_conninfo *inc) |
void | tcp_do_prr_ack (struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) |
void | tcp_newreno_partial_ack (struct tcpcb *tp, struct tcphdr *th) |
int | tcp_compute_pipe (struct tcpcb *tp) |
uint32_t | tcp_compute_initwnd (uint32_t maxseg) |
Variables | |
const int | tcprexmtthresh = 3 |
#define DELAY_ACK | ( | tp, | |
tlen | |||
) |
Definition at line 510 of file tcp_input.c.
#define TCPSTATES /* for logging */ |
Definition at line 89 of file tcp_input.c.
#define V_blackhole VNET(blackhole) |
Definition at line 143 of file tcp_input.c.
#define V_blackhole_local VNET(blackhole_local) |
Definition at line 149 of file tcp_input.c.
#define V_tcp_recvspace VNET(tcp_recvspace) |
Definition at line 234 of file tcp_input.c.
__FBSDID | ( | "$FreeBSD$" | ) |
Definition at line 297 of file tcp_input.c.
References cc_var::bytes_this_ack, BYTES_THIS_ACK, CC_ACK, CC_ALGO, CCF_ABC_SENTAWND, CCF_CWND_LIMITED, tcpcb::ccv, cc_var::curack, cc_var::flags, tcpcb::gput_ack, tcpcb::gput_seq, tcpcb::gput_ts, IN_RECOVERY, INP_WLOCK_ASSERT, cc_var::nsegs, SEQ_GEQ, tcpcb::snd_cwnd, tcpcb::snd_ssthresh, tcpcb::snd_wnd, tcpcb::t_bytes_acked, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_stats, tcpcb::t_stats_gput_prev, tcp_compute_pipe(), tcp_maxseg(), tcp_ts_getticks(), TF_GPUTINPROG, tcp_hhook_data::th, tcp_hhook_data::tp, V_tcp_do_newcwv, VOI_TCP_ACKLEN, VOI_TCP_CALCFRWINDIFF, VOI_TCP_GPUT, VOI_TCP_GPUT_ND, and VOI_TCP_LCWIN.
Referenced by tcp_do_segment().
Definition at line 424 of file tcp_input.c.
References CC_ALGO, CC_ECN, CC_NDUPACK, CC_RTO, CC_RTO_ERR, tcpcb::ccv, cc_var::curack, ENTER_CONGRECOVERY, ENTER_FASTRECOVERY, EXIT_CONGRECOVERY, EXIT_RECOVERY, IN_CONGRECOVERY, IN_FASTRECOVERY, INP_WLOCK_ASSERT, SEQ_GEQ, tcpcb::snd_cwnd, tcpcb::snd_cwnd_prev, tcpcb::snd_max, tcpcb::snd_nxt, tcpcb::snd_recover, tcpcb::snd_recover_prev, tcpcb::snd_ssthresh, tcpcb::snd_ssthresh_prev, tcpcb::t_badrxtwin, tcpcb::t_bytes_acked, tcpcb::t_dupacks, tcpcb::t_flags, tcpcb::t_flags2, tcpcb::t_inpcb, tcpcb::t_stats, TCPSTAT_INC, TF2_ECN_PERMIT, TF2_ECN_SND_CWR, TF_WASCRECOVERY, TF_WASFRECOVERY, and VOI_TCP_CSIG.
Referenced by tcp_do_segment(), tcp_sack_lost_retransmission(), and tcp_timer_rexmt().
void cc_conn_init | ( | struct tcpcb * | tp | ) |
Definition at line 368 of file tcp_input.c.
References CC_ALGO, tcpcb::ccv, inpcb::inp_inc, INP_WLOCK_ASSERT, hc_metrics_lite::rmx_rtt, hc_metrics_lite::rmx_rttvar, hc_metrics_lite::rmx_ssthresh, tcpcb::snd_cwnd, tcpcb::snd_ssthresh, tcpcb::t_inpcb, tcpcb::t_rttbest, tcpcb::t_rttmin, tcpcb::t_rttvar, tcpcb::t_rxtcur, tcpcb::t_srtt, tcp_compute_initwnd(), tcp_hc_get(), tcp_maxseg(), TCP_RTT_SCALE, TCP_RTTVAR_SCALE, TCPSTAT_INC, TCPT_RANGESET, and TCPTV_REXMTMAX.
Referenced by bbr_do_syn_recv(), bbr_do_syn_sent(), rack_cc_conn_init(), and tcp_do_segment().
Definition at line 550 of file tcp_input.c.
References cc_ecnpkt_handler_flags(), and tcp_get_flags().
Definition at line 517 of file tcp_input.c.
References CC_ALGO, CCF_ACKNOW, CCF_IPHDR_CE, CCF_TCPHDR_CWR, tcpcb::ccv, cc_var::flags, INP_WLOCK_ASSERT, IPTOS_ECN_CE, IPTOS_ECN_ECT0, IPTOS_ECN_ECT1, IPTOS_ECN_MASK, IPTOS_ECN_NOTECT, tcpcb::t_flags, tcpcb::t_inpcb, tcp_delacktime, tcp_timer_activate(), TF_ACKNOW, and TT_DELACK.
Referenced by cc_ecnpkt_handler(), and tcp_ecn_input_segment().
|
inline |
Definition at line 485 of file tcp_input.c.
References CC_ALGO, tcpcb::ccv, cc_var::curack, sackhint::delivered_data, INP_WLOCK_ASSERT, sackhint::prr_out, tcpcb::sackhint, tcpcb::t_bytes_acked, and tcpcb::t_inpcb.
Referenced by tcp_do_segment().
void kmod_tcpstat_add | ( | int | statnum, |
int | val | ||
) |
Definition at line 267 of file tcp_input.c.
SYSCTL_BOOL | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
blackhole_local | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEblackhole_local, | ||
false | , | ||
"Enforce net.inet.tcp.blackhole for locally originated packets" | |||
) |
SYSCTL_COUNTER_U64_ARRAY | ( | _net_inet_tcp | , |
TCPCTL_STATES | , | ||
states | , | ||
CTLFLAG_RD| | CTLFLAG_VNET, | ||
& | VNET_NAME(tcps_states)[0], | ||
TCP_NSTATES | , | ||
"TCP connection counts by TCP state" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
abc_l_var | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_abc_l_var, | ||
2 | , | ||
"Cap the max cwnd increment during slow-start to this number of segments" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
blackhole | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEblackhole, | ||
0 | , | ||
"Do not send RST on segments to closed ports" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
delayed_ack | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_delack_enabled, | ||
0 | , | ||
"Delay ACK to try and piggyback it onto a data packet" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
do_lrd | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_lrd, | ||
1 | , | ||
"Perform Lost Retransmission Detection" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
do_prr | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_prr, | ||
1 | , | ||
"Enable Proportional Rate Reduction per RFC 6937" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
do_prr_conservative | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_prr_conservative, | ||
0 | , | ||
"Do conservative Proportional Rate Reduction" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
drop_synfin | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEdrop_synfin, | ||
0 | , | ||
"Drop TCP packets with SYN+FIN set" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
initcwnd_segments | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_initcwnd_segments, | ||
0 | , | ||
"Slow-start flight size (initial congestion window) in number of segments" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
insecure_rst | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_insecure_rst, | ||
0 | , | ||
"Follow RFC793 instead of RFC5961 criteria for accepting RST packets" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
insecure_syn | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_insecure_syn, | ||
0 | , | ||
"Follow RFC793 instead of RFC5961 criteria for accepting SYN packets" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
log_in_vain | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_log_in_vain, | ||
0 | , | ||
"Log all incoming TCP segments to closed ports" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
newcwv | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_newcwv, | ||
0 | , | ||
"Enable New Congestion Window Validation per RFC7661" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
recvbuf_auto | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_autorcvbuf, | ||
0 | , | ||
"Enable automatic receive buffer sizing" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
recvbuf_max | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_autorcvbuf_max, | ||
0 | , | ||
"Max size of automatic receive buffer" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
rfc3042 | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_rfc3042, | ||
0 | , | ||
"Enable RFC 3042 (Limited Transmit)" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
rfc3390 | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_rfc3390, | ||
0 | , | ||
"Enable RFC 3390 (Increasing TCP's Initial Congestion Window)" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
rfc3465 | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_rfc3465, | ||
0 | , | ||
"Enable RFC 3465 (Appropriate Byte Counting)" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
TCPCTL_RECVSPACE | , | ||
recvspace | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_recvspace, | ||
0 | , | ||
"Initial receive socket buffer size" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp_ecn | , |
OID_AUTO | , | ||
enable | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_do_ecn, | ||
0 | , | ||
"TCP ECN support" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp_ecn | , |
OID_AUTO | , | ||
maxretries | , | ||
CTLFLAG_VNET| | CTLFLAG_RW, | ||
& | VNET_NAMEtcp_ecn_maxretries, | ||
0 | , | ||
"Max retries before giving up on ECN" | |||
) |
|
static |
SYSCTL_VNET_PCPUSTAT | ( | _net_inet_tcp | , |
TCPCTL_STATS | , | ||
stats | , | ||
struct tcpstat | , | ||
tcpstat | , | ||
"TCP statistics (struct tcpstat, netinet/tcp_var.h)" | |||
) |
int tcp_autorcvbuf | ( | struct mbuf * | m, |
struct tcphdr * | th, | ||
struct socket * | so, | ||
struct tcpcb * | tp, | ||
int | tlen | ||
) |
Definition at line 1465 of file tcp_input.c.
References tcpcb::rfbuf_cnt, tcpcb::rfbuf_ts, tcpcb::t_srtt, TCP_PROBE6, TCP_RTT_SHIFT, tcp_ts_getticks(), TCP_TS_TO_TICKS, V_tcp_autorcvbuf_max, and V_tcp_do_autorcvbuf.
Referenced by bbr_do_fastnewdata(), rack_do_fastnewdata(), and tcp_do_segment().
Definition at line 4049 of file tcp_input.c.
References V_tcp_do_rfc3390, and V_tcp_initcwnd_segments.
Referenced by cc_conn_init(), newreno_cc_after_idle(), rack_get_bw(), and rc_init_window().
int tcp_compute_pipe | ( | struct tcpcb * | tp | ) |
Definition at line 4041 of file tcp_input.c.
References sackhint::sack_bytes_rexmit, sackhint::sacked_bytes, tcpcb::sackhint, tcpcb::snd_max, and tcpcb::snd_una.
Referenced by cc_ack_received(), cubic_post_recovery(), htcp_post_recovery(), newreno_cc_post_recovery(), tcp_do_prr_ack(), and tcp_do_segment().
Definition at line 3930 of file tcp_input.c.
References sackhint::delivered_data, IN_CONGRECOVERY, IN_FASTRECOVERY, INP_WLOCK_ASSERT, sackhint::prr_delivered, sackhint::prr_out, sackhint::recover_fs, sackhint::sack_bytes_rexmit, tcpcb::sackhint, tcpcb::snd_cwnd, tcpcb::snd_fack, tcpcb::snd_max, tcpcb::snd_nxt, tcpcb::snd_recover, tcpcb::snd_ssthresh, tcpcb::snd_una, tcpcb::t_dupacks, tcpcb::t_flags, tcpcb::t_inpcb, tcp_compute_pipe(), tcp_maxseg(), tcprexmtthresh, TF_SACK_PERMIT, tcpopt::to_flags, TOF_SACK, V_tcp_do_newsack, and V_tcp_do_prr_conservative.
Referenced by tcp_do_segment().
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 at line 1518 of file tcp_input.c.
References BANDLIM_RST_OPENPORT, BANDLIM_UNLIMITED, BYTES_THIS_ACK, CC_ACK, cc_ack_received(), cc_cong_signal(), cc_conn_init(), CC_DUPACK, CC_ECN, CC_NDUPACK, cc_post_recovery(), CC_RTO_ERR, DELAY_ACK, sackhint::delivered_data, sackblk::end, EXIT_RECOVERY, IN_CONGRECOVERY, IN_FASTRECOVERY, IN_RECOVERY, inpcb::inp_inc, INP_IPV6, inpcb::inp_socket, inpcb::inp_vflag, INP_WLOCK_ASSERT, INP_WUNLOCK, IP6_HDR_LEN, tcpcb::irs, IS_FASTOPEN, tcpcb::iss, tcpcb::last_ack_sent, sackhint::last_sack_ack, tcpcb::max_sndwnd, sackhint::prr_delivered, tcpcb::rcv_adv, tcpcb::rcv_numsacks, tcpcb::rcv_nxt, tcpcb::rcv_scale, tcpcb::rcv_up, tcpcb::rcv_wnd, sackhint::recover_fs, tcpcb::request_r_scale, sackhint::sack_bytes_rexmit, tcpcb::sackblks, sackhint::sacked_bytes, tcpcb::sackhint, SEGQ_EMPTY, SEQ_GEQ, SEQ_GT, SEQ_LEQ, SEQ_LT, tcpcb::snd_cwnd, tcpcb::snd_fack, tcpcb::snd_limited, tcpcb::snd_max, tcpcb::snd_nxt, tcpcb::snd_recover, tcpcb::snd_scale, tcpcb::snd_ssthresh, tcpcb::snd_una, tcpcb::snd_wl1, tcpcb::snd_wl2, tcpcb::snd_wnd, sackblk::start, tcpcb::t_badrxtwin, tcpcb::t_dupacks, tcpcb::t_fbyte_in, tcpcb::t_fbyte_out, tcpcb::t_flags, tcpcb::t_flags2, tcpcb::t_inpcb, tcpcb::t_oobflags, tcpcb::t_rcvtime, tcpcb::t_rtseq, tcpcb::t_rttlow, tcpcb::t_rtttime, tcpcb::t_rxtcur, tcpcb::t_rxtshift, tcpcb::t_starttime, tcpcb::t_state, tcpcb::t_stats, tcpcb::t_tfo_pending, TA_DROP, TA_INPUT, tcp_autorcvbuf(), tcp_clean_sackreport(), tcp_close(), tcp_compute_pipe(), tcp_delacktime, tcp_do_prr_ack(), tcp_dooptions(), tcp_drop(), tcp_dropwithreset(), tcp_ecn_input_parallel_syn(), tcp_ecn_input_segment(), tcp_ecn_input_syn_sent(), tcp_fast_finwait2_recycle, tcp_fastopen_decrement_counter(), tcp_fastopen_disable_path(), tcp_fastopen_update_cache(), tcp_finwait2_timeout, tcp_get_flags(), tcp_handle_wakeup(), tcp_log_addrs(), TCP_LOG_EVENT, TCP_LOG_IN, tcp_maxseg(), tcp_mss(), tcp_newreno_partial_ack(), TCP_PAWS_IDLE, tcp_pcap_add(), TCP_PROBE3, TCP_PROBE5, tcp_pulloutofband(), tcp_rcvseqinit, tcp_reass(), tcp_respond(), tcp_sack_doack(), tcp_sack_lost_retransmission(), tcp_sack_partialack(), tcp_state_change(), tcp_timer_activate(), tcp_timer_active(), tcp_trace(), tcp_ts_getticks(), TCP_TS_TO_TICKS, tcp_twstart(), tcp_update_dsack_list(), tcp_update_sack_list(), tcp_xmit_timer(), TCPOOB_HADDATA, TCPOOB_HAVEDATA, tcprexmtthresh, TCPS_CLOSE_WAIT, TCPS_CLOSING, TCPS_ESTABLISHED, TCPS_FIN_WAIT_1, TCPS_FIN_WAIT_2, TCPS_HAVEESTABLISHED, TCPS_HAVERCVDFIN, TCPS_LAST_ACK, TCPS_LISTEN, TCPS_SYN_RECEIVED, TCPS_SYN_SENT, TCPS_TIME_WAIT, TCPSTAT_ADD, TCPSTAT_INC, TF2_FBYTES_COMPLETE, TF_ACKNOW, TF_DELACK, TF_LRD, TF_NEEDFIN, TF_NEEDSYN, TF_NOOPT, TF_PREVVALID, TF_RCVD_SCALE, TF_RCVD_TSTMP, TF_REQ_SCALE, TF_REQ_TSTMP, TF_SACK_PERMIT, TF_SENTFIN, TF_SIGNATURE, TF_WAKESOR, tcpopt::to_flags, tcpopt::to_mss, TO_SYN, tcpopt::to_tfo_cookie, tcpopt::to_tfo_len, tcpopt::to_tsecr, tcpopt::to_tsval, tcpopt::to_wscale, TOF_FASTOPEN, TOF_MSS, TOF_SACK, TOF_SACKPERM, TOF_SCALE, TOF_SIGNATURE, TOF_TS, TP_KEEPIDLE, TP_MAXIDLE, tcpcb::ts_offset, tcpcb::ts_recent, tcpcb::ts_recent_age, TSTMP_GEQ, TSTMP_GT, TSTMP_LT, TT_2MSL, TT_DELACK, TT_KEEP, TT_PERSIST, TT_REXMT, V_drop_synfin, V_tcp_do_newsack, V_tcp_do_prr, V_tcp_do_rfc3042, V_tcp_insecure_rst, V_tcp_insecure_syn, V_tcp_tolerate_missing_ts, and VOI_TCP_FRWIN.
void tcp_dooptions | ( | struct tcpopt * | to, |
u_char * | cp, | ||
int | cnt, | ||
int | flags | ||
) |
Definition at line 3422 of file tcp_input.c.
References TCPSTAT_INC, tcpopt::to_flags, tcpopt::to_mss, tcpopt::to_nsacks, tcpopt::to_sacks, tcpopt::to_signature, TO_SYN, tcpopt::to_tfo_cookie, tcpopt::to_tfo_len, tcpopt::to_tsecr, tcpopt::to_tsval, tcpopt::to_wscale, TOF_FASTOPEN, TOF_MSS, TOF_SACK, TOF_SACKPERM, TOF_SCALE, TOF_SIGNATURE, TOF_TS, V_tcp_do_sack, V_tcp_fastopen_client_enable, and V_tcp_fastopen_server_enable.
Referenced by bbr_do_segment_nounlock(), rack_do_segment_nounlock(), tcp_do_segment(), and tcp_input_with_port().
void tcp_dropwithreset | ( | struct mbuf * | m, |
struct tcphdr * | th, | ||
struct tcpcb * | tp, | ||
int | tlen, | ||
int | rstreason | ||
) |
Definition at line 3357 of file tcp_input.c.
References badport_bandlim(), in_broadcast(), INADDR_BROADCAST, INP_LOCK_ASSERT, ip6_hdr::ip6_dst, ip6_hdr::ip6_src, ip::ip_dst, ip_v, in_addr::s_addr, tcpcb::t_inpcb, tcp_get_flags(), and tcp_respond().
Referenced by ctf_do_dropwithreset(), ctf_do_dropwithreset_conn(), tcp_do_segment(), and tcp_input_with_port().
void tcp_handle_wakeup | ( | struct tcpcb * | tp, |
struct socket * | so | ||
) |
Definition at line 1496 of file tcp_input.c.
References INP_LOCK_ASSERT, tcpcb::t_flags, tcpcb::t_inpcb, and TF_WAKESOR.
Referenced by tcp_do_segment().
int tcp_input | ( | struct mbuf ** | mp, |
int * | offp, | ||
int | proto | ||
) |
Definition at line 1490 of file tcp_input.c.
References tcp_input_with_port().
int tcp_input_with_port | ( | struct mbuf ** | mp, |
int * | offp, | ||
int | proto, | ||
uint16_t | port | ||
) |
Definition at line 608 of file tcp_input.c.
References BANDLIM_RST_CLOSEDPORT, BANDLIM_RST_OPENPORT, BANDLIM_UNLIMITED, ipovly::ih_len, ipovly::ih_x1, in_broadcast(), in_localip(), in_pcblookup(), in_pcblookup_mbuf(), in_pseudo(), INADDR_BROADCAST, in_conninfo::inc_fibnum, in_conninfo::inc_flags, INC_IPV6MINMTU, INC_ISIPV6, INP_DROPPED, inpcb::inp_flags, inpcb::inp_flowid, inpcb::inp_flowtype, inpcb::inp_inc, inpcb::inp_ip_minttl, INP_LOCK_ASSERT, INP_RLOCK_ASSERT, inpcb::inp_socket, INP_TIMEWAIT, INP_TRY_UPGRADE, INP_UNLOCK, INP_WLOCK_ASSERT, INPLOOKUP_RLOCKPCB, INPLOOKUP_WILDCARD, INPLOOKUP_WLOCKPCB, intotcpcb, ip6_hdr::ip6_dst, IP6_HDR_LEN, ip6_hdr::ip6_src, ip::ip_dst, ip::ip_hl, ip::ip_len, ip_stripoptions(), ip::ip_tos, ip::ip_ttl, ip::ip_v, IPPROTO_TCP, IPV6_TRAFFIC_CLASS, IPVERSION, in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_port, sotoinpcb, syncache_add(), syncache_badack(), syncache_chkrst(), syncache_expand(), tcpcb::t_fb, tcpcb::t_flags, tcpcb::t_port, tcpcb::t_state, TA_INPUT, tcp_dooptions(), tcp_dropwithreset(), tcp_fields_to_host(), tcp_get_flags(), tcp_log_addrs(), tcp_log_vain(), tcp_offload_input(), TCP_PROBE3, TCP_PROBE5, tcp_trace(), tcp_twcheck(), TCPS_CLOSED, TCPS_LISTEN, TCPS_SYN_RECEIVED, TCPSTAT_INC, TF_SIGNATURE, TF_TOE, tcp_function_block::tfb_tcp_do_segment, tcpopt::to_flags, tcpopt::to_signature, TO_SYN, TOF_SIGNATURE, V_blackhole, V_blackhole_local, V_drop_synfin, V_tcbinfo, V_tcp_log_in_vain, and V_tcp_sc_rst_sock_fail.
Referenced by tcp_input(), and tcp_recv_udp_tunneled_packet().
void tcp_mss | ( | struct tcpcb * | tp, |
int | offer | ||
) |
Definition at line 3814 of file tcp_input.c.
References tcp_ifcap::ifcap, inpcb::inp_socket, hc_metrics_lite::rmx_recvpipe, hc_metrics_lite::rmx_sendpipe, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_maxseg, tcpcb::t_tsomax, tcpcb::t_tsomaxsegcount, tcpcb::t_tsomaxsegsize, tcp_mss_update(), TF_TSO, tcp_ifcap::tsomax, tcp_ifcap::tsomaxsegcount, tcp_ifcap::tsomaxsegsize, V_tcp_recvspace, and V_tcp_sendspace.
Referenced by bbr_do_segment_nounlock(), rack_do_segment_nounlock(), syncache_socket(), tcp_do_segment(), tcp_fastopen_connect(), and tcp_usr_send().
void tcp_mss_update | ( | struct tcpcb * | tp, |
int | offer, | ||
int | mtuoffer, | ||
struct hc_metrics_lite * | metricptr, | ||
struct tcp_ifcap * | cap | ||
) |
Definition at line 3665 of file tcp_input.c.
References in_localaddr(), inpcb::inp_inc, INP_IPV6, inpcb::inp_vflag, INP_WLOCK_ASSERT, hc_metrics_lite::rmx_mtu, tcpcb::t_inpcb, tcpcb::t_maxseg, tcp_hc_get(), tcp_maxmtu(), tcp_maxmtu6(), V_path_mtu_discovery, V_tcp_minmss, V_tcp_mssdflt, and V_tcp_udp_tunneling_overhead.
Referenced by bbr_output_wtime(), rack_output(), tcp_default_output(), tcp_mss(), and tcp_mtudisc().
int tcp_mssopt | ( | struct in_conninfo * | inc | ) |
Definition at line 3891 of file tcp_input.c.
References in_conninfo::inc_flags, INC_ISIPV6, tcp_hc_getmtu(), tcp_maxmtu(), tcp_maxmtu6(), and V_tcp_mssdflt.
Referenced by bbr_output_wtime(), rack_output(), syncache_respond(), and tcp_default_output().
void tcp_newreno_partial_ack | ( | struct tcpcb * | tp, |
struct tcphdr * | th | ||
) |
Definition at line 4008 of file tcp_input.c.
References BYTES_THIS_ACK, INP_WLOCK_ASSERT, SEQ_GT, tcpcb::snd_cwnd, tcpcb::snd_nxt, tcpcb::t_flags, tcpcb::t_inpcb, tcpcb::t_rtttime, tcp_maxseg(), tcp_timer_activate(), TF_ACKNOW, and TT_REXMT.
Referenced by tcp_do_segment().
void tcp_pulloutofband | ( | struct socket * | so, |
struct tcphdr * | th, | ||
struct mbuf * | m, | ||
int | off | ||
) |
Definition at line 3530 of file tcp_input.c.
References INP_WLOCK_ASSERT, sototcpcb, tcpcb::t_inpcb, tcpcb::t_iobc, tcpcb::t_oobflags, and TCPOOB_HAVEDATA.
Referenced by tcp_do_segment().
void tcp_xmit_timer | ( | struct tcpcb * | tp, |
int | rtt | ||
) |
Definition at line 3563 of file tcp_input.c.
References INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_rttbest, tcpcb::t_rttmin, tcpcb::t_rtttime, tcpcb::t_rttupdated, tcpcb::t_rttvar, tcpcb::t_rxtcur, tcpcb::t_rxtshift, tcpcb::t_softerror, tcpcb::t_srtt, tcpcb::t_stats, TCP_DELTA_SHIFT, TCP_REXMTVAL, TCP_RTT_INVALIDATE, TCP_RTT_SHIFT, TCP_RTTVAR_SHIFT, TCPSTAT_INC, TCPT_RANGESET, TCPTV_REXMTMAX, and VOI_TCP_RTT.
Referenced by tcp_do_segment().
VNET_DEFINE | ( | bool | , |
blackhole_local | |||
) |
VNET_DEFINE | ( | counter_u64_t | , |
tcps_states | [TCP_NSTATES] | ||
) |
|
pure virtual |
|
pure virtual |
VNET_DEFINE | ( | int | , |
tcp_abc_l_var | |||
) |
VNET_DEFINE | ( | int | , |
tcp_autorcvbuf_max | |||
) |
VNET_DEFINE | ( | int | , |
tcp_delack_enabled | |||
) |
VNET_DEFINE | ( | int | , |
tcp_do_autorcvbuf | |||
) |
VNET_DEFINE | ( | int | , |
tcp_do_ecn | |||
) |
|
pure virtual |
|
pure virtual |
VNET_DEFINE | ( | int | , |
tcp_do_prr | |||
) |
|
pure virtual |
VNET_DEFINE | ( | int | , |
tcp_do_rfc3042 | |||
) |
VNET_DEFINE | ( | int | , |
tcp_do_rfc3390 | |||
) |
VNET_DEFINE | ( | int | , |
tcp_do_rfc3465 | |||
) |
VNET_DEFINE | ( | int | , |
tcp_ecn_maxretries | |||
) |
VNET_DEFINE | ( | int | , |
tcp_initcwnd_segments | |||
) |
|
pure virtual |
|
pure virtual |
|
pure virtual |
VNET_DEFINE | ( | int | , |
tcp_recvspace | |||
) |
VNET_DEFINE | ( | struct inpcbinfo | , |
tcbinfo | |||
) |
const int tcprexmtthresh = 3 |
Definition at line 135 of file tcp_input.c.
Referenced by tcp_do_prr_ack(), and tcp_do_segment().