Lines Matching refs:f

22 #define PRINTF(f, args...) printf("%s:%d: " f, __FILE__, __LINE__, ##args)  argument
45 frags_del(tcpfrag_t *f) in frags_del() argument
47 free(f); in frags_del()
51 frags_insert(tcprb_t *rb, tcpfrag_t *f) in frags_insert() argument
56 if (walk->head > f->head) { in frags_insert()
57 TAILQ_INSERT_BEFORE(walk, f, link); in frags_insert()
62 TAILQ_INSERT_TAIL(&rb->frags, f, link); in frags_insert()
218 struct _tcpfrag_t *f = TAILQ_FIRST(&rb->frags), *new; in buf_try_resize() local
220 TAILQ_FOREACH(f, &rb->frags, link) { in buf_try_resize()
221 if (f->tail <= eh) in buf_try_resize()
224 if (f->tail > et) { in buf_try_resize()
227 new->tail = f->tail; in buf_try_resize()
228 TAILQ_INSERT_AFTER(&rb->frags, f, new, link); in buf_try_resize()
230 f->tail = et; in buf_try_resize()
233 if (f->head >= eh && f->tail <= et) { in buf_try_resize()
234 f->empty = true; in buf_try_resize()
238 if (f->head < eh) { in buf_try_resize()
241 new->tail = f->tail; in buf_try_resize()
242 TAILQ_INSERT_AFTER(&rb->frags, f, new, link); in buf_try_resize()
244 f->tail = eh; in buf_try_resize()
607 struct _tcpfrag_t *f; in tcprb_ppeek() local
614 TAILQ_FOREACH(f, &rb->frags, link) in tcprb_ppeek()
615 if (off >= f->head && off < f->tail) { in tcprb_ppeek()
616 if (f->empty) in tcprb_ppeek()
617 f = NULL; in tcprb_ppeek()
621 if (!f) /* No proper fragment found */ in tcprb_ppeek()
624 int plen = MIN(len, f->tail - off); in tcprb_ppeek()
660 struct _tcpfrag_t *f = TAILQ_FIRST(&rb->frags), *fnext; in tcprb_pwrite() local
669 while (f) { in tcprb_pwrite()
671 fnext = TAILQ_NEXT(f, link); in tcprb_pwrite()
673 if (f->empty) { in tcprb_pwrite()
675 f = fnext; 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()
689 ef && ef->empty && ef->head < f->tail + len - uoff; in tcprb_pwrite()
693 if (ef->tail <= f->tail + len - uoff) { in tcprb_pwrite()
696 ef->head = f->tail + len - uoff; in tcprb_pwrite()
701 fnext = TAILQ_NEXT(f, link); in tcprb_pwrite()
705 f->tail += wrlen; in tcprb_pwrite()
706 if (fnext && (f->tail == fnext->head)) { in tcprb_pwrite()
708 f->tail = fnext->tail; 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()
720 for (ef = TAILQ_PREV(f, flist, link); 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()
737 f = NULL; in tcprb_pwrite()
741 f = fnext; in tcprb_pwrite()
744 if (!f) { in tcprb_pwrite()
904 struct _tcpfrag_t *f; in tcp_rb_overlapchk() local
906 TAILQ_FOREACH(f, &rb->frags, link) in tcp_rb_overlapchk()
907 if (DOESOVERLAP(f->head, f->tail, off, off + pctx->p.payloadlen)) { in tcp_rb_overlapchk()