From cb1624b9956f86e915d2415a9a5c7a097986abc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 16 Jun 2010 21:07:13 +0000 Subject: [PATCH] Add pktref_create() helper --- src/packet.c | 12 ++++++++++++ src/packet.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/packet.c b/src/packet.c index e46ac34c..2a43dce6 100644 --- a/src/packet.c +++ b/src/packet.c @@ -160,3 +160,15 @@ pkt_copy(th_pkt_t *pkt) return n; } + + +/** + * + */ +th_pktref_t * +pktref_create(th_pkt_t *pkt) +{ + th_pktref_t *pr = malloc(sizeof(th_pktref_t)); + pr->pr_pkt = pkt; + return pr; +} diff --git a/src/packet.h b/src/packet.h index de5d7c3d..87dbe98f 100644 --- a/src/packet.h +++ b/src/packet.h @@ -74,4 +74,6 @@ th_pkt_t *pkt_merge_global(th_pkt_t *pkt); th_pkt_t *pkt_copy(th_pkt_t *pkt); +th_pktref_t *pktref_create(th_pkt_t *pkt); + #endif /* PACKET_H_ */