59#ifndef NET_GNRC_NETAPI_H
60#define NET_GNRC_NETAPI_H
74#define GNRC_NETAPI_MSG_TYPE_RCV (0x0201)
79#define GNRC_NETAPI_MSG_TYPE_SND (0x0202)
84#define GNRC_NETAPI_MSG_TYPE_SET (0x0203)
89#define GNRC_NETAPI_MSG_TYPE_GET (0x0204)
94#define GNRC_NETAPI_MSG_TYPE_ACK (0x0205)
142 void *data,
size_t data_len, uint16_t type);
233 uint16_t context,
void *data,
size_t max_len)
255 uint16_t context,
const void *data,
int16_t kernel_pid_t
Unique process identifier.
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).
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).
#define GNRC_NETAPI_MSG_TYPE_RCV
Messaging / IPC type for passing a Packet up the network stack
#define GNRC_NETAPI_MSG_TYPE_SET
Messaging / IPC type for setting options of network modules
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_...
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_...
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).
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 parsi...
#define GNRC_NETAPI_MSG_TYPE_GET
Messaging / IPC type for getting options from network modules
#define GNRC_NETAPI_MSG_TYPE_SND
Messaging / IPC type for passing a Packet down the network stack
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.
static int gnrc_netapi_receive(kernel_pid_t pid, gnrc_pktsnip_t *pkt)
Shortcut function for sending GNRC_NETAPI_MSG_TYPE_RCV messages.
static int gnrc_netapi_send(kernel_pid_t pid, gnrc_pktsnip_t *pkt)
Shortcut function for sending GNRC_NETAPI_MSG_TYPE_SND messages.
gnrc_nettype_t
Definition of protocol types in the network stack.
netopt_t
Global list of configuration options available throughout the network stack, e.g.
General definitions for network packets and their helper functions.
Definition of global configuration options.
Protocol type definitions.
Data structure to be send for setting (GNRC_NETAPI_MSG_TYPE_SET) and getting (GNRC_NETAPI_MSG_TYPE_GE...
uint16_t data_len
size of the data / the buffer
void * data
data to set or buffer to read into
uint16_t context
(optional) context for that option
netopt_t opt
the option to get/set
Type to represent parts (either headers or payload) of a packet, called snips.