Lines Matching refs:th

144   register struct tcp_hdr *th;
166 th = (struct tcp_hdr *)&((long *)ip)[hlen];
167 if ((TCPH_FLAGS(th) & (TCP_SYN|TCP_FIN|TCP_RST|TCP_ACK)) != TCP_ACK) {
180 || *(long *)th != ((long *)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]) {
201 && *(long *)th == ((long *)&cs->cs_ip)[IPH_HL(&cs->cs_ip)]) {
216 hlen += TCPH_HDRLEN(th);
239 hlen += TCPH_HDRLEN(th);
252 * check is unnecessary but costless). The 4th line checks the TCP
253 * header length. The 5th line checks IP options, if any. The 6th
261 || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth)
263 || (TCPH_HDRLEN(th) > 5 && BCMP(th + 1, oth + 1, (TCPH_HDRLEN(th) - 5) << 2))) {
273 if (TCPH_FLAGS(th) & TCP_URG) {
274 deltaS = ntohs(th->urgp);
277 } else if (th->urgp != oth->urgp) {
285 if ((deltaS = (u_short)(ntohs(th->wnd) - ntohs(oth->wnd))) != 0) {
290 if ((deltaL = ntohl(th->ackno) - ntohl(oth->ackno)) != 0) {
299 if ((deltaL = ntohl(th->seqno) - ntohl(oth->seqno)) != 0) {
355 if (TCPH_FLAGS(th) & TCP_PSH) {
362 deltaA = ntohs(th->chksum);
467 struct tcp_hdr *th;
503 th = (struct tcp_hdr *)&((u_char *)&cs->cs_ip)[hlen];
504 th->chksum = htons((*cp << 8) | cp[1]);
507 TCPH_SET_FLAG(th, TCP_PSH);
509 TCPH_UNSET_FLAG(th, TCP_PSH);
517 tmp = ntohl(th->ackno) + i;
518 th->ackno = htonl(tmp);
519 tmp = ntohl(th->seqno) + i;
520 th->seqno = htonl(tmp);
526 tmp = ntohl(th->seqno) + ntohs(IPH_LEN(&cs->cs_ip)) - cs->cs_hlen;
527 th->seqno = htonl(tmp);
532 TCPH_SET_FLAG(th, TCP_URG);
533 DECODEU(th->urgp);
535 TCPH_UNSET_FLAG(th, TCP_URG);
538 DECODES(th->wnd);
541 DECODEL(th->ackno);
544 DECODEL(th->seqno);