Lines Matching refs:tp
325 ctf_process_inbound_raw(struct tcpcb *tp, struct mbuf *m, int has_pkt) in ctf_process_inbound_raw() argument
366 inp = tptoinpcb(tp); in ctf_process_inbound_raw()
385 ("tp:%p m:%p etype:0x%x -- not IP or IPv6", tp, m, etype)); in ctf_process_inbound_raw()
431 KASSERT((tp->t_flags2 & TF2_MBUF_ACKCMP), in ctf_process_inbound_raw()
432 ("tp:%p no TF2_MBUF_ACKCMP flags?", tp)); in ctf_process_inbound_raw()
447 retval = (*tp->t_fb->tfb_do_segment_nounlock)(tp, m, th, in ctf_process_inbound_raw()
470 ctf_do_queued_segments(struct tcpcb *tp, int have_pkt) in ctf_do_queued_segments() argument
475 if ((m = STAILQ_FIRST(&tp->t_inqueue)) != NULL) { in ctf_do_queued_segments()
476 STAILQ_INIT(&tp->t_inqueue); in ctf_do_queued_segments()
477 if (ctf_process_inbound_raw(tp, m, have_pkt)) { in ctf_do_queued_segments()
486 ctf_outstanding(struct tcpcb *tp) in ctf_outstanding() argument
490 bytes_out = tp->snd_max - tp->snd_una; in ctf_outstanding()
491 if (tp->t_state < TCPS_ESTABLISHED) in ctf_outstanding()
493 if (tp->t_flags & TF_SENTFIN) in ctf_outstanding()
499 ctf_flight_size(struct tcpcb *tp, uint32_t rc_sacked) in ctf_flight_size() argument
501 if (rc_sacked <= ctf_outstanding(tp)) in ctf_flight_size()
502 return(ctf_outstanding(tp) - rc_sacked); in ctf_flight_size()
509 ctf_do_dropwithreset(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, in ctf_do_dropwithreset() argument
512 if (tp != NULL) { in ctf_do_dropwithreset()
513 tcp_dropwithreset(m, th, tp, tlen, rstreason); in ctf_do_dropwithreset()
514 INP_WUNLOCK(tptoinpcb(tp)); in ctf_do_dropwithreset()
520 ctf_ack_war_checks(struct tcpcb *tp) in ctf_ack_war_checks() argument
526 if (tp->t_challenge_ack_end < now) { in ctf_ack_war_checks()
527 tp->t_challenge_ack_cnt = 0; in ctf_ack_war_checks()
528 tp->t_challenge_ack_end = now + in ctf_ack_war_checks()
531 if (tp->t_challenge_ack_cnt < V_tcp_ack_war_cnt) { in ctf_ack_war_checks()
532 tp->t_challenge_ack_cnt++; in ctf_ack_war_checks()
533 tp->t_flags |= TF_ACKNOW; in ctf_ack_war_checks()
535 tp->t_flags &= ~TF_ACKNOW; in ctf_ack_war_checks()
537 tp->t_flags |= TF_ACKNOW; in ctf_ack_war_checks()
548 struct tcpcb *tp, int32_t *tlenp, in ctf_drop_checks() argument
557 todrop = tp->rcv_nxt - th->th_seq; in ctf_drop_checks()
583 ctf_ack_war_checks(tp); in ctf_drop_checks()
594 if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { in ctf_drop_checks()
599 ctf_ack_war_checks(tp); in ctf_drop_checks()
600 if (tp->t_flags & TF_ACKNOW) in ctf_drop_checks()
601 tcp_update_sack_list(tp, th->th_seq, in ctf_drop_checks()
618 todrop = (th->th_seq + tlen) - (tp->rcv_nxt + tp->rcv_wnd); in ctf_drop_checks()
630 if (tp->rcv_wnd == 0 && th->th_seq == tp->rcv_nxt) { in ctf_drop_checks()
631 ctf_ack_war_checks(tp); in ctf_drop_checks()
634 ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val); in ctf_drop_checks()
655 ctf_do_dropafterack(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t thflags, int32_t t… in ctf_do_dropafterack() argument
671 if (tp->t_state == TCPS_SYN_RECEIVED && (thflags & TH_ACK) && in ctf_do_dropafterack()
672 (SEQ_GT(tp->snd_una, th->th_ack) || in ctf_do_dropafterack()
673 SEQ_GT(th->th_ack, tp->snd_max))) { in ctf_do_dropafterack()
675 ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); in ctf_do_dropafterack()
679 ctf_ack_war_checks(tp); in ctf_do_dropafterack()
685 ctf_do_drop(struct mbuf *m, struct tcpcb *tp) in ctf_do_drop() argument
691 if (tp != NULL) in ctf_do_drop()
692 INP_WUNLOCK(tptoinpcb(tp)); in ctf_do_drop()
699 struct tcpcb *tp) in ctf_process_rst() argument
713 if ((SEQ_GEQ(th->th_seq, tp->last_ack_sent) && in ctf_process_rst()
714 SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) || in ctf_process_rst()
715 (tp->rcv_wnd == 0 && tp->last_ack_sent == th->th_seq)) { in ctf_process_rst()
716 KASSERT(tp->t_state != TCPS_SYN_SENT, in ctf_process_rst()
718 __func__, th, tp)); in ctf_process_rst()
721 (tp->last_ack_sent == th->th_seq) || in ctf_process_rst()
722 (tp->rcv_nxt == th->th_seq)) { in ctf_process_rst()
725 switch (tp->t_state) { in ctf_process_rst()
737 tcp_state_change(tp, TCPS_CLOSED); in ctf_process_rst()
740 tcp_log_end_status(tp, TCP_EI_STATUS_CLIENT_RST); in ctf_process_rst()
741 tp = tcp_close(tp); in ctf_process_rst()
744 ctf_do_drop(m, tp); in ctf_process_rst()
747 tcp_send_challenge_ack(tp, th, m); in ctf_process_rst()
762 ctf_challenge_ack(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, uint8_t iptos, int32_t * ret… in ctf_challenge_ack() argument
769 SEQ_GEQ(th->th_seq, tp->last_ack_sent) && in ctf_challenge_ack()
770 SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) { in ctf_challenge_ack()
771 tp = tcp_drop(tp, ECONNRESET); in ctf_challenge_ack()
773 ctf_do_drop(m, tp); in ctf_challenge_ack()
775 tcp_ecn_input_syn_sent(tp, tcp_get_flags(th), iptos); in ctf_challenge_ack()
777 tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, in ctf_challenge_ack()
778 tp->snd_nxt, TH_ACK); in ctf_challenge_ack()
779 tp->last_ack_sent = tp->rcv_nxt; in ctf_challenge_ack()
794 ctf_ts_check(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, in ctf_ts_check() argument
798 if (tcp_ts_getticks() - tp->ts_recent_age > TCP_PAWS_IDLE) { in ctf_ts_check()
809 tp->ts_recent = 0; in ctf_ts_check()
816 ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val); in ctf_ts_check()
826 ctf_ts_check_ac(struct tcpcb *tp, int32_t thflags) in ctf_ts_check_ac() argument
829 if (tcp_ts_getticks() - tp->ts_recent_age > TCP_PAWS_IDLE) { in ctf_ts_check_ac()
840 tp->ts_recent = 0; in ctf_ts_check_ac()
852 ctf_calc_rwin(struct socket *so, struct tcpcb *tp) in ctf_calc_rwin() argument
864 tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); in ctf_calc_rwin()
868 ctf_do_dropwithreset_conn(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, in ctf_do_dropwithreset_conn() argument
872 tcp_dropwithreset(m, th, tp, tlen, rstreason); in ctf_do_dropwithreset_conn()
873 tp = tcp_drop(tp, ETIMEDOUT); in ctf_do_dropwithreset_conn()
874 if (tp) in ctf_do_dropwithreset_conn()
875 INP_WUNLOCK(tptoinpcb(tp)); in ctf_do_dropwithreset_conn()
879 ctf_fixed_maxseg(struct tcpcb *tp) in ctf_fixed_maxseg() argument
881 return (tcp_fixed_maxseg(tp)); in ctf_fixed_maxseg()
885 ctf_log_sack_filter(struct tcpcb *tp, int num_sack_blks, struct sackblk *sack_blocks) in ctf_log_sack_filter() argument
887 if (tcp_bblogging_on(tp)) { in ctf_log_sack_filter()
910 TCP_LOG_EVENTP(tp, NULL, in ctf_log_sack_filter()
911 &tptosocket(tp)->so_rcv, in ctf_log_sack_filter()
912 &tptosocket(tp)->so_snd, in ctf_log_sack_filter()
945 ctf_progress_timeout_check(struct tcpcb *tp, bool log) in ctf_progress_timeout_check() argument
947 if (tp->t_maxunacktime && tp->t_acktime && TSTMP_GT(ticks, tp->t_acktime)) { in ctf_progress_timeout_check()
948 if ((ticks - tp->t_acktime) >= tp->t_maxunacktime) { in ctf_progress_timeout_check()
955 tcp_log_end_status(tp, TCP_EI_STATUS_PROGRESS); in ctf_progress_timeout_check()