Lines Matching defs:th
160 struct tcphdr *th;
175 th = (struct tcphdr *)&((int32_t *)ip)[hlen];
176 if ((th->th_flags & (TH_SYN|TH_FIN|TH_RST|TH_ACK)) != TH_ACK)
188 *(int32_t *)th != ((int32_t *)&cs->cs_ip)[cs->cs_ip.ip_hl]) {
209 && *(int32_t *)th ==
224 hlen += th->th_off;
248 * check is unnecessary but costless). The 4th line checks the TCP
249 * header length. The 5th line checks IP options, if any. The 6th
256 hlen += th->th_off;
264 th->th_off != oth->th_off ||
267 (th->th_off > 5 &&
268 BCMP(th + 1, oth + 1, (th->th_off - 5) << 2)))
277 if (th->th_flags & TH_URG) {
278 deltaS = ntohs(th->th_urp);
281 } else if (th->th_urp != oth->th_urp)
288 deltaS = (u_int16_t)(ntohs(th->th_win) - ntohs(oth->th_win));
294 deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack);
302 deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq);
357 if (th->th_flags & TH_PUSH)
363 deltaA = ntohs(th->th_sum);
458 struct tcphdr *th;
518 th = (struct tcphdr *)&((u_char *)&cs->cs_ip)[hlen];
519 th->th_sum = htons((*cp << 8) | cp[1]);
522 th->th_flags |= TH_PUSH;
524 th->th_flags &=~ TH_PUSH;
530 th->th_ack = htonl(ntohl(th->th_ack) + i);
531 th->th_seq = htonl(ntohl(th->th_seq) + i);
536 th->th_seq = htonl(ntohl(th->th_seq) + ntohs(cs->cs_ip.ip_len)
542 th->th_flags |= TH_URG;
543 DECODEU(th->th_urp)
545 th->th_flags &=~ TH_URG;
547 DECODES(th->th_win)
549 DECODEL(th->th_ack)
551 DECODEL(th->th_seq)