sock.h

Common sock API definitions.

SOCK_HAS_IPV6

activate IPv6 support

SOCK_FLAGS_REUSE_EP

allow to reuse end point on bind

1
(0x0001)
SOCK_ADDR_ANY_NETIF

Special netif ID for “any interface”.

1
(0)

Use an equivalent defintion from PR #5511

SOCK_IPV4_EP_ANY

Address to bind to any IPv4 address.

1
2
{ .family = AF_INET, \
                                  .netif = SOCK_ADDR_ANY_NETIF }
SOCK_IPV6_EP_ANY

Address to bind to any IPv6 address.

1
2
{ .family = AF_INET6, \
                                  .netif = SOCK_ADDR_ANY_NETIF }
SOCK_NO_TIMEOUT

Special value meaning “wait forever” (don’t timeout)

1
(UINT32_MAX)
struct sock_ip_ep_t

Abstract IP end point and end point for a raw IP sock object.

int family

family of sock.h::sock_ip_ep_t::addr

uint8_t ipv6()

IPv6 address mode.

Note

only available if sock.h::SOCK_HAS_IPV6 is defined.

uint8_t ipv4()

IPv4 address mode.

uint32_t ipv4_u32

IPv4 address in network byte order

union sock_ip_ep_t::@198 addr

address

uint16_t netif

stack-specific network interface ID

port to common network interface identifiers in PR #5511.

Use sock.h::SOCK_ADDR_ANY_NETIF for any interface. For reception this is the local interface the message came over, for transmission, this is the local interface the message should be send over

struct _sock_tl_ep

Common IP-based transport layer end point.

int family

family of sock.h::sock_ip_ep_t::addr

uint8_t ipv6()

IPv6 address mode.

Note

only available if sock.h::SOCK_HAS_IPV6 is defined.

uint8_t ipv4()

IPv4 address mode.

uint32_t ipv4_u32

IPv4 address in network byte order

union _sock_tl_ep::@199 addr

address

uint16_t netif

stack-specific network interface ID

port to common network interface identifiers in PR #5511.

Use sock.h::SOCK_ADDR_ANY_NETIF for any interface. For reception this is the local interface the message came over, for transmission, this is the local interface the message should be send over

uint16_t port

transport layer port (in host byte order)