Loading...
Searching...
No Matches
pktbuf_internal.h File Reference

Internal stuff for gnrc_pktbuf. More...

Detailed Description

Internal stuff for gnrc_pktbuf.

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_internal.h.

#include <stdbool.h>
#include <stdlib.h>
#include "mutex.h"
+ Include dependency graph for pktbuf_internal.h:

Go to the source code of this file.

mutex_t gnrc_pktbuf_mutex
 Mutex used to provide mutually exclusive access to packet buffer data structures.
 
bool gnrc_pktbuf_contains (void *ptr)
 Check if the given pointer is indeed part of the packet buffer.
 
void gnrc_pktbuf_free_internal (void *data, size_t size)
 Release an internal buffer.
 
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.
 

Function Documentation

◆ gnrc_pktbuf_contains()

bool gnrc_pktbuf_contains ( void *  ptr)

Check if the given pointer is indeed part of the packet buffer.

Warning
This function is internal.
Parameters
ptrpointer to check
Return values
trueIt is plausible, that this pointer belongs to data in the packet buffer
falseptr does not point to data in the packet buffer

◆ gnrc_pktbuf_free_internal()

void gnrc_pktbuf_free_internal ( void *  data,
size_t  size 
)

Release an internal buffer.

Warning
This function is internal. Use gnrc_pktbuf_release to release a packet buffer
Parameters
datapointer to the internal buffer to release
sizesize of data in bytes

◆ gnrc_pktbuf_is_empty()

bool gnrc_pktbuf_is_empty ( void  )

Checks if packet buffer is empty.

Returns
true, if packet buffer is empty
false, if packet buffer is not empty

◆ gnrc_pktbuf_is_sane()

bool gnrc_pktbuf_is_sane ( void  )

Checks if the implementation's internal invariants still uphold.

Returns
true, the packet buffer is sane.
false, the packet buffer is insane.

Variable Documentation

◆ gnrc_pktbuf_mutex

mutex_t gnrc_pktbuf_mutex
extern

Mutex used to provide mutually exclusive access to packet buffer data structures.

Warning
This mutex will be internally locked and unlocked and should not be touched by external code