27#include "net/sock/config.h"
29#if MODULE_GNRC_SOCK_UDP || MODULE_LWIP_SOCK_UDP || MODULE_OPENWSN_SOCK_UDP || DOXYGEN
31# define SOCK_HAS_UDP 1
33#if MODULE_GNRC_SOCK_TCP || MODULE_LWIP_SOCK_TCP || DOXYGEN
35# define SOCK_HAS_TCP 1
37#ifdef MODULE_SOCK_DTLS
42#if MODULE_GNRC_SOCK_UDP || MODULE_LWIP_SOCK_UDP || MODULE_OPENWSN_SOCK_UDP \
43 || MODULE_GNRC_SOCK_TCP || MODULE_LWIP_SOCK_TCP || DOXYGEN
44# define HAVE_SOCK_TL_EP 1
94int sock_tl_ep_fmt(
const struct _sock_tl_ep *endpoint,
95 char *addr_str, uint16_t *port);
97#if IS_ACTIVE(SOCK_HAS_TCP) || DOXYGEN
108static inline int sock_tcp_ep_fmt(
const sock_tcp_ep_t *endpoint,
109 char *addr_str, uint16_t *port)
111 return sock_tl_ep_fmt(endpoint, addr_str, port);
115#if IS_ACTIVE(SOCK_HAS_UDP) || DOXYGEN
126static inline int sock_udp_ep_fmt(
const sock_udp_ep_t *endpoint,
127 char *addr_str, uint16_t *port)
129 return sock_tl_ep_fmt(endpoint, addr_str, port);
145int sock_tl_str2ep(
struct _sock_tl_ep *ep_out,
const char *str);
161int sock_tl_name2ep(
struct _sock_tl_ep *ep_out,
const char *str);
163#if IS_ACTIVE(SOCK_HAS_TCP) || DOXYGEN
176static inline int sock_tcp_str2ep(
sock_tcp_ep_t *ep_out,
const char *str)
178 return sock_tl_str2ep(ep_out, str);
195static inline int sock_tcp_name2ep(
sock_tcp_ep_t *ep_out,
const char *str)
197 return sock_tl_name2ep(ep_out, str);
201#if IS_ACTIVE(SOCK_HAS_UDP) || DOXYGEN
214static inline int sock_udp_str2ep(
sock_udp_ep_t *ep_out,
const char *str)
216 return sock_tl_str2ep(ep_out, str);
233static inline int sock_udp_name2ep(
sock_udp_ep_t *ep_out,
const char *str)
235 return sock_tl_name2ep(ep_out, str);
255#if IS_ACTIVE(SOCK_HAS_TCP) || DOXYGEN
272 return sock_tl_ep_equal(a, b);
276#if IS_ACTIVE(SOCK_HAS_UDP) || DOXYGEN
293 return sock_tl_ep_equal(a, b);
298#if defined(MODULE_SOCK_DTLS) || DOXYGEN
318 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.