Lines Matching refs:th
138 struct tcphdr *th; in ctf_get_enet_type() local
171 if (m->m_len < (sizeof(*ip6) + sizeof(*th))) { in ctf_get_enet_type()
172 m = m_pullup(m, sizeof(*ip6) + sizeof(*th)); in ctf_get_enet_type()
179 th = (struct tcphdr *)(ip6 + 1); in ctf_get_enet_type()
184 th->th_sum = m->m_pkthdr.csum_data; in ctf_get_enet_type()
186 th->th_sum = in6_cksum_pseudo(ip6, tlen, in ctf_get_enet_type()
189 th->th_sum ^= 0xffff; in ctf_get_enet_type()
191 th->th_sum = in6_cksum(m, IPPROTO_TCP, drop_hdrlen, tlen); in ctf_get_enet_type()
192 if (th->th_sum) { in ctf_get_enet_type()
211 th = (struct tcphdr *)(ip + 1); in ctf_get_enet_type()
217 th->th_sum = m->m_pkthdr.csum_data; in ctf_get_enet_type()
219 th->th_sum = in_pseudo(ip->ip_src.s_addr, in ctf_get_enet_type()
222 th->th_sum ^= 0xffff; in ctf_get_enet_type()
232 th->th_sum = in_cksum(m, len); in ctf_get_enet_type()
241 if (th->th_sum) { in ctf_get_enet_type()
351 struct tcphdr *th; in ctf_process_inbound_raw() local
391 th = (struct tcphdr *)(ip6 + 1); in ctf_process_inbound_raw()
400 th = (struct tcphdr *)(ip + 1); in ctf_process_inbound_raw()
407 off = th->th_off << 2; in ctf_process_inbound_raw()
435 th = NULL; in ctf_process_inbound_raw()
447 retval = (*tp->t_fb->tfb_do_segment_nounlock)(tp, m, th, in ctf_process_inbound_raw()
509 ctf_do_dropwithreset(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, in ctf_do_dropwithreset() argument
513 tcp_dropwithreset(m, th, tp, tlen, rstreason); in ctf_do_dropwithreset()
516 tcp_dropwithreset(m, th, NULL, tlen, rstreason); in ctf_do_dropwithreset()
547 ctf_drop_checks(struct tcpopt *to, struct mbuf *m, struct tcphdr *th, in ctf_drop_checks() argument
557 todrop = tp->rcv_nxt - th->th_seq; in ctf_drop_checks()
561 th->th_seq++; in ctf_drop_checks()
562 if (th->th_urp > 1) in ctf_drop_checks()
563 th->th_urp--; in ctf_drop_checks()
601 tcp_update_sack_list(tp, th->th_seq, in ctf_drop_checks()
602 th->th_seq + todrop); in ctf_drop_checks()
605 th->th_seq += todrop; in ctf_drop_checks()
607 if (th->th_urp > todrop) in ctf_drop_checks()
608 th->th_urp -= todrop; in ctf_drop_checks()
611 th->th_urp = 0; 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()
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
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()
698 ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so, 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()
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()
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()
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()
794 ctf_ts_check(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, in ctf_ts_check() argument
816 ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val); in ctf_ts_check()
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()