The friendly Operating System for the Internet of Things

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

Detailed Description

#include <inttypes.h>
#include "kernel_types.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. More...
 
#define GNRC_NETREG_ENTRY_INIT_PID(demux_ctx, pid)   { NULL, demux_ctx, { pid } }
 Initializes a netreg entry statically with PID. More...
 
#define GNRC_NETREG_ENTRY_INIT_MBOX(demux_ctx, mbox)
 Initializes a netreg entry statically with mbox. More...
 
#define GNRC_NETREG_ENTRY_INIT_CB(demux_ctx, cbd)
 Initializes a netreg entry statically with callback. More...
 

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. More...
 
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.
 
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. More...
 
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. More...
 
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. More...
 
int gnrc_netreg_register (gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
 Registers a thread to the registry. More...
 
void gnrc_netreg_unregister (gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
 Removes a thread from the registry. More...
 
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. More...
 
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. More...
 
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. More...
 
int gnrc_netreg_calc_csum (gnrc_pktsnip_t *hdr, gnrc_pktsnip_t *pseudo_hdr)
 Calculates the checksum for a header. More...