summaryrefslogtreecommitdiff
path: root/pkt.h
diff options
context:
space:
mode:
Diffstat (limited to 'pkt.h')
-rw-r--r--pkt.h7
1 files changed, 7 insertions, 0 deletions
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));