Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_subr.c
Context not available. | |||||
#include <netinet/tcp_seq.h> | #include <netinet/tcp_seq.h> | ||||
#include <netinet/tcp_timer.h> | #include <netinet/tcp_timer.h> | ||||
#include <netinet/tcp_var.h> | #include <netinet/tcp_var.h> | ||||
#include <netinet/tcp_log_buf.h> | |||||
#include <netinet/tcp_syncache.h> | #include <netinet/tcp_syncache.h> | ||||
#include <netinet/cc/cc.h> | #include <netinet/cc/cc.h> | ||||
#ifdef INET6 | #ifdef INET6 | ||||
Context not available. | |||||
/* Setup the tcp function block list */ | /* Setup the tcp function block list */ | ||||
init_tcp_functions(); | init_tcp_functions(); | ||||
register_tcp_functions(&tcp_def_funcblk, M_WAITOK); | register_tcp_functions(&tcp_def_funcblk, M_WAITOK); | ||||
/* Initialize the TCP logging data. */ | |||||
tcp_log_init(); | |||||
if (tcp_soreceive_stream) { | if (tcp_soreceive_stream) { | ||||
#ifdef INET | #ifdef INET | ||||
Context not available. | |||||
*/ | */ | ||||
tcp_pcap_tcpcb_init(tp); | tcp_pcap_tcpcb_init(tp); | ||||
#endif | #endif | ||||
/* Initialize the per-TCPCB log data. */ | |||||
tcp_log_tcpcbinit(tp); | |||||
if (tp->t_fb->tfb_tcp_fb_init) { | if (tp->t_fb->tfb_tcp_fb_init) { | ||||
(*tp->t_fb->tfb_tcp_fb_init)(tp); | (*tp->t_fb->tfb_tcp_fb_init)(tp); | ||||
} | } | ||||
Context not available. | |||||
inp->inp_ppcb = NULL; | inp->inp_ppcb = NULL; | ||||
if (tp->t_timers->tt_draincnt == 0) { | if (tp->t_timers->tt_draincnt == 0) { | ||||
/* We own the last reference on tcpcb, let's free it. */ | /* We own the last reference on tcpcb, let's free it. */ | ||||
tcp_log_tcpcbfini(tp); | |||||
TCPSTATES_DEC(tp->t_state); | TCPSTATES_DEC(tp->t_state); | ||||
if (tp->t_fb->tfb_tcp_fb_fini) | if (tp->t_fb->tfb_tcp_fb_fini) | ||||
(*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); | (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); | ||||
Context not available. | |||||
tp->t_timers->tt_draincnt--; | tp->t_timers->tt_draincnt--; | ||||
if (tp->t_timers->tt_draincnt == 0) { | if (tp->t_timers->tt_draincnt == 0) { | ||||
/* We own the last reference on this tcpcb, let's free it. */ | /* We own the last reference on this tcpcb, let's free it. */ | ||||
tcp_log_tcpcbfini(tp); | |||||
TCPSTATES_DEC(tp->t_state); | TCPSTATES_DEC(tp->t_state); | ||||
if (tp->t_fb->tfb_tcp_fb_fini) | if (tp->t_fb->tfb_tcp_fb_fini) | ||||
(*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); | (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); | ||||
Context not available. | |||||
if ((tcpb = intotcpcb(inpb)) != NULL) { | if ((tcpb = intotcpcb(inpb)) != NULL) { | ||||
tcp_reass_flush(tcpb); | tcp_reass_flush(tcpb); | ||||
tcp_clean_sackreport(tcpb); | tcp_clean_sackreport(tcpb); | ||||
tcp_log_drain(tcpb); | |||||
#ifdef TCPPCAP | #ifdef TCPPCAP | ||||
if (tcp_pcap_aggressive_free) { | if (tcp_pcap_aggressive_free) { | ||||
/* Free the TCP PCAP queues. */ | /* Free the TCP PCAP queues. */ | ||||
Context not available. | |||||
bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, | bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, | ||||
TCP_FUNCTION_NAME_LEN_MAX); | TCP_FUNCTION_NAME_LEN_MAX); | ||||
bzero(xt->xt_logid, TCP_LOG_ID_LEN); | |||||
(void)tcp_log_get_id(tp, xt->xt_logid); | |||||
} | } | ||||
xt->xt_len = sizeof(struct xtcpcb); | xt->xt_len = sizeof(struct xtcpcb); | ||||
Context not available. |