Lines Matching defs:th
138 struct tcphdr *th;
171 if (m->m_len < (sizeof(*ip6) + sizeof(*th))) {
172 m = m_pullup(m, sizeof(*ip6) + sizeof(*th));
179 th = (struct tcphdr *)(ip6 + 1);
184 th->th_sum = m->m_pkthdr.csum_data;
186 th->th_sum = in6_cksum_pseudo(ip6, tlen,
189 th->th_sum ^= 0xffff;
191 th->th_sum = in6_cksum(m, IPPROTO_TCP, drop_hdrlen, tlen);
192 if (th->th_sum) {
211 th = (struct tcphdr *)(ip + 1);
217 th->th_sum = m->m_pkthdr.csum_data;
219 th->th_sum = in_pseudo(ip->ip_src.s_addr,
222 th->th_sum ^= 0xffff;
232 th->th_sum = in_cksum(m, len);
241 if (th->th_sum) {
351 struct tcphdr *th;
391 th = (struct tcphdr *)(ip6 + 1);
400 th = (struct tcphdr *)(ip + 1);
407 off = th->th_off << 2;
435 th = NULL;
447 retval = (*tp->t_fb->tfb_do_segment_nounlock)(tp, m, th,
509 ctf_do_dropwithreset(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th,
513 tcp_dropwithreset(m, th, tp, tlen, rstreason);
516 tcp_dropwithreset(m, th, NULL, tlen, rstreason);
547 ctf_drop_checks(struct tcpopt *to, struct mbuf *m, struct tcphdr *th,
557 todrop = tp->rcv_nxt - th->th_seq;
561 th->th_seq++;
562 if (th->th_urp > 1)
563 th->th_urp--;
601 tcp_update_sack_list(tp, th->th_seq,
602 th->th_seq + todrop);
605 th->th_seq += todrop;
607 if (th->th_urp > todrop)
608 th->th_urp -= todrop;
611 th->th_urp = 0;
618 todrop = (th->th_seq + tlen) - (tp->rcv_nxt + tp->rcv_wnd);
630 if (tp->rcv_wnd == 0 && th->th_seq == tp->rcv_nxt) {
634 ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val);
655 ctf_do_dropafterack(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t thflags, int32_t tlen, int32_t *ret_val)
672 (SEQ_GT(tp->snd_una, th->th_ack) ||
673 SEQ_GT(th->th_ack, tp->snd_max))) {
675 ctf_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen);
698 ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so,
713 if ((SEQ_GEQ(th->th_seq, tp->last_ack_sent) &&
714 SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) ||
715 (tp->rcv_wnd == 0 && tp->last_ack_sent == th->th_seq)) {
717 ("%s: TH_RST for TCPS_SYN_SENT th %p tp %p",
718 __func__, th, tp));
721 (tp->last_ack_sent == th->th_seq) ||
722 (tp->rcv_nxt == th->th_seq)) {
747 tcp_send_challenge_ack(tp, th, m);
762 ctf_challenge_ack(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, uint8_t iptos, int32_t * ret_val)
769 SEQ_GEQ(th->th_seq, tp->last_ack_sent) &&
770 SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) {
775 tcp_ecn_input_syn_sent(tp, tcp_get_flags(th), iptos);
777 tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt,
794 ctf_ts_check(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp,
816 ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val);
868 ctf_do_dropwithreset_conn(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th,
872 tcp_dropwithreset(m, th, tp, tlen, rstreason);