sock_dtls_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 HAW Hamburg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef SOCK_DTLS_TYPES_H
20 #define SOCK_DTLS_TYPES_H
21 
22 #include "dtls.h"
23 #include "net/sock/udp.h"
24 #include "net/credman.h"
25 #ifdef SOCK_HAS_ASYNC
26 #include "net/sock/async/types.h"
27 #endif
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #ifndef SOCK_DTLS_MBOX_SIZE
34 #define SOCK_DTLS_MBOX_SIZE (4)
35 #endif
36 
40 struct sock_dtls {
41  dtls_context_t *dtls_ctx;
43 #if defined(SOCK_HAS_ASYNC) || defined(DOXYGEN)
44 
47  void *buf_ctx;
54  void *async_cb_arg;
55 #if defined(SOCK_HAS_ASYNC_CTX) || defined(DOXYGEN)
56 
62 #endif
63 #endif
71  struct {
72  uint8_t *data;
73  size_t datalen;
74  session_t *session;
75  } buffer;
78  dtls_peer_type role;
79 };
80 
87  session_t dtls_session;
88 };
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif /* SOCK_DTLS_TYPES_H */
95 
credman.h
(D)TLS credentials management module definitions
sock_dtls_session::dtls_session
session_t dtls_session
TinyDTLS session.
Definition: sock_dtls_types.h:87
sock_dtls::mbox_queue
msg_t mbox_queue[SOCK_DTLS_MBOX_SIZE]
Queue for struct sock_dtls::mbox.
Definition: sock_dtls_types.h:66
udp.h
UDP sock definitions.
SOCK_DTLS_MBOX_SIZE
#define SOCK_DTLS_MBOX_SIZE
Size of DTLS sock mailbox.
Definition: sock_dtls_types.h:34
sock_dtls::async_cb
sock_dtls_cb_t async_cb
Asynchronous event callback.
Definition: sock_dtls_types.h:53
sock_dtls::role
dtls_peer_type role
DTLS role of the socket.
Definition: sock_dtls_types.h:78
sock_dtls::data
uint8_t * data
Pointer to the decrypted data.
Definition: sock_dtls_types.h:72
sock_dtls::mbox
mbox_t mbox
Mailbox for internal event handling.
Definition: sock_dtls_types.h:64
sock_dtls_session::ep
sock_udp_ep_t ep
Remote endpoint the session is connected to.
Definition: sock_dtls_types.h:85
sock_dtls::session
session_t * session
Session information.
Definition: sock_dtls_types.h:74
sock_async_ctx_t
Asynchronous context for Asynchronous sock with event API.
Definition: sock_async_ctx.h:64
types.h
Definitions for sock extension for asynchronous access.
mbox_t
Mailbox struct definition.
Definition: mbox.h:41
sock_dtls
Information about DTLS sock.
Definition: sock_dtls_types.h:40
sock_udp
UDP sock type.
Definition: sock_types.h:128
sock_dtls::tag
credman_tag_t tag
Credential tag of a registered (D)TLS credential.
Definition: sock_dtls_types.h:76
sock_dtls::buf_ctx
void * buf_ctx
Network stack internal buffer context.
Definition: sock_dtls_types.h:47
_sock_tl_ep
Common IP-based transport layer end point.
Definition: sock.h:213
sock_dtls_cb_t
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:68
sock_dtls_session
Information about remote client connected to the server.
Definition: sock_dtls_types.h:84
sock_dtls::udp_sock
sock_udp_t * udp_sock
Underlying UDP sock to use.
Definition: sock_dtls_types.h:42
sock_dtls::dtls_ctx
dtls_context_t * dtls_ctx
TinyDTLS context for sock.
Definition: sock_dtls_types.h:41
sock_dtls::async_cb_arg
void * async_cb_arg
asynchronous callback arg
Definition: sock_dtls_types.h:54
credman_tag_t
uint16_t credman_tag_t
Tag of the credential.
Definition: credman.h:88
sock_dtls::async_ctx
sock_async_ctx_t async_ctx
Asynchronous event context.
Definition: sock_dtls_types.h:61
msg_t
Describes a message object which can be sent between threads.
Definition: msg.h:185
sock_dtls::buffer
struct sock_dtls::@244 buffer
Buffer used to pass decrypted data and its session information.
sock_dtls::datalen
size_t datalen
data length
Definition: sock_dtls_types.h:73