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

Detailed Description

Generic interface to communicate with GNRC modules.

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 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
 
#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_recv (kernel_pid_t pid, gnrc_pktsnip_t *pkt, uint16_t type)
 Shortcut function for sending GNRC_NETAPI_MSG_TYPE_SND or GNRC_NETAPI_MSG_TYPE_RCV messages. More...
 
int _gnrc_netapi_get_set (kernel_pid_t pid, netopt_t opt, uint16_t context, void *data, size_t data_len, uint16_t type)
 Shortcut function for sending GNRC_NETAPI_MSG_TYPE_GET or GNRC_NETAPI_MSG_TYPE_SET messages and parsing the returned GNRC_NETAPI_MSG_TYPE_ACK message. More...
 
static 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...
 
static 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...
 
static 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...
 
static int gnrc_netapi_set (kernel_pid_t pid, netopt_t opt, uint16_t context, const 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...