Loading...
Searching...
No Matches
sock_dtls_types.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "dtls.h"
19#include "net/sock/udp.h"
20#include "net/credman.h"
21#include "net/sock/dtls/creds.h"
22#ifdef SOCK_HAS_ASYNC
24#endif
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#ifndef SOCK_DTLS_MBOX_SIZE
31#define SOCK_DTLS_MBOX_SIZE (4)
32#endif
33
37struct sock_dtls {
38 dtls_context_t *dtls_ctx;
40#if defined(SOCK_HAS_ASYNC) || defined(DOXYGEN)
44 void *buf_ctx;
52 session_t async_cb_session;
53#if defined(SOCK_HAS_ASYNC_CTX) || defined(DOXYGEN)
60#endif
61#endif
69 struct {
70 uint8_t *data;
71 size_t datalen;
72 session_t *session;
76 unsigned tags_len;
77 dtls_peer_type role;
80};
81
86 session_t dtls_session;
87};
88
89#ifdef __cplusplus
90}
91#endif
92
(D)TLS credentials management module definitions
DTLS sock definitions.
uint16_t credman_tag_t
Tag of the credential.
Definition credman.h:92
struct sock_udp sock_udp_t
forward declare for async
Definition types.h:136
void(* sock_dtls_cb_t)(sock_dtls_t *sock, sock_async_flags_t flags, void *arg)
Event callback for sock_dtls_t.
Definition types.h:65
#define CONFIG_DTLS_PSK_ID_HINT_MAX_SIZE
Default maximum size for the PSK Identity hint string.
Definition creds.h:34
#define CONFIG_DTLS_CREDENTIALS_MAX
Default buffer size for TLS credential tags.
Definition creds.h:41
credman_tag_t(* sock_dtls_client_psk_cb_t)(sock_dtls_t *sock, sock_udp_ep_t *ep, credman_tag_t tags[], unsigned tags_len, const char *hint, size_t hint_len)
Pre-Shared Key client callback.
Definition creds.h:58
credman_tag_t(* sock_dtls_rpk_cb_t)(sock_dtls_t *sock, sock_udp_ep_t *ep, credman_tag_t tags[], unsigned tags_len)
Raw Public Key callback.
Definition creds.h:73
UDP sock definitions.
#define SOCK_DTLS_MBOX_SIZE
Size of DTLS sock mailbox.
Mailbox struct definition.
Definition mbox.h:38
Describes a message object which can be sent between threads.
Definition msg.h:193
Asynchronous context for Asynchronous sock with event API.
Information about remote client connected to the server.
session_t dtls_session
TinyDTLS session.
Information about DTLS sock.
msg_t mbox_queue[SOCK_DTLS_MBOX_SIZE]
Queue for struct sock_dtls::mbox.
sock_dtls_cb_t async_cb
Asynchronous event callback.
session_t async_cb_session
asynchronous callback session
char psk_hint[CONFIG_DTLS_PSK_ID_HINT_MAX_SIZE]
PSK Identity hint.
mbox_t mbox
Mailbox for internal event handling.
struct sock_dtls::@313177012326264134307044047215004171134010121044 buffer
Buffer used to pass decrypted data and its session information.
dtls_context_t * dtls_ctx
TinyDTLS context for sock.
unsigned tags_len
Number of tags in the list 'tags'.
void * async_cb_arg
asynchronous callback arg
sock_async_ctx_t async_ctx
Asynchronous event context.
session_t * session
Session information.
sock_udp_t * udp_sock
Underlying UDP sock to use.
credman_tag_t tags[CONFIG_DTLS_CREDENTIALS_MAX]
Tags of the available credentials.
size_t datalen
data length
uint8_t * data
Pointer to the decrypted data.
dtls_peer_type role
DTLS role of the socket.
void * buf_ctx
Network stack internal buffer context.
sock_dtls_rpk_cb_t rpk_cb
Callback to determine RPK credential for session.
sock_dtls_client_psk_cb_t client_psk_cb
Callback to determine PSK credential for session.
Definitions for sock extension for asynchronous access.