Lines Matching defs:th
178 register struct tcphdr *th;
193 th = (struct tcphdr *)&((int *)ip)[hlen];
194 if ((th->th_flags & (TH_SYN|TH_FIN|TH_RST|TH_ACK)) != TH_ACK)
206 *(int *)th != ((int *)&cs->cs_ip)[getip_hl(cs->cs_ip)]) {
227 && *(int *)th == ((int *)&cs->cs_ip)[getip_hl(cs->cs_ip)])
241 hlen += getth_off(*th);
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 += getth_off(*th);
281 getth_off(*th) != getth_off(*oth) ||
283 (getth_off(*th) > 5 && BCMP(th + 1, oth + 1, (getth_off(*th) - 5) << 2)))
292 if (th->th_flags & TH_URG) {
293 deltaS = ntohs(th->th_urp);
296 } else if (th->th_urp != oth->th_urp)
303 if ((deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win))) > 0) {
308 if ((deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack)) > 0) {
315 if ((deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq)) > 0) {
369 if (th->th_flags & TH_PUSH)
375 deltaA = ntohs(th->th_sum);
480 register struct tcphdr *th;
508 th = (struct tcphdr *)&((u_char *)&cs->cs_ip)[hlen];
509 th->th_sum = htons((*cp << 8) | cp[1]);
512 th->th_flags |= TH_PUSH;
514 th->th_flags &=~ TH_PUSH;
521 tmp = ntohl(th->th_ack) + i;
522 th->th_ack = htonl(tmp);
523 tmp = ntohl(th->th_seq) + i;
524 th->th_seq = htonl(tmp);
530 tmp = ntohl(th->th_seq) + ntohs(cs->cs_ip.ip_len) - cs->cs_hlen;
531 th->th_seq = htonl(tmp);
536 th->th_flags |= TH_URG;
537 DECODEU(th->th_urp);
539 th->th_flags &=~ TH_URG;
541 DECODES(th->th_win);
543 DECODEL(th->th_ack);
545 DECODEL(th->th_seq);