dtls.h File Reference

DTLS sock definitions. More...

Detailed Description

#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
#include "net/sock.h"
#include "net/sock/udp.h"
#include "net/credman.h"
#include "sock_dtls_types.h"
+ Include dependency graph for dtls.h:

Go to the source code of this file.

Typedefs

typedef struct sock_dtls sock_dtls_t
 Type for a DTLS sock object. More...
 
typedef struct sock_dtls_session sock_dtls_session_t
 Information about a created session.
 

Functions

void sock_dtls_init (void)
 Called exactly once during auto_init. More...
 
int sock_dtls_create (sock_dtls_t *sock, sock_udp_t *udp_sock, credman_tag_t tag, unsigned version, unsigned role)
 Creates a new DTLS sock object. More...
 
int sock_dtls_session_create (sock_dtls_t *sock, const sock_udp_ep_t *ep, sock_dtls_session_t *remote)
 Creates a new DTLS session. More...
 
void sock_dtls_session_destroy (sock_dtls_t *sock, sock_dtls_session_t *remote)
 Destroys an existing DTLS session. More...
 
ssize_t sock_dtls_recv (sock_dtls_t *sock, sock_dtls_session_t *remote, void *data, size_t maxlen, uint32_t timeout)
 Decrypts and reads a message from a remote peer. More...
 
ssize_t sock_dtls_send (sock_dtls_t *sock, sock_dtls_session_t *remote, const void *data, size_t len)
 Encrypts and sends a message to a remote peer. More...
 
void sock_dtls_close (sock_dtls_t *sock)
 Closes a DTLS sock. More...
 
enum  { SOCK_DTLS_1_0 = 1, SOCK_DTLS_1_2 = 2, SOCK_DTLS_1_3 = 3 }
 DTLS version number. More...
 
enum  { SOCK_DTLS_CLIENT = 1, SOCK_DTLS_SERVER = 2 }
 DTLS role. More...