Skip to content
Snippets Groups Projects
Commit 37d214ba authored by Martine Lenders's avatar Martine Lenders
Browse files

pktbuf: add helper function to remove snips from packet

parent 1af61260
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "cpu-conf.h" #include "cpu-conf.h"
#include "net/ng_pkt.h" #include "net/ng_pkt.h"
#include "net/ng_nettype.h" #include "net/ng_nettype.h"
#include "utlist.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -166,6 +167,19 @@ void ng_pktbuf_release(ng_pktsnip_t *pkt); ...@@ -166,6 +167,19 @@ void ng_pktbuf_release(ng_pktsnip_t *pkt);
*/ */
ng_pktsnip_t *ng_pktbuf_start_write(ng_pktsnip_t *pkt); ng_pktsnip_t *ng_pktbuf_start_write(ng_pktsnip_t *pkt);
/**
* @brief Deletes a snip from a packet and the packet buffer.
*
* @param[in] pkt A packet.
* @param[in] snip A snip in the packet.
*/
static inline void ng_pktbuf_remove_snip(ng_pktsnip_t *pkt, ng_pktsnip_t *snip)
{
LL_DELETE(pkt, snip);
snip->next = NULL;
ng_pktbuf_release(snip);
}
#ifdef DEVELHELP #ifdef DEVELHELP
/** /**
* @brief Prints some statistics about the packet buffer to stdout. * @brief Prints some statistics about the packet buffer to stdout.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment