Interface definition for the global network buffer. Network devices and layers can allocate space for packets here. More...
Interface definition for the global network buffer. Network devices and layers can allocate space for packets here.
Definition in file pktbuf.h.
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "cpu_conf.h"
#include "net/gnrc/pkt.h"
#include "net/gnrc/neterr.h"
#include "net/gnrc/nettype.h"
#include "utlist.h"
Go to the source code of this file.
Macros | |
#define | CONFIG_GNRC_PKTBUF_SIZE (6144) |
Maximum size of the static packet buffer. More... | |
Functions | |
void | gnrc_pktbuf_init (void) |
Initializes packet buffer module. | |
gnrc_pktsnip_t * | gnrc_pktbuf_add (gnrc_pktsnip_t *next, const void *data, size_t size, gnrc_nettype_t type) |
Adds a new gnrc_pktsnip_t and its packet to the packet buffer. More... | |
gnrc_pktsnip_t * | gnrc_pktbuf_mark (gnrc_pktsnip_t *pkt, size_t size, gnrc_nettype_t type) |
Marks the first size bytes in a received packet with a new packet snip that is appended to the packet. More... | |
int | gnrc_pktbuf_realloc_data (gnrc_pktsnip_t *pkt, size_t size) |
Reallocates gnrc_pktsnip_t::data of pkt in the packet buffer, without changing the content. More... | |
void | gnrc_pktbuf_hold (gnrc_pktsnip_t *pkt, unsigned int num) |
Increases gnrc_pktsnip_t::users of pkt atomically. More... | |
void | gnrc_pktbuf_release_error (gnrc_pktsnip_t *pkt, uint32_t err) |
Decreases gnrc_pktsnip_t::users of pkt atomically and removes it if it reaches 0 and reports a possible error through an error code, if Error reporting is included. More... | |
static void | gnrc_pktbuf_release (gnrc_pktsnip_t *pkt) |
Decreases gnrc_pktsnip_t::users of pkt atomically and removes it if it reaches 0 and reports GNRC_NETERR_SUCCESS. More... | |
gnrc_pktsnip_t * | gnrc_pktbuf_start_write (gnrc_pktsnip_t *pkt) |
Must be called once before there is a write operation on a packet snip in a thread. More... | |
gnrc_pktsnip_t * | gnrc_pktbuf_remove_snip (gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *snip) |
Deletes a snip from a packet and the packet buffer. More... | |
gnrc_pktsnip_t * | gnrc_pktbuf_reverse_snips (gnrc_pktsnip_t *pkt) |
Reverses snip order of a packet in a write-protected manner. More... | |
int | gnrc_pktbuf_merge (gnrc_pktsnip_t *pkt) |
Merge pktsnip chain to single pktsnip. More... | |
void | gnrc_pktbuf_stats (void) |
Prints some statistics about the packet buffer to stdout. More... | |
bool | gnrc_pktbuf_is_empty (void) |
Checks if packet buffer is empty. More... | |
bool | gnrc_pktbuf_is_sane (void) |
Checks if the implementation's internal invariants still uphold. More... | |