Lines Matching defs:th
180 struct tcphdr *th;
195 th = (struct tcphdr *)&((int32_t *)ip)[hlen];
196 if ((th->th_flags & (TH_SYN|TH_FIN|TH_RST|TH_ACK)) != TH_ACK)
208 *(int32_t *)th != ((int32_t *)&cs->cs_ip)[cs->cs_ip.ip_hl]) {
228 && *(int32_t *)th ==
243 hlen += th->th_off;
265 * check is unnecessary but costless). The 4th line checks the TCP
266 * header length. The 5th line checks IP options, if any. The 6th
273 hlen += th->th_off;
281 th->th_off != oth->th_off ||
284 (th->th_off > 5 &&
285 memcmp(th + 1, oth + 1, (th->th_off - 5) << 2)))
293 if (th->th_flags & TH_URG) {
294 deltaS = ntohs(th->th_urp);
297 } else if (th->th_urp != oth->th_urp)
305 deltaS = (uint16_t)(ntohs(th->th_win) - ntohs(oth->th_win));
311 deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack);
319 deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq);
374 if (th->th_flags & TH_PUSH)
380 deltaA = ntohs(th->th_sum);
477 struct tcphdr *th;
546 th = (struct tcphdr *)&((u_char *)&cs->cs_ip)[hlen];
547 th->th_sum = htons((*cp << 8) | cp[1]);
550 th->th_flags |= TH_PUSH;
552 th->th_flags &=~ TH_PUSH;
558 th->th_ack = htonl(ntohl(th->th_ack) + i);
559 th->th_seq = htonl(ntohl(th->th_seq) + i);
564 th->th_seq = htonl(ntohl(th->th_seq) + ntohs(cs->cs_ip.ip_len)
570 th->th_flags |= TH_URG;
571 DECODEU(th->th_urp)
573 th->th_flags &=~ TH_URG;
575 DECODES(th->th_win)
577 DECODEL(th->th_ack)
579 DECODEL(th->th_seq)