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