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

Detailed Description

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 "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 GNRC_PKTBUF_SIZE   (6144)
 Maximum size of the static packet buffer. More...
 

Functions

void gnrc_pktbuf_init (void)
 Initializes packet buffer module.
 
gnrc_pktsnip_tgnrc_pktbuf_add (gnrc_pktsnip_t *next, 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_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. 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_tgnrc_pktbuf_start_write (gnrc_pktsnip_t *pkt)
 Must be called once before there is a write operation in a thread. More...
 
gnrc_pktsnip_tgnrc_pktbuf_get_iovec (gnrc_pktsnip_t *pkt, size_t *len)
 Create a IOVEC representation of the packet pointed to by pkt More...
 
gnrc_pktsnip_tgnrc_pktbuf_remove_snip (gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *snip)
 Deletes a snip from a packet and the packet buffer. More...
 
gnrc_pktsnip_tgnrc_pktbuf_replace_snip (gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *old, gnrc_pktsnip_t *add)
 Replace a snip from a packet and the packet buffer by another snip. More...
 
gnrc_pktsnip_tgnrc_pktbuf_duplicate_upto (gnrc_pktsnip_t *pkt, gnrc_nettype_t type)
 Duplicates pktsnip chain upto (including) a snip with the given type as a continuous snip. 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...