Loading...
Searching...
No Matches

Definitions to register network protocol PIDs to use with GNRC communication interface. More...

Detailed Description

Definitions to register network protocol PIDs to use with GNRC communication interface.

Author
Martine Lenders mlend.nosp@m.ers@.nosp@m.inf.f.nosp@m.u-be.nosp@m.rlin..nosp@m.de

Definition in file netreg.h.

#include <inttypes.h>
#include "sched.h"
#include "net/gnrc/nettype.h"
#include "net/gnrc/pkt.h"
+ Include dependency graph for netreg.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gnrc_netreg_entry_cbd_t
 Callback + Context descriptor. More...
 
struct  gnrc_netreg_entry
 Entry to the Network protocol registry. More...
 

Macros

#define GNRC_NETREG_DEMUX_CTX_ALL   (0xffff0000)
 Demux context value to get all packets of a certain type.
 

Typedefs

typedef void(* gnrc_netreg_entry_cb_t) (uint16_t cmd, gnrc_pktsnip_t *pkt, void *ctx)
 Packet handler callback for netreg entries with callback.
 
typedef struct gnrc_netreg_entry gnrc_netreg_entry_t
 Entry to the Network protocol registry.
 

Enumerations

enum  gnrc_netreg_type_t { GNRC_NETREG_TYPE_DEFAULT = 0 , GNRC_NETREG_TYPE_MBOX , GNRC_NETREG_TYPE_CB }
 The type of the netreg entry. More...
 

Functions

void gnrc_netreg_init (void)
 Initializes module.
 
int gnrc_netreg_register (gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
 Registers a thread to the registry.
 
void gnrc_netreg_unregister (gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
 Removes a thread from the registry.
 
gnrc_netreg_entry_tgnrc_netreg_lookup (gnrc_nettype_t type, uint32_t demux_ctx)
 Searches for entries with given parameters in the registry and returns the first found.
 
int gnrc_netreg_num (gnrc_nettype_t type, uint32_t demux_ctx)
 Returns number of entries with the same gnrc_netreg_entry_t::type and gnrc_netreg_entry_t::demux_ctx.
 
gnrc_netreg_entry_tgnrc_netreg_getnext (gnrc_netreg_entry_t *entry)
 Returns the next entry after entry with the same gnrc_netreg_entry_t::type and gnrc_netreg_entry_t::demux_ctx as the given entry.
 
int gnrc_netreg_calc_csum (gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr)
 Calculates the checksum for a header.
 

Static entry initialization macros

#define GNRC_NETREG_ENTRY_INIT_PID(demux_ctx, pid)   { NULL, demux_ctx, { pid } }
 Initializes a netreg entry statically with PID.
 
#define GNRC_NETREG_ENTRY_INIT_MBOX(demux_ctx, _mbox)
 Initializes a netreg entry statically with mbox.
 
#define GNRC_NETREG_ENTRY_INIT_CB(demux_ctx, _cbd)
 Initializes a netreg entry statically with callback.
 
void gnrc_netreg_acquire_shared (void)
 The global locking of netregs.
 
void gnrc_netreg_release_shared (void)
 Release a shared lock on the GNRC netreg.
 

Dynamic entry initialization functions

static void gnrc_netreg_entry_init_pid (gnrc_netreg_entry_t *entry, uint32_t demux_ctx, kernel_pid_t pid)
 Initializes a netreg entry dynamically with PID.
 
static void gnrc_netreg_entry_init_mbox (gnrc_netreg_entry_t *entry, uint32_t demux_ctx, mbox_t *mbox)
 Initializes a netreg entry dynamically with mbox.
 
static void gnrc_netreg_entry_init_cb (gnrc_netreg_entry_t *entry, uint32_t demux_ctx, gnrc_netreg_entry_cbd_t *cbd)
 Initializes a netreg entry dynamically with callback.