From 9c6b6e7a9dd337093a617156f7127d97ae1ecfee Mon Sep 17 00:00:00 2001 From: Kacper Radoszewski Date: Thu, 27 Nov 2025 08:57:56 +0100 Subject: [PATCH] [nrf noup] include: net: add TLS_DTLS_FRAG_EXT to NCS extensions nrf-squash! [nrf noup] include: net: add NCS extensions The TLS_DTLS_FRAG_EXT socket option is used to enable and disable the DTLS fragmentation extension. Signed-off-by: Kacper Radoszewski --- include/zephyr/net/socket_ncs.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/zephyr/net/socket_ncs.h b/include/zephyr/net/socket_ncs.h index 6a77d6c41f13..7c8bae645f6c 100644 --- a/include/zephyr/net/socket_ncs.h +++ b/include/zephyr/net/socket_ncs.h @@ -69,6 +69,27 @@ extern "C" { #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 #define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 +/** Socket option to enable the DTLS fragmentation extension. + * Accepted values for the option are: @ref DTLS_FRAG_EXT_DISABLED, + * @ref DTLS_FRAG_EXT_512_ENABLED, @ref DTLS_FRAG_EXT_1024_ENABLED. + */ +#define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) + +/** Disabled - The DTLS fragmentation extension is not included in the Client Hello. */ +#define DTLS_FRAG_EXT_DISABLED 0 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 512 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 512 bytes. + */ +#define DTLS_FRAG_EXT_512_ENABLED 1 +/** Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment + * size of 1024 bytes. + * + * @note The user data size in send requests also becomes limited to a maximum of 1024 bytes. + */ +#define DTLS_FRAG_EXT_1024_ENABLED 2 + /* NCS specific socket options */ /** sockopt: enable sending data as part of exceptional events */