![]() |
Zephyr API 3.6.99
|
NCS specific additions to the BSD sockets API definitions. More...
Go to the source code of this file.
Data Structures | |
| struct | socket_ncs_sendcb_params |
| Parameters returned in the socket_ncs_sendcb_t callback. More... | |
| struct | socket_ncs_sendcb |
| Option value for the SO_SENDCB socket option. More... | |
| struct | socket_ncs_pollcb_params |
| Parameters returned in the socket_ncs_pollcb_t callback. More... | |
| struct | socket_ncs_pollcb |
| Option value for the SO_POLLCB socket option. More... | |
Macros | |
| #define | SOCK_NATIVE 0x80000000 |
| #define | SOCK_NATIVE_TLS 0x40000000 |
| #define | NET_SOCKET_NCS_BASE 1000 |
| Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options. | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) |
| Socket option to set DTLS handshake timeout, specifically for nRF sockets. | |
| #define | TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) |
| Socket option to save DTLS connection, specifically for nRF sockets. | |
| #define | TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) |
| Socket option to load DTLS connection, specifically for nRF sockets. | |
| #define | TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) |
| Socket option to get result of latest TLS/DTLS completed handshakes end status, specifically for nRF sockets. | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 |
| No timeout. | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_1S 1 |
| 1 second | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_3S 3 |
| 1s + 2s | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_7S 7 |
| 1s + 2s + 4s | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_15S 15 |
| 1s + 2s + 4s + 8s | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_31S 31 |
| 1s + 2s + 4s + 8s + 16s | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_63S 63 |
| 1s + 2s + 4s + 8s + 16s + 32s | |
| #define | TLS_DTLS_HANDSHAKE_TIMEO_123S 123 |
| 1s + 2s + 4s + 8s + 16s + 32s + 60s | |
| #define | TLS_DTLS_HANDSHAKE_STATUS_FULL 0 |
| #define | TLS_DTLS_HANDSHAKE_STATUS_CACHED 1 |
| #define | TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) |
| Socket option to enable the DTLS fragmentation extension. | |
| #define | DTLS_FRAG_EXT_DISABLED 0 |
| Disabled - The DTLS fragmentation extension is not included in the Client Hello. | |
| #define | DTLS_FRAG_EXT_512_ENABLED 1 |
| Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment size of 512 bytes. | |
| #define | DTLS_FRAG_EXT_1024_ENABLED 2 |
| Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment size of 1024 bytes. | |
| #define | SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) |
| sockopt: enable sending data as part of exceptional events | |
| #define | SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) |
| sockopt: Keep socket open when its PDN connection is lost or the device is put into flight mode. | |
| #define | SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) |
| sockopt: bind to PDN | |
| #define | SO_RAI (NET_SOCKET_NCS_BASE + 61) |
| sockopt: Release assistance indication (RAI). | |
| #define | RAI_NO_DATA 1 |
| Release assistance indication (RAI). | |
| #define | RAI_LAST 2 |
| Release assistance indication (RAI). | |
| #define | RAI_ONE_RESP 3 |
| Release assistance indication (RAI). | |
| #define | RAI_ONGOING 4 |
| Release assistance indication (RAI). | |
| #define | RAI_WAIT_MORE 5 |
| Release assistance indication (RAI). | |
| #define | SO_SENDCB (NET_SOCKET_NCS_BASE + 63) |
| sockopt: set a callback to be called when a send request is acknowledged by the network and the data has been acknowledged by the peer, if required by the network protocol, or until the timeout, given by the SO_SNDTIMEO socket option, is reached. | |
| #define | SO_POLLCB (NET_SOCKET_NCS_BASE + 64) |
| sockopt: set a callback to be called upon the selected poll events. | |
| #define | IPPROTO_ALL 512 |
| IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets. | |
| #define | SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) |
| sockopt: disable all replies to unexpected traffics | |
| #define | SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) |
| sockopt: enable IPv4 ICMP replies | |
| #define | SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) |
| sockopt: enable IPv6 ICMP replies | |
| #define | SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) |
| sockopt: Delay IPv6 address refresh during power saving mode | |
| #define | SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) |
| sockopt: Configurable TCP server session timeout in minutes. | |
| #define | AI_PDNSERV 0x1000 |
Assume service contains a Packet Data Network (PDN) ID. | |
| #define | MSG_WAITACK 0x200 |
| Request a blocking send operation until the request is acknowledged. | |
Typedefs | |
| typedef void(* | socket_ncs_sendcb_t) (const struct socket_ncs_sendcb_params *params) |
| Callback type in the socket_ncs_sendcb structure. | |
| typedef void(* | socket_ncs_pollcb_t) (const struct socket_ncs_pollcb_params *params) |
| Callback type in the socket_ncs_pollcb structure. | |
NCS specific additions to the BSD sockets API definitions.
| #define AI_PDNSERV 0x1000 |
Assume service contains a Packet Data Network (PDN) ID.
When specified together with the AI_NUMERICSERV flag, service shall be formatted as follows: "port:pdn_id" where "port" is the port number and "pdn_id" is the PDN ID. Example: "8080:1", port 8080 PDN ID 1. Example: "42:0", port 42 PDN ID 0.
| #define DTLS_FRAG_EXT_1024_ENABLED 2 |
Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment size of 1024 bytes.
| #define DTLS_FRAG_EXT_512_ENABLED 1 |
Enabled - The DTLS fragmentation extension is included in the Client Hello with the fragment size of 512 bytes.
| #define DTLS_FRAG_EXT_DISABLED 0 |
Disabled - The DTLS fragmentation extension is not included in the Client Hello.
| #define IPPROTO_ALL 512 |
IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets.
| #define MSG_WAITACK 0x200 |
Request a blocking send operation until the request is acknowledged.
When used in send() or sendto(), the request will not return until the send operation is completed by lower layers, or until the timeout, given by the SO_SNDTIMEO socket option, is reached. Valid timeout values are 1 to 600 seconds.
| #define NET_SOCKET_NCS_BASE 1000 |
Define a base for NCS specific socket options to prevent overlaps with Zephyr's socket options.
| #define RAI_LAST 2 |
| #define RAI_NO_DATA 1 |
Release assistance indication (RAI).
Indicate that the application does not intend to send more data. This applies immediately and lets the modem exit connected mode more quickly.
| #define RAI_ONE_RESP 3 |
| #define RAI_ONGOING 4 |
Release assistance indication (RAI).
Indicate that the socket is in active use by a client application. This lets the modem stay in connected mode longer.
| #define RAI_WAIT_MORE 5 |
Release assistance indication (RAI).
Indicate that the socket is in active use by a server application. This lets the modem stay in connected mode longer.
| #define SO_BINDTOPDN (NET_SOCKET_NCS_BASE + 40) |
sockopt: bind to PDN
| #define SO_EXCEPTIONAL_DATA (NET_SOCKET_NCS_BASE + 33) |
sockopt: enable sending data as part of exceptional events
| #define SO_IP_ECHO_REPLY (NET_SOCKET_NCS_BASE + 31) |
sockopt: enable IPv4 ICMP replies
| #define SO_IPV6_DELAYED_ADDR_REFRESH (NET_SOCKET_NCS_BASE + 62) |
sockopt: Delay IPv6 address refresh during power saving mode
| #define SO_IPV6_ECHO_REPLY (NET_SOCKET_NCS_BASE + 32) |
sockopt: enable IPv6 ICMP replies
| #define SO_KEEPOPEN (NET_SOCKET_NCS_BASE + 34) |
sockopt: Keep socket open when its PDN connection is lost or the device is put into flight mode.
| #define SO_POLLCB (NET_SOCKET_NCS_BASE + 64) |
sockopt: set a callback to be called upon the selected poll events.
This option takes a socket_ncs_pollcb structure.
| #define SO_RAI (NET_SOCKET_NCS_BASE + 61) |
sockopt: Release assistance indication (RAI).
The option accepts an integer, indicating the type of RAI. Accepted values for the option are: RAI_NO_DATA, RAI_LAST, RAI_ONE_RESP, RAI_ONGOING, RAI_WAIT_MORE.
| #define SO_SENDCB (NET_SOCKET_NCS_BASE + 63) |
sockopt: set a callback to be called when a send request is acknowledged by the network and the data has been acknowledged by the peer, if required by the network protocol, or until the timeout, given by the SO_SNDTIMEO socket option, is reached.
Valid timeout values are 1 to 600 seconds. This option takes a socket_ncs_sendcb structure.
This socket option cannot be used along with the MSG_WAITACK send flag.
| #define SO_SILENCE_ALL (NET_SOCKET_NCS_BASE + 30) |
sockopt: disable all replies to unexpected traffics
| #define SO_TCP_SRV_SESSTIMEO (NET_SOCKET_NCS_BASE + 55) |
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 SOCK_NATIVE 0x80000000 |
| #define SOCK_NATIVE_TLS 0x40000000 |
| #define TLS_DTLS_CONN_LOAD (NET_SOCKET_NCS_BASE + 20) |
Socket option to load DTLS connection, specifically for nRF sockets.
| #define TLS_DTLS_CONN_SAVE (NET_SOCKET_NCS_BASE + 19) |
Socket option to save DTLS connection, specifically for nRF sockets.
| #define TLS_DTLS_FRAG_EXT (NET_SOCKET_NCS_BASE + 22) |
Socket option to enable the DTLS fragmentation extension.
Accepted values for the option are: DTLS_FRAG_EXT_DISABLED, DTLS_FRAG_EXT_512_ENABLED, DTLS_FRAG_EXT_1024_ENABLED.
| #define TLS_DTLS_HANDSHAKE_STATUS (NET_SOCKET_NCS_BASE + 21) |
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_CACHED 1 |
| #define TLS_DTLS_HANDSHAKE_STATUS_FULL 0 |
| #define TLS_DTLS_HANDSHAKE_TIMEO (NET_SOCKET_NCS_BASE + 18) |
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_123S 123 |
1s + 2s + 4s + 8s + 16s + 32s + 60s
| #define TLS_DTLS_HANDSHAKE_TIMEO_15S 15 |
1s + 2s + 4s + 8s
| #define TLS_DTLS_HANDSHAKE_TIMEO_1S 1 |
1 second
| #define TLS_DTLS_HANDSHAKE_TIMEO_31S 31 |
1s + 2s + 4s + 8s + 16s
| #define TLS_DTLS_HANDSHAKE_TIMEO_3S 3 |
1s + 2s
| #define TLS_DTLS_HANDSHAKE_TIMEO_63S 63 |
1s + 2s + 4s + 8s + 16s + 32s
| #define TLS_DTLS_HANDSHAKE_TIMEO_7S 7 |
1s + 2s + 4s
| #define TLS_DTLS_HANDSHAKE_TIMEO_NONE 0 |
No timeout.
| typedef void(* socket_ncs_pollcb_t) (const struct socket_ncs_pollcb_params *params) |
Callback type in the socket_ncs_pollcb structure.
| typedef void(* socket_ncs_sendcb_t) (const struct socket_ncs_sendcb_params *params) |
Callback type in the socket_ncs_sendcb structure.