14#include "uri_parser.h"
17#if IS_USED(MODULE_UNICOAP_SOCK_SUPPORT) || defined(DOXYGEN)
25#if IS_USED(MODULE_UNICOAP_DRIVER_DTLS) || defined(DOXYGEN)
62#define UNICOAP_SCHEME "coap"
67#define UNICOAP_SCHEME_UDP "coap"
72#define UNICOAP_SCHEME_DTLS "coaps"
77#define UNICOAP_SCHEME_TCP "coap+tcp"
82#define UNICOAP_SCHEME_TLS "coaps+tcp"
87#define UNICOAP_SCHEME_WEBSOCKET "coap+ws"
92#define UNICOAP_SCHEME_WEBSOCKET_TLS "coaps+ws"
97#define UNICOAP_SCHEME_BLE_GATT "coap"
105#define UNICOAP_DOMAIN_BLE ".ble.arpa"
120#define UNICOAP_PROTO_UNSPECIFIED (0)
125#define UNICOAP_PROTO_FLAG_RELIABLE_TRANSPORT (1)
189#if IS_USED(MODULE_UNICOAP_SOCK_SUPPORT) || defined(DOXYGEN)
206#if IS_USED(MODULE_UNICOAP_SOCK_SUPPORT) || defined(DOXYGEN)
295#if IS_USED(MODULE_UNICOAP_SOCK_SUPPORT) || defined(DOXYGEN)
323#if IS_USED(MODULE_UNICOAP_DRIVER_UDP) || defined(DOXYGEN)
333#if IS_USED(MODULE_UNICOAP_SOCK_SUPPORT) || defined(DOXYGEN)
349# if IS_USED(MODULE_UNICOAP_DRIVER_UDP) || defined(DOXYGEN)
369# if IS_USED(MODULE_UNICOAP_DRIVER_UDP) || defined(DOXYGEN)
393#if IS_USED(MODULE_UNICOAP_DRIVER_DTLS) || defined(DOXYGEN)
403#if IS_USED(MODULE_UNICOAP_SOCK_SUPPORT) || defined(DOXYGEN)
421# if IS_USED(MODULE_UNICOAP_DRIVER_DTLS) || defined(DOXYGEN)
445# if IS_USED(MODULE_UNICOAP_DRIVER_DTLS) || defined(DOXYGEN)
#define assert(cond)
abort the program if assertion is false
struct sock_udp sock_udp_t
forward declare for async
struct sock_dtls sock_dtls_t
forward declare for async
struct _sock_tl_ep sock_udp_ep_t
An end point for a UDP sock object.
sock_dtls_t * unicoap_transport_dtls_get_socket(void)
Returns the internal DTLS socket.
int unicoap_transport_dtls_add_socket(sock_dtls_t *socket, sock_udp_t *base_socket, sock_udp_ep_t *local)
Adds DTLS socket for client and server functionality.
sock_udp_t * unicoap_transport_udp_get_socket(void)
Returns the internal UDP socket.
int unicoap_transport_dtls_remove_socket(sock_dtls_t *socket)
Removes DTLS socket previously added manually.
int unicoap_transport_udp_add_socket(sock_udp_t *socket, sock_udp_ep_t *local)
Adds UDP socket for client and server functionality.
int unicoap_transport_udp_remove_socket(sock_udp_t *socket)
Removes UDP socket previously added manually.
unicoap_proto_t
Transport protocol CoAP is used over.
#define UNICOAP_PROTO_FLAG_RELIABLE_TRANSPORT
Protocol number flag indicating the transport is considered reliable on its own.
void unicoap_print_endpoint(const unicoap_endpoint_t *endpoint)
Prints the given CoAP endpoint.
const char * unicoap_string_from_proto(unicoap_proto_t proto)
Returns scheme from protocol number.
static sock_udp_ep_t * unicoap_endpoint_get_udp(unicoap_endpoint_t *endpoint)
Retrieves UDP endpoint from CoAP endpoint.
void unicoap_print_sock_tl_ep(const struct _sock_tl_ep *ep)
Prints the given transport layer endpoint.
static bool unicoap_transport_is_reliable(unicoap_proto_t proto)
Determines whether the given transport protocol is reliable.
bool unicoap_endpoint_is_equal(const unicoap_endpoint_t *source, const unicoap_endpoint_t *destination)
Compares two endpoints.
static bool unicoap_transport_uses_sock_tl_ep(unicoap_proto_t proto)
Determines whether the given transport driver uses a transport layer socket in RIOT.
bool unicoap_endpoint_is_multicast(const unicoap_endpoint_t *endpoint)
Determines whether the given endpoint is a multicast endpoint.
static sock_udp_ep_t * unicoap_endpoint_get_dtls(unicoap_endpoint_t *endpoint)
Retrieves DTLS endpoint from CoAP endpoint.
@ UNICOAP_PROTO_UDP
CoAP over UDP endpoint.
@ UNICOAP_PROTO_DTLS
CoAP over DTLS over UDP endpoint.
int socket(int domain, int type, int protocol)
Create an endpoint for communication.
iolist scatter / gather IO
Common macros and compiler attributes/pragmas configuration.
Asynchronous sock using Event Queue definitions.
Common sock API definitions.
Common IP-based transport layer end point.
Auxiliary exchange information.
const unicoap_message_properties_t * properties
Message properties.
const unicoap_endpoint_t * local
The local CoAP endpoint in this exchange.
const unicoap_endpoint_t * remote
The remote CoAP endpoint in this exchange.
sock_udp_ep_t dtls_ep
RIOT sock DTLS endpoint.
struct _sock_tl_ep _tl_ep
Transport layer endpoint.
unicoap_proto_t proto
Protocol number.
sock_udp_ep_t udp_ep
RIOT sock UDP endpoint.
Properties of a CoAP message.
Utility library for comparing and computing timestamps.
sock utility function definitions