Zephyr API 3.6.99
Loading...
Searching...
No Matches
socket_ncs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_
8#define ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_
9
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/* When CONFIG_NET_SOCKETS_OFFLOAD is enabled, offloaded sockets take precedence
20 * when creating a new socket. Combine this flag with a socket type when
21 * creating a socket, to enforce native socket creation (e. g. SOCK_STREAM | SOCK_NATIVE).
22 * If it's desired to create a native TLS socket, but still offload the
23 * underlying TCP/UDP socket, use e. g. SOCK_STREAM | SOCK_NATIVE_TLS.
24 */
25#define SOCK_NATIVE 0x80000000
26#define SOCK_NATIVE_TLS 0x40000000
27
28/* NCS specific TLS level socket options */
29
35#define TLS_DTLS_HANDSHAKE_TIMEO 18
36
39#define TLS_DTLS_CONN_SAVE 19
40
43#define TLS_DTLS_CONN_LOAD 20
44
50#define TLS_DTLS_HANDSHAKE_STATUS 21
51
52/* Valid values for TLS_SESSION_CACHE option */
53#define TLS_SESSION_CACHE_DISABLED 0
54#define TLS_SESSION_CACHE_ENABLED 1
56/* Valid values for TLS_DTLS_HANDSHAKE_TIMEO option */
57#define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0
58#define TLS_DTLS_HANDSHAKE_TIMEO_1S 1
59#define TLS_DTLS_HANDSHAKE_TIMEO_3S 3
60#define TLS_DTLS_HANDSHAKE_TIMEO_7S 7
61#define TLS_DTLS_HANDSHAKE_TIMEO_15S 15
62#define TLS_DTLS_HANDSHAKE_TIMEO_31S 31
63#define TLS_DTLS_HANDSHAKE_TIMEO_63S 63
64#define TLS_DTLS_HANDSHAKE_TIMEO_123S 123
66/* Valid values for TLS_DTLS_HANDSHAKE_STATUS option */
67#define TLS_DTLS_HANDSHAKE_STATUS_FULL 0
68#define TLS_DTLS_HANDSHAKE_STATUS_CACHED 1
69
70/* NCS specific socket options */
71
73#define SO_EXCEPTIONAL_DATA 33
77#define SO_KEEPOPEN 34
79#define SO_BINDTOPDN 40
80
86#define SO_RAI 61
87
95#define RAI_NO_DATA 1
101#define RAI_LAST 2
107#define RAI_ONE_RESP 3
112#define RAI_ONGOING 4
117#define RAI_WAIT_MORE 5
118
119/* NCS specific IPPROTO_ALL level socket options */
120
122#define IPPROTO_ALL 512
124#define SO_SILENCE_ALL 30
125
126/* NCS specific IPPROTO_IP level socket options */
127
129#define SO_IP_ECHO_REPLY 31
130
131/* NCS specific IPPROTO_IPV6 level socket options */
132
134#define SO_IPV6_ECHO_REPLY 32
135
137#define SO_IPV6_DELAYED_ADDR_REFRESH 62
138
139/* NCS specific TCP level socket options */
140
144#define SO_TCP_SRV_SESSTIMEO 55
145
146/* NCS specific gettaddrinfo() flags */
147
155#define AI_PDNSERV 0x1000
156
157/* NCS specific send() and sendto() flags */
158
164#define MSG_WAITACK 0x200
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* ZEPHYR_INCLUDE_NET_SOCKET_NCS_H_ */