Lines Matching refs:off
116 buf_getbuf(tcprb_t *rb, boff_t off) in buf_getbuf() argument
119 int id = off / UNITBUFSIZE; in buf_getbuf()
295 buf_##rw(tcprb_t *rb, uint8_t *buf, int len, loff_t off) \
301 boff_t from = loff2boff(rb, off); \
302 boff_t to = loff2boff(rb, off + len); \
307 off = UNITBUFSIZE - (from % UNITBUFSIZE); \
308 MEMCPY_FOR_##rw(&buf[0], &bufseg_from->buf[from % UNITBUFSIZE], off); \
312 MEMCPY_FOR_##rw(&buf[off], &bufseg->buf[0], UNITBUFSIZE); \
313 off += UNITBUFSIZE; \
318 MEMCPY_FOR_##rw(&buf[off], &bufseg->buf[0], UNITBUFSIZE); \
319 off += UNITBUFSIZE; \
321 MEMCPY_FOR_##rw(&buf[off], &bufseg_to->buf[0], to % UNITBUFSIZE); \
325 off = UNITBUFSIZE - (from % UNITBUFSIZE); \
326 MEMCPY_FOR_##rw(&buf[0], &bufseg_from->buf[from % UNITBUFSIZE], off); \
330 MEMCPY_FOR_##rw(&buf[off], &bufseg->buf[0], UNITBUFSIZE); \
331 off += UNITBUFSIZE; \
333 MEMCPY_FOR_##rw(&buf[off], &bufseg_to->buf[0], to % UNITBUFSIZE); \
346 loff_t off = seq - isn; in FUNCDEF_BUF_RW() local
348 while (off < rb->head) in FUNCDEF_BUF_RW()
349 off += 0x100000000; in FUNCDEF_BUF_RW()
351 return off; in FUNCDEF_BUF_RW()
484 tcprb_fflen(tcprb_t *rb, uint8_t *buf, int len, loff_t off) in tcprb_fflen() argument
487 off < rb->head || off >= rb->pile + rb->metalen) in tcprb_fflen()
490 else if (len == 0 || off + len < rb->pile) in tcprb_fflen()
493 int ff = (off + len) - (rb->head + MIN(rb->len, rb->metalen)); in tcprb_fflen()
605 tcprb_ppeek(tcprb_t *rb, uint8_t *buf, int len, loff_t off) in tcprb_ppeek() argument
615 if (off >= f->head && off < f->tail) { in tcprb_ppeek()
624 int plen = MIN(len, f->tail - off); in tcprb_ppeek()
626 buf_read(rb, buf, plen, off); in tcprb_ppeek()
632 tcprb_pwrite(tcprb_t *rb, uint8_t *buf, int len, loff_t off) in tcprb_pwrite() argument
643 off < rb->head || off >= rb->pile + rb->metalen) in tcprb_pwrite()
647 else if (off + len < rb->pile) /* already written */ in tcprb_pwrite()
652 if ((ff = (off + len) - (rb->head + MIN(rb->len, rb->metalen))) > 0) in tcprb_pwrite()
657 efhead = off + len; in tcprb_pwrite()
679 if (f->head <= off + uoff) { in tcprb_pwrite()
680 if (f->tail > off + uoff) { in tcprb_pwrite()
682 wrlen = f->tail - (off + uoff); in tcprb_pwrite()
684 } else if (f->tail == off + uoff) { in tcprb_pwrite()
703 wrlen = fnext ? MIN(fnext->head - (off + uoff), len - uoff) in tcprb_pwrite()
714 } else if (f->head <= off + len) { in tcprb_pwrite()
716 wrlen = MIN(f->head - (off + uoff), len - uoff); in tcprb_pwrite()
750 new->head = off; in tcprb_pwrite()
751 new->tail = off + len; in tcprb_pwrite()
760 buf_write(rb, &buf[uoff], wrlen, off + uoff); in tcprb_pwrite()
905 loff_t off = seq2loff(rb, pctx->p.seq, recvside_stream->rcvvar->irs + 1); in tcp_rb_overlapchk() local
907 if (DOESOVERLAP(f->head, f->tail, off, off + pctx->p.payloadlen)) { in tcp_rb_overlapchk()