Loading...
Searching...
No Matches

CoAP transport protocol abstraction layer. More...

Detailed Description

CoAP transport protocol abstraction layer.

Author
Carl Seifert carl..nosp@m.seif.nosp@m.ert@t.nosp@m.u-dr.nosp@m.esden.nosp@m..de

Definition in file transport.h.

#include <stdbool.h>
#include <stdint.h>
#include "iolist.h"
#include "timex.h"
#include "uri_parser.h"
#include "modules.h"
#include "net/sock.h"
#include "net/sock/async/event.h"
#include "net/sock/util.h"
#include "net/sock/udp.h"
#include "net/sock/tcp.h"
#include "net/sock/dtls.h"
#include "net/unicoap/message.h"
#include "net/unicoap/options.h"
+ Include dependency graph for transport.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  unicoap_endpoint_t
 A CoAP endpoint. More...
 
struct  unicoap_aux_t
 Auxiliary exchange information. More...
 

CoAP URI schemes

The goal for CoAP is to have coap as the only scheme, with the underlying transport being inferred using CoAP Transport Indication.

#define UNICOAP_SCHEME   "coap"
 Default CoAP URI scheme.
 
#define UNICOAP_SCHEME_UDP   "coap"
 URI scheme for CoAP over UDP.
 
#define UNICOAP_SCHEME_DTLS   "coaps"
 URI scheme for CoAP over DTLS.
 
#define UNICOAP_SCHEME_TCP   "coap+tcp"
 URI scheme for CoAP over TCP.
 
#define UNICOAP_SCHEME_TLS   "coaps+tcp"
 URI scheme for CoAP over TLS.
 
#define UNICOAP_SCHEME_WEBSOCKET   "coap+ws"
 URI scheme for CoAP over WebSockets.
 
#define UNICOAP_SCHEME_WEBSOCKET_TLS   "coaps+ws"
 URI scheme for CoAP over secure WebSockets (over TLS)
 
#define UNICOAP_SCHEME_BLE_GATT   "coap"
 URI scheme for CoAP over GATT over Bluetooth Low Energy (BLE)
 
#define UNICOAP_DOMAIN_BLE   ".ble.arpa"
 Domain for for CoAP over GATT over Bluetooth Low Energy (BLE)
 

Endpoints

#define UNICOAP_PROTO_UNSPECIFIED   (0)
 Unspecified protocol number.
 
#define UNICOAP_PROTO_FLAG_RELIABLE_TRANSPORT   (1)
 Protocol number flag indicating the transport is considered reliable on its own.
 
enum  unicoap_proto_t { UNICOAP_PROTO_UDP = 1 << 1 , UNICOAP_PROTO_DTLS = 2 << 1 }
 Transport protocol CoAP is used over. More...
 
static bool unicoap_transport_is_reliable (unicoap_proto_t proto)
 Determines whether the given transport protocol is reliable.
 
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.
 

Conversions and Tools

const char * unicoap_string_from_proto (unicoap_proto_t proto)
 Returns scheme from protocol number.
 
bool unicoap_endpoint_is_equal (const unicoap_endpoint_t *source, const unicoap_endpoint_t *destination)
 Compares two endpoints.
 
bool unicoap_endpoint_is_multicast (const unicoap_endpoint_t *endpoint)
 Determines whether the given endpoint is a multicast endpoint.
 
void unicoap_print_sock_tl_ep (const struct _sock_tl_ep *ep)
 Prints the given transport layer endpoint.
 
void unicoap_print_endpoint (const unicoap_endpoint_t *endpoint)
 Prints the given CoAP endpoint.
 

Sockets

sock_udp_tunicoap_transport_udp_get_socket (void)
 Returns the internal UDP socket.
 
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.
 
sock_dtls_tunicoap_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.
 
int unicoap_transport_dtls_remove_socket (sock_dtls_t *socket)
 Removes DTLS socket previously added manually.