GNRC-specific implementation of the sock API

Provides an implementation of the Sock API by the Generic (GNRC) network stack. More...

Detailed Description

Files

file  gnrc_sock_internal.h
 GNRC-specific types and function definitions.
 
file  sock_types.h
 GNRC-specific types and function definitions.
 

Data Structures

struct  gnrc_sock_reg
 sock Network protocol registry info More...
 
struct  sock_ip
 Raw IP sock type. More...
 
struct  sock_udp
 UDP sock type. More...
 

Macros

#define GNRC_SOCK_DYN_PORTRANGE_MIN   (IANA_DYNAMIC_PORTRANGE_MIN)
 Minimum port number in the dynamic portrange.
 
#define GNRC_SOCK_DYN_PORTRANGE_MAX   (IANA_DYNAMIC_PORTRANGE_MAX)
 Maximum port number in the dynamic portrange.
 
#define GNRC_SOCK_DYN_PORTRANGE_NUM   (GNRC_SOCK_DYN_PORTRANGE_MAX - GNRC_SOCK_DYN_PORTRANGE_MIN + 1)
 Available ports in the range for dynamic source port allocation.
 
#define GNRC_SOCK_DYN_PORTRANGE_ERR   (0)
 Error value indicating that no free port could be found in the dynamic port range.
 
#define GNRC_SOCK_DYN_PORTRANGE_OFF   (17U)
 Offset for next dynamic port. More...
 
#define SOCK_MBOX_SIZE   (8)
 Size for gnrc_sock_reg_t::mbox_queue.
 

Typedefs

typedef struct gnrc_sock_reg gnrc_sock_reg_t
 sock Network protocol registry info
 

Functions

static bool gnrc_af_not_supported (int af)
 Internal helper functions for GNRC. More...
 
static bool gnrc_ep_addr_any (const sock_ip_ep_t *ep)
 Check if end point points to any address.
 
void gnrc_sock_create (gnrc_sock_reg_t *reg, gnrc_nettype_t type, uint32_t demux_ctx)
 Create a sock internally.
 
ssize_t gnrc_sock_recv (gnrc_sock_reg_t *reg, gnrc_pktsnip_t **pkt, uint32_t timeout, sock_ip_ep_t *remote)
 Receive a packet internally.
 
ssize_t gnrc_sock_send (gnrc_pktsnip_t *payload, sock_ip_ep_t *local, const sock_ip_ep_t *remote, uint8_t nh)
 Send a packet internally.
 

Macro Definition Documentation

#define GNRC_SOCK_DYN_PORTRANGE_OFF   (17U)

Currently set to a static (prime) offset, but could be random, too see https://tools.ietf.org/html/rfc6056#section-3.3.3

Definition at line 66 of file gnrc_sock_internal.h.

Function Documentation

static bool gnrc_af_not_supported ( int  af)
inlinestatic

Checks if address family is not supported

Definition at line 77 of file gnrc_sock_internal.h.