From febd240e3acb285e02ab8d8f87356feab5809573 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 16 Feb 2015 14:57:56 +0100 Subject: pkt: Add pkt_reset() Signed-off-by: Tobias Klauser --- pkt.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkt.h b/pkt.h index b043685..e829b8c 100644 --- a/pkt.h +++ b/pkt.h @@ -59,6 +59,13 @@ static inline void pkt_free(struct pkt *p) free(p); } +static inline void pkt_reset(struct pkt *p) +{ + assert(pkt_invariant(p)); + + p->tail = p->data; +} + static inline size_t pkt_len(struct pkt *p) { assert(pkt_invariant(p)); -- cgit v1.2.3-54-g00ecf