Lines Matching defs:th

2090 	struct tcphdr	*th = pd->hdr.tcp;
2099 sxport.port = th->th_sport;
2100 dxport.port = th->th_dport;
2128 !pf_osfp_match(pf_osfp_fingerprint(pd, m, off, th),
2155 flags = th->th_flags;
2176 if (th->th_off < (sizeof (struct tcphdr) >> 2))
2180 if (flags != th->th_flags || th->th_x2 != 0) {
2183 ov = *(u_int16_t *)(&th->th_ack + 1);
2184 th->th_flags = flags;
2185 th->th_x2 = 0;
2186 nv = *(u_int16_t *)(&th->th_ack + 1);
2188 th->th_sum = pf_cksum_fixup(th->th_sum, ov, nv, 0);
2193 if (!(flags & TH_URG) && th->th_urp) {
2194 th->th_sum = pf_cksum_fixup(th->th_sum, th->th_urp, 0, 0);
2195 th->th_urp = 0;
2202 int rv = pf_normalize_tcpopt(r, dir, kif, pd, m, th, off,
2211 off + sizeof (*th));
2220 m_copyback(mw, off, sizeof (*th), th);
2234 struct tcphdr *th, struct pf_state_peer *src, struct pf_state_peer *dst)
2270 if ((th->th_flags & TH_SYN) == 0)
2274 if (th->th_off > (sizeof (struct tcphdr) >> 2) && src->scrub &&
2275 pf_pull_hdr(m, off, hdr, th->th_off << 2, NULL, NULL, pd->af)) {
2279 hlen = (th->th_off << 2) - sizeof (struct tcphdr);
2329 u_short *reason, struct tcphdr *th, struct pf_state *state,
2372 if (th->th_off > (sizeof (struct tcphdr) >> 2) &&
2375 pf_pull_hdr(m, off, hdr, th->th_off << 2, NULL, NULL, pd->af)) {
2379 hlen = (th->th_off << 2) - sizeof (struct tcphdr);
2412 &th->th_sum,
2428 &th->th_sum, htonl(tsecr),
2443 int optoff = off + sizeof (*th);
2444 int optlen = (th->th_off << 2) - sizeof (*th);
2451 m_copyback(m, optoff, optlen, hdr + sizeof (*th));
2607 pf_print_flags(th->th_flags);
2616 } else if (!got_ts && (th->th_flags & TH_RST) == 0 &&
2618 || pd->p_len > 0 || (th->th_flags & TH_SYN)) &&
2658 pf_print_flags(th->th_flags);
2688 pf_print_flags(th->th_flags);
2729 struct pf_pdesc *pd, struct mbuf *m, struct tcphdr *th, int off,
2741 thoff = th->th_off << 2;
2744 if (cnt > 0 && !pf_pull_hdr(m, off + sizeof (*th), opts, cnt,
2772 th->th_sum = pf_cksum_fixup(th->th_sum,
2788 off + sizeof (*th) + thoff);
2798 m_copyback(mw, off + sizeof (*th), thoff - sizeof (*th), opts);