Lines Matching refs:head
31 int woff = loff - rb->head; /* window offset */ in loff2boff()
56 if (walk->head > f->head) { in frags_insert()
145 #define TAILQ_LOOP_NEXT(head, headname, elm, field) \ argument
146 ((*(((struct headname *)((head)->tqh_last))->tqh_last)) == (elm) ? \
147 ((head)->tqh_first) : ((elm)->field.tqe_next))
164 boff_t head = loff2boff(rb, data); in buf_try_resize() local
167 tcpbufseg_t *headseg = buf_getbuf(rb, head); in buf_try_resize()
174 rb->corr = (rb->corr + (segdiff * UNITBUFSIZE) - (new_head - head)) in buf_try_resize()
179 if (head > tail && headseg == tailseg) { in buf_try_resize()
182 memcpy(&seg->buf[head % UNITBUFSIZE], in buf_try_resize()
183 &headseg->buf[head % UNITBUFSIZE], in buf_try_resize()
184 UNITBUFSIZE - (head % UNITBUFSIZE)); in buf_try_resize()
206 (new_head - head)) % rb->len; in buf_try_resize()
226 new->head = et; in buf_try_resize()
233 if (f->head >= eh && f->tail <= et) { in buf_try_resize()
238 if (f->head < eh) { in buf_try_resize()
240 new->head = eh; in buf_try_resize()
270 assert((tail % UNITBUFSIZE) < (head % UNITBUFSIZE)); in buf_try_resize()
271 memcpy(&tailseg->buf[head % UNITBUFSIZE], in buf_try_resize()
272 &headseg->buf[head % UNITBUFSIZE], in buf_try_resize()
273 UNITBUFSIZE - (head % UNITBUFSIZE)); in buf_try_resize()
348 while (off < rb->head) in FUNCDEF_BUF_RW()
414 if (!rb || new > (rb->head + rb->len) || new < rb->head) in tcprb_setpile()
419 if (!cf || (cf->head != rb->head)) { in tcprb_setpile()
421 assert(rb->pile == rb->head); in tcprb_setpile()
438 if (!cf || (cf->head != rb->head)) in tcprb_cflen()
459 if (!cf || (cf->head != rb->head)) in tcprb_ffhead()
463 int cflen = cf->tail - cf->head; /* length of cf */ in tcprb_ffhead()
467 ff = MIN(ff, rb->pile - rb->head); /* head cannot go further than pile */ in tcprb_ffhead()
474 cf->head += ff; in tcprb_ffhead()
477 rb->head += ff; in tcprb_ffhead()
487 off < rb->head || off >= rb->pile + rb->metalen) in tcprb_fflen()
493 int ff = (off + len) - (rb->head + MIN(rb->len, rb->metalen)); in tcprb_fflen()
499 if (!cf || (cf->head != rb->head)) in tcprb_fflen()
503 int cflen = cf->tail - cf->head; /* length of cf */ in tcprb_fflen()
507 fflen = MIN(ff, rb->pile - rb->head); /* head cannot go further than pile */ in tcprb_fflen()
516 return lastfrag ? (int)(lastfrag->tail - rb->head) : 0; in tcprb_get_datalen()
599 return buf_try_resize(rb, len, rb->head, in tcprb_resize()
615 if (off >= f->head && off < f->tail) { in tcprb_ppeek()
643 off < rb->head || off >= rb->pile + rb->metalen) in tcprb_pwrite()
652 if ((ff = (off + len) - (rb->head + MIN(rb->len, rb->metalen))) > 0) in tcprb_pwrite()
679 if (f->head <= off + uoff) { in tcprb_pwrite()
689 ef && ef->empty && ef->head < f->tail + len - uoff; in tcprb_pwrite()
696 ef->head = f->tail + len - uoff; in tcprb_pwrite()
703 wrlen = fnext ? MIN(fnext->head - (off + uoff), len - uoff) in tcprb_pwrite()
706 if (fnext && (f->tail == fnext->head)) { 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()
717 f->head -= wrlen; in tcprb_pwrite()
721 ef && ef->empty && ef->tail < f->head; in tcprb_pwrite()
725 if (ef->head <= f->head) { in tcprb_pwrite()
728 ef->tail = f->head; in tcprb_pwrite()
750 new->head = off; in tcprb_pwrite()
774 new->head = efhead; in tcprb_pwrite()
808 printf("[%lu - %lu]:'", walk->head, walk->tail - 1); in tcprb_printfrags()
814 for (i = walk->head; i < walk->tail; i++) { in tcprb_printfrags()
886 rb->len, rb->metalen, rb->head, rb->pile, rb->head + rb->metalen); in tcprb_printrb()
907 if (DOESOVERLAP(f->head, f->tail, off, off + pctx->p.payloadlen)) { in tcp_rb_overlapchk()