Skip to content

Commit 1fbee9f

Browse files
eivindj-nordicrlubos
authored andcommitted
[nrf noup] include: net: add NCS extensions
squash! [nrf noup] include: net: add NCS extensions Add secure socket options: * Add CID socket options to NCS specific options. * Add TLS/DTLS tls ciphersuite chosen socket option to NCS specific options. * Add TLS/DTLS connection save/load socket options to NCS specific options. * Add TLS/DTLS handshake status socket option to NCS specific options. Signed-off-by: Eivind Jølsgard <[email protected]> Signed-off-by: Emanuele Di Santo <[email protected]>
1 parent acb96b1 commit 1fbee9f

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

include/zephyr/net/socket_ncs.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,39 @@ extern "C" {
3434
*/
3535
#define TLS_DTLS_HANDSHAKE_TIMEO 14
3636

37+
/** Socket option to set and get DTLS CID setting, specifically for nRF sockets.
38+
* The option accepts an integer, indicating the setting.
39+
* Accepted vaules for the option are: 0, 1 and 2.
40+
*/
41+
#define TLS_DTLS_CID 17
42+
43+
/** Socket option to get DTLS CID status, specifically for nRF sockets.
44+
* The option accepts an integer, indicating the setting.
45+
* Accepted vaules for the option are: 0, 1, 2 and 3.
46+
*/
47+
#define TLS_DTLS_CID_STATUS 18
48+
49+
/** Socket option to save DTLS connection, specifically for nRF sockets.
50+
*/
51+
#define TLS_DTLS_CONN_SAVE 19
52+
53+
/** Socket option to load DTLS connection, specifically for nRF sockets.
54+
*/
55+
#define TLS_DTLS_CONN_LOAD 20
56+
57+
/** Socket option to get result of latest TLS/DTLS completed handshakes end status,
58+
* specifically for nRF sockets.
59+
* The option accepts an integer, indicating the setting.
60+
* Accepted vaules for the option are: 0 and 1.
61+
*/
62+
#define TLS_DTLS_HANDSHAKE_STATUS 21
63+
3764
/* Valid values for TLS_SESSION_CACHE option */
3865
#define TLS_SESSION_CACHE_DISABLED 0 /**< Disable TLS session caching. */
3966
#define TLS_SESSION_CACHE_ENABLED 1 /**< Enable TLS session caching. */
4067

4168
/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */
69+
#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */
4270
#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 /**< 1 second */
4371
#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 /**< 1s + 2s */
4472
#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 /**< 1s + 2s + 4s */
@@ -47,6 +75,21 @@ extern "C" {
4775
#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 /**< 1s + 2s + 4s + 8s + 16s + 32s */
4876
#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123 /**< 1s + 2s + 4s + 8s + 16s + 32s + 60s */
4977

78+
/* Valid values for TLS_DTLS_CID option */
79+
#define TLS_DTLS_CID_DISABLED 0
80+
#define TLS_DTLS_CID_SUPPORTED 1
81+
#define TLS_DTLS_CID_ENABLED 2
82+
83+
/* Valid values for TLS_DTLS_CID_STATUS option */
84+
#define TLS_DTLS_CID_STATUS_DISABLED 0
85+
#define TLS_DTLS_CID_STATUS_DOWNLINK 1
86+
#define TLS_DTLS_CID_STATUS_UPLINK 2
87+
#define TLS_DTLS_CID_STATUS_BIDIRECTIONAL 3
88+
89+
/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */
90+
#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0
91+
#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1
92+
5093
/* NCS specific socket options */
5194

5295
/** sockopt: disable all replies to unexpected traffics */

0 commit comments

Comments
 (0)