Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions include/zephyr/net/socket_ncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@ extern "C" {
#define SOCK_NATIVE 0x80000000
#define SOCK_NATIVE_TLS 0x40000000

/** Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options.
*/
#define NET_SOCKET_NCS_BASE 1000000000

/* NCS specific TLS level socket options */

/** Socket option to set DTLS handshake timeout, specifically for nRF sockets.
* The option accepts an integer, indicating the total handshake timeout,
* including retransmissions, in seconds.
* Accepted values for the option are: 1, 3, 7, 15, 31, 63, 123.
*/
#define TLS_DTLS_HANDSHAKE_TIMEO 18
#define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note, did we not have a SO_ prefix or similar for these?


/** Socket option to save DTLS connection, specifically for nRF sockets.
*/
#define TLS_DTLS_CONN_SAVE 19
#define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19)

/** Socket option to load DTLS connection, specifically for nRF sockets.
*/
#define TLS_DTLS_CONN_LOAD 20
#define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20)

/** Socket option to get result of latest TLS/DTLS completed handshakes end status,
* specifically for nRF sockets.
* The option accepts an integer, indicating the setting.
* Accepted vaules for the option are: 0 and 1.
*/
#define TLS_DTLS_HANDSHAKE_STATUS 21

/* Valid values for TLS_SESSION_CACHE option */
#define TLS_SESSION_CACHE_DISABLED 0 /**< Disable TLS session caching. */
#define TLS_SESSION_CACHE_ENABLED 1 /**< Enable TLS session caching. */
#define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21)

/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */
#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 /**< No timeout */
Expand All @@ -70,20 +70,20 @@ extern "C" {
/* NCS specific socket options */

/** sockopt: enable sending data as part of exceptional events */
#define SO_EXCEPTIONAL_DATA 33
#define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33)
/** sockopt: Keep socket open when its PDN connection is lost
* or the device is put into flight mode.
*/
#define SO_KEEPOPEN 34
#define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34)
/** sockopt: bind to PDN */
#define SO_BINDTOPDN 40
#define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40)

/** sockopt: Release assistance indication (RAI).
* The option accepts an integer, indicating the type of RAI.
* Accepted values for the option are: @ref RAI_NO_DATA, @ref RAI_LAST, @ref RAI_ONE_RESP,
* @ref RAI_ONGOING, @ref RAI_WAIT_MORE.
*/
#define SO_RAI 61
#define SO_RAI (NET_SOCKET_NCS_BASE + 61)

/** Release assistance indication (RAI).
* Indicate that the application does not intend to send more data.
Expand Down Expand Up @@ -121,27 +121,27 @@ extern "C" {
/** IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. */
#define IPPROTO_ALL 512
/** sockopt: disable all replies to unexpected traffics */
#define SO_SILENCE_ALL 30
#define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30)

/* NCS specific IPPROTO_IP level socket options */

/** sockopt: enable IPv4 ICMP replies */
#define SO_IP_ECHO_REPLY 31
#define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31)

/* NCS specific IPPROTO_IPV6 level socket options */

/** sockopt: enable IPv6 ICMP replies */
#define SO_IPV6_ECHO_REPLY 32
#define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32)

/** sockopt: Delay IPv6 address refresh during power saving mode */
#define SO_IPV6_DELAYED_ADDR_REFRESH 62
#define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62)

/* NCS specific TCP level socket options */

/** sockopt: Configurable TCP server session timeout in minutes.
* Range is 0 to 135. 0 is no timeout and 135 is 2 h 15 min. Default is 0 (no timeout).
*/
#define SO_TCP_SRV_SESSTIMEO 55
#define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55)

/* NCS specific gettaddrinfo() flags */

Expand Down