Merge pull request #2804 from authmillenon/pktbuf/api/pktbuf_remove
pktbuf: add helper function to remove snips from packet
This commit is contained in:
commit
e9fb853a81
@ -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);
|
|||||||
*/
|
*/
|
||||||
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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user