GNRC-specific implementation of the sock API

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

struct gnrc_sock_reg gnrc_sock_reg_t

sock Network protocol registry info

bool gnrc_af_not_supported(int af)

Internal helper functions for GNRC.

Checks if address family is not supported

bool gnrc_ep_addr_any(const sock_ip_ep_t * ep)

Check if end point points to any address.

void gnrc_ep_set(sock_ip_ep_t * out, const sock_ip_ep_t * in, msp430_types.h::size_t in_size)

Initializes a sock end-point from a given and sets the network interface implicitly if there is only one potential interface.

void gnrc_sock_create(sock_types.h::gnrc_sock_reg_t * reg, nettype.h::gnrc_nettype_t type, uint32_t demux_ctx)

Create a sock internally.

msp430_types.h::ssize_t gnrc_sock_recv(sock_types.h::gnrc_sock_reg_t * reg, include/net/gnrc/pkt.h::gnrc_pktsnip_t ** pkt, uint32_t timeout, sock_ip_ep_t * remote)

Receive a packet internally.

msp430_types.h::ssize_t gnrc_sock_send(include/net/gnrc/pkt.h::gnrc_pktsnip_t * payload, sock_ip_ep_t * local, const sock_ip_ep_t * remote, uint8_t nh)

Send a packet internally.

GNRC_SOCK_DYN_PORTRANGE_MIN

Minimum port number in the dynamic portrange.

1
(IANA_DYNAMIC_PORTRANGE_MIN)
GNRC_SOCK_DYN_PORTRANGE_MAX

Maximum port number in the dynamic portrange.

1
(IANA_DYNAMIC_PORTRANGE_MAX)
GNRC_SOCK_DYN_PORTRANGE_NUM

Available ports in the range for dynamic source port allocation.

1
(GNRC_SOCK_DYN_PORTRANGE_MAX - GNRC_SOCK_DYN_PORTRANGE_MIN + 1)
GNRC_SOCK_DYN_PORTRANGE_ERR

Error value indicating that no free port could be found in the dynamic port range.

1
(0)
GNRC_SOCK_DYN_PORTRANGE_OFF

Offset for next dynamic port.

1
(17U)

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

SOCK_MBOX_SIZE

Size for sock_types.h::gnrc_sock_reg::mbox_queue.

1
(8)
struct gnrc_sock_reg

sock Network protocol registry info

netreg.h::gnrc_netreg_entry_t entry

Network protocol registry entry for mbox

mbox_t mbox

Mailboxes target for the sock

msg_t mbox_queue()

queue for sock_types.h::gnrc_sock_reg::mbox

struct sock_ip

Raw IP sock type.

sock_types.h::gnrc_sock_reg_t reg

netreg info

sock_ip_ep_t local

local end-point

sock_ip_ep_t remote

remote end-point

uint16_t flags

option flags

struct sock_udp

UDP sock type.

sock_types.h::gnrc_sock_reg_t reg

netreg info

sock/udp.h::sock_udp_ep_t local

local end-point

sock/udp.h::sock_udp_ep_t remote

remote end-point

uint16_t flags

option flags