Lines Matching refs:cs
163 register struct cstate *cs = comp->last_cs->cs_next; in sl_compress_tcp() local
198 if (ip->ip_src.s_addr != cs->cs_ip.ip_src.s_addr || in sl_compress_tcp()
199 ip->ip_dst.s_addr != cs->cs_ip.ip_dst.s_addr || in sl_compress_tcp()
200 *(int *) th != ((int *) &cs->cs_ip)[cs->cs_ip.ip_hl]) { in sl_compress_tcp()
216 lcs = cs; in sl_compress_tcp()
217 cs = cs->cs_next; in sl_compress_tcp()
219 if (ip->ip_src.s_addr == cs->cs_ip.ip_src.s_addr in sl_compress_tcp()
220 && ip->ip_dst.s_addr == cs->cs_ip.ip_dst.s_addr in sl_compress_tcp()
221 && *(int *) th == ((int *) &cs->cs_ip)[cs->cs_ip.ip_hl]) in sl_compress_tcp()
223 } while (cs != lastcs); in sl_compress_tcp()
246 if (cs == lastcs) in sl_compress_tcp()
249 lcs->cs_next = cs->cs_next; in sl_compress_tcp()
250 cs->cs_next = lastcs->cs_next; in sl_compress_tcp()
251 lastcs->cs_next = cs; in sl_compress_tcp()
265 oth = (struct tcphdr *) & ((int *) &cs->cs_ip)[hlen]; in sl_compress_tcp()
272 if (((u_short *) ip)[0] != ((u_short *) & cs->cs_ip)[0] || in sl_compress_tcp()
273 ((u_short *) ip)[3] != ((u_short *) & cs->cs_ip)[3] || in sl_compress_tcp()
274 ((u_short *) ip)[4] != ((u_short *) & cs->cs_ip)[4] || in sl_compress_tcp()
277 memcmp(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || in sl_compress_tcp()
333 if (ip->ip_len != cs->cs_ip.ip_len && in sl_compress_tcp()
334 ntohs(cs->cs_ip.ip_len) == hlen) in sl_compress_tcp()
350 deltaS == ntohs(cs->cs_ip.ip_len) - hlen) { in sl_compress_tcp()
358 if (deltaS == ntohs(cs->cs_ip.ip_len) - hlen) { in sl_compress_tcp()
366 deltaS = ntohs(ip->ip_id) - ntohs(cs->cs_ip.ip_id); in sl_compress_tcp()
379 memcpy(&cs->cs_ip, ip, hlen); in sl_compress_tcp()
397 if (comp->last_xmit == cs->cs_id && compress_cid) { in sl_compress_tcp()
402 comp->last_xmit = cs->cs_id; in sl_compress_tcp()
406 *cp++ = cs->cs_id; in sl_compress_tcp()
422 memcpy(&cs->cs_ip, ip, hlen); in sl_compress_tcp()
423 ip->ip_p = cs->cs_id; in sl_compress_tcp()
424 comp->last_xmit = cs->cs_id; in sl_compress_tcp()
436 register struct cstate *cs; in sl_uncompress_tcp() local
446 cs = &comp->rstate[comp->last_recv = ip->ip_p]; in sl_uncompress_tcp()
461 memcpy(&cs->cs_ip, ip, hlen); in sl_uncompress_tcp()
462 cs->cs_hlen = hlen; in sl_uncompress_tcp()
500 cs = &comp->rstate[comp->last_recv]; in sl_uncompress_tcp()
501 hlen = cs->cs_ip.ip_hl << 2; in sl_uncompress_tcp()
502 th = (struct tcphdr *) & ((u_char *) & cs->cs_ip)[hlen]; in sl_uncompress_tcp()
513 register u_int i = ntohs(cs->cs_ip.ip_len) - cs->cs_hlen; in sl_uncompress_tcp()
521 th->th_seq = htonl(ntohl(th->th_seq) + ntohs(cs->cs_ip.ip_len) in sl_uncompress_tcp()
522 - cs->cs_hlen); in sl_uncompress_tcp()
543 DECODES(cs->cs_ip.ip_id) in sl_uncompress_tcp()
545 cs->cs_ip.ip_id = htons(ntohs(cs->cs_ip.ip_id) + 1); in sl_uncompress_tcp()
548 cs->cs_ip.ip_id, (u_long)ntohl(th->th_seq)); in sl_uncompress_tcp()
565 *bufp = cp - cs->cs_hlen; in sl_uncompress_tcp()
566 len += cs->cs_hlen; in sl_uncompress_tcp()
567 cs->cs_ip.ip_len = htons(len); in sl_uncompress_tcp()
570 cs->cs_ip.ip_sum = 0; in sl_uncompress_tcp()
571 bp = (u_short *)&cs->cs_ip; in sl_uncompress_tcp()
576 cs->cs_ip.ip_sum = ~changes; in sl_uncompress_tcp()
579 memcpy(*bufp, &cs->cs_ip, cs->cs_hlen); in sl_uncompress_tcp()