Generic interface to communicate with GNRC modules. More...

Detailed Description

Generic interface to communicate with GNRC modules.

Definition in file netapi.h.

#include "thread.h"
#include "net/netopt.h"
#include "net/gnrc/nettype.h"
#include "net/gnrc/pkt.h"
+ Include dependency graph for netapi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gnrc_netapi_opt_t
 Data structure to be send for setting (GNRC_NETAPI_MSG_TYPE_SET) and getting (GNRC_NETAPI_MSG_TYPE_GET) options. More...
 

Macros

#define GNRC_NETAPI_MSG_TYPE_RCV   (0x0201)
 Messaging / IPC type for passing a Packet up the network stack More...
 
#define GNRC_NETAPI_MSG_TYPE_SND   (0x0202)
 Messaging / IPC type for passing a Packet down the network stack
 
#define GNRC_NETAPI_MSG_TYPE_SET   (0x0203)
 Messaging / IPC type for setting options of network modules
 
#define GNRC_NETAPI_MSG_TYPE_GET   (0x0204)
 Messaging / IPC type for getting options from network modules
 
#define GNRC_NETAPI_MSG_TYPE_ACK   (0x0205)
 Messaging / IPC type for replying to get and set option messages
 

Functions

int gnrc_netapi_send (kernel_pid_t pid, gnrc_pktsnip_t *pkt)
 Shortcut function for sending GNRC_NETAPI_MSG_TYPE_SND messages. More...
 
int gnrc_netapi_dispatch (gnrc_nettype_t type, uint32_t demux_ctx, uint16_t cmd, gnrc_pktsnip_t *pkt)
 Sends cmd to all subscribers to (type, demux_ctx). More...
 
static int gnrc_netapi_dispatch_send (gnrc_nettype_t type, uint32_t demux_ctx, gnrc_pktsnip_t *pkt)
 Sends a GNRC_NETAPI_MSG_TYPE_SND command to all subscribers to (type, demux_ctx). More...
 
int gnrc_netapi_receive (kernel_pid_t pid, gnrc_pktsnip_t *pkt)
 Shortcut function for sending GNRC_NETAPI_MSG_TYPE_RCV messages. More...
 
static int gnrc_netapi_dispatch_receive (gnrc_nettype_t type, uint32_t demux_ctx, gnrc_pktsnip_t *pkt)
 Sends a GNRC_NETAPI_MSG_TYPE_RCV command to all subscribers to (type, demux_ctx). More...
 
int gnrc_netapi_get (kernel_pid_t pid, netopt_t opt, uint16_t context, void *data, size_t max_len)
 Shortcut function for sending GNRC_NETAPI_MSG_TYPE_GET messages and parsing the returned GNRC_NETAPI_MSG_TYPE_ACK message. More...
 
int gnrc_netapi_set (kernel_pid_t pid, netopt_t opt, uint16_t context, void *data, size_t data_len)
 Shortcut function for sending GNRC_NETAPI_MSG_TYPE_SET messages and parsing the returned GNRC_NETAPI_MSG_TYPE_ACK message. More...