summaryrefslogtreecommitdiff
path: root/pkt.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-02-16 14:57:56 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-02-16 14:57:56 +0100
commitfebd240e3acb285e02ab8d8f87356feab5809573 (patch)
tree11582587d6cf1e765aaf75e16f8b32541dd365e4 /pkt.h
parent787b67bc0603a71e645a04269db8309ab0977c94 (diff)
pkt: Add pkt_reset()
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
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));