Loading...
Searching...
No Matches
dsm.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 ML!PA Consulting GmbH
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
28
29#include <stdint.h>
30
31#include "dtls.h"
32#include "net/sock/dtls.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
41#ifndef CONFIG_DSM_PEER_MAX
42#define CONFIG_DSM_PEER_MAX (CONFIG_DTLS_PEER_MAX)
43#endif
44
48typedef enum {
49 NO_SPACE = -1,
50 SESSION_STATE_NONE = 0,
51 SESSION_STATE_HANDSHAKE,
52 SESSION_STATE_ESTABLISHED
54
60void dsm_init(void);
61
79 dsm_state_t new_state, bool restore);
80
90
97
104
115
116#ifdef __cplusplus
117}
118#endif
119
DTLS.
void dsm_remove(sock_dtls_t *sock, sock_dtls_session_t *session)
Removes a session.
dsm_state_t dsm_store(sock_dtls_t *sock, sock_dtls_session_t *session, dsm_state_t new_state, bool restore)
Stores a session.
uint8_t dsm_get_num_maximum_slots(void)
Returns the maximum number of sessions slots.
uint8_t dsm_get_num_available_slots(void)
Returns the number of available session slots.
ssize_t dsm_get_least_recently_used_session(sock_dtls_t *sock, sock_dtls_session_t *session)
Returns the least recently used session.
void dsm_init(void)
Initialize the DTLS session management.
dsm_state_t
Session management states.
Definition dsm.h:48
struct sock_dtls sock_dtls_t
forward declare for async
Definition types.h:44
struct sock_dtls_session sock_dtls_session_t
Information about a created session.
Definition dtls.h:635
DTLS sock definitions.