Loading...
Searching...
No Matches

Interface definition for the global network buffer. More...

Detailed Description

Interface definition for the global network buffer.

Network devices and layers can allocate space for packets here.

Author
Martine Lenders mlend.nosp@m.ers@.nosp@m.inf.f.nosp@m.u-be.nosp@m.rlin..nosp@m.de
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file pktbuf.h.

#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "cpu_conf.h"
#include "mutex.h"
#include "net/gnrc/pkt.h"
#include "net/gnrc/neterr.h"
#include "net/gnrc/nettype.h"
#include "utlist.h"
+ Include dependency graph for pktbuf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CONFIG_GNRC_PKTBUF_SIZE   (6144)
 Maximum size of the static packet buffer.
 
#define CONFIG_GNRC_PKTBUF_CHECK_USE_AFTER_FREE   (0)
 Enable use-after-free/out of bounds write detection in gnrc_pktbuf.
 
#define GNRC_PKTBUF_CANARY   (0x55)
 Canary value for free pktbuf memory when.
 

Functions

void gnrc_pktbuf_init (void)
 Initializes packet buffer module.
 
gnrc_pktsnip_tgnrc_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.
 
gnrc_pktsnip_tgnrc_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.
 
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.
 
void gnrc_pktbuf_hold (gnrc_pktsnip_t *pkt, unsigned int num)
 Increases gnrc_pktsnip_t::users of pkt atomically.
 
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.
 
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.
 
gnrc_pktsnip_tgnrc_pktbuf_start_write (gnrc_pktsnip_t *pkt)
 Must be called once before there is a write operation on a packet snip in a thread.
 
gnrc_pktsnip_tgnrc_pktbuf_remove_snip (gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *snip)
 Deletes a snip from a packet and the packet buffer.
 
gnrc_pktsnip_tgnrc_pktbuf_reverse_snips (gnrc_pktsnip_t *pkt)
 Reverses snip order of a packet in a write-protected manner.
 
int gnrc_pktbuf_merge (gnrc_pktsnip_t *pkt)
 Merge pktsnip chain to single pktsnip.
 
void gnrc_pktbuf_stats (void)
 Prints some statistics about the packet buffer to stdout.
 
bool gnrc_pktbuf_is_empty (void)
 Checks if packet buffer is empty.
 
bool gnrc_pktbuf_is_sane (void)
 Checks if the implementation's internal invariants still uphold.