30#include "net/sock/config.h"
32#if MODULE_GNRC_SOCK_UDP || MODULE_LWIP_SOCK_UDP || MODULE_OPENWSN_SOCK_UDP || DOXYGEN
34# define SOCK_HAS_UDP 1
36#if MODULE_GNRC_SOCK_TCP || MODULE_LWIP_SOCK_TCP || DOXYGEN
38# define SOCK_HAS_TCP 1
40#ifdef MODULE_SOCK_DTLS
45#if MODULE_GNRC_SOCK_UDP || MODULE_LWIP_SOCK_UDP || MODULE_OPENWSN_SOCK_UDP \
46 || MODULE_GNRC_SOCK_TCP || MODULE_LWIP_SOCK_TCP || DOXYGEN
47# define HAVE_SOCK_TL_EP 1
97int sock_tl_ep_fmt(
const struct _sock_tl_ep *endpoint,
98 char *addr_str, uint16_t *port);
100#if IS_ACTIVE(SOCK_HAS_TCP) || DOXYGEN
111static inline int sock_tcp_ep_fmt(
const sock_tcp_ep_t *endpoint,
112 char *addr_str, uint16_t *port)
114 return sock_tl_ep_fmt(endpoint, addr_str, port);
118#if IS_ACTIVE(SOCK_HAS_UDP) || DOXYGEN
129static inline int sock_udp_ep_fmt(
const sock_udp_ep_t *endpoint,
130 char *addr_str, uint16_t *port)
132 return sock_tl_ep_fmt(endpoint, addr_str, port);
148int sock_tl_str2ep(
struct _sock_tl_ep *ep_out,
const char *str);
164int sock_tl_name2ep(
struct _sock_tl_ep *ep_out,
const char *str);
166#if IS_ACTIVE(SOCK_HAS_TCP) || DOXYGEN
179static inline int sock_tcp_str2ep(
sock_tcp_ep_t *ep_out,
const char *str)
181 return sock_tl_str2ep(ep_out, str);
198static inline int sock_tcp_name2ep(
sock_tcp_ep_t *ep_out,
const char *str)
200 return sock_tl_name2ep(ep_out, str);
204#if IS_ACTIVE(SOCK_HAS_UDP) || DOXYGEN
217static inline int sock_udp_str2ep(
sock_udp_ep_t *ep_out,
const char *str)
219 return sock_tl_str2ep(ep_out, str);
236static inline int sock_udp_name2ep(
sock_udp_ep_t *ep_out,
const char *str)
238 return sock_tl_name2ep(ep_out, str);
258#if IS_ACTIVE(SOCK_HAS_TCP) || DOXYGEN
275 return sock_tl_ep_equal(a, b);
279#if IS_ACTIVE(SOCK_HAS_UDP) || DOXYGEN
296 return sock_tl_ep_equal(a, b);
301#if defined(MODULE_SOCK_DTLS) || DOXYGEN
321 void *work_buf,
size_t work_buf_len);
(D)TLS credentials management module definitions
uint16_t credman_tag_t
Tag of the credential.
struct sock_udp sock_udp_t
forward declare for async
struct sock_dtls sock_dtls_t
forward declare for async
struct sock_dtls_session sock_dtls_session_t
Information about a created session.
struct _sock_tl_ep sock_tcp_ep_t
An end point for a TCP sock object.
struct _sock_tl_ep sock_udp_ep_t
An end point for a UDP sock object.
int sock_dtls_establish_session(sock_udp_t *sock_udp, sock_dtls_t *sock_dtls, sock_dtls_session_t *session, credman_tag_t tag, sock_udp_ep_t *local, const sock_udp_ep_t *remote, void *work_buf, size_t work_buf_len)
Helper function to establish a DTLS connection.
int sock_urlsplit(const char *url, char *hostport, char *urlpath)
Split url to host:port and url path.
const char * sock_urlpath(const char *url)
Returns a pointer to the path component in url.
Common IP-based transport layer end point.
Information about DTLS sock.