diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-02-16 14:57:56 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-02-16 14:57:56 +0100 |
commit | febd240e3acb285e02ab8d8f87356feab5809573 (patch) | |
tree | 11582587d6cf1e765aaf75e16f8b32541dd365e4 | |
parent | 787b67bc0603a71e645a04269db8309ab0977c94 (diff) |
pkt: Add pkt_reset()
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | pkt.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)); |