Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
socket_ncs.h File Reference

NCS specific additions to the BSD sockets API definitions. More...

Go to the source code of this file.

Macros

#define SOCK_NATIVE   0x80000000
 
#define SOCK_NATIVE_TLS   0x40000000
 
#define TLS_DTLS_HANDSHAKE_TIMEO   18
 Socket option to set DTLS handshake timeout, specifically for nRF sockets.
 
#define TLS_DTLS_CONN_SAVE   19
 Socket option to save DTLS connection, specifically for nRF sockets.
 
#define TLS_DTLS_CONN_LOAD   20
 Socket option to load DTLS connection, specifically for nRF sockets.
 
#define TLS_DTLS_HANDSHAKE_STATUS   21
 Socket option to get result of latest TLS/DTLS completed handshakes end status, specifically for nRF sockets.
 
#define TLS_SESSION_CACHE_DISABLED   0
 Disable TLS session caching.
 
#define TLS_SESSION_CACHE_ENABLED   1
 Enable TLS session caching.
 
#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 SO_EXCEPTIONAL_DATA   33
 sockopt: enable sending data as part of exceptional events
 
#define SO_KEEPOPEN   34
 sockopt: Keep socket open when its PDN connection is lost or the device is put into flight mode.
 
#define SO_BINDTOPDN   40
 sockopt: bind to PDN
 
#define SO_RAI_NO_DATA   50
 sockopt: Release Assistance Indication feature: This will indicate that the application will not send any more data.
 
#define SO_RAI_LAST   51
 sockopt: Release Assistance Indication feature: This will indicate that the next call to send/sendto will be the last one for some time.
 
#define SO_RAI_ONE_RESP   52
 sockopt: Release Assistance Indication feature: This will indicate that after the next call to send/sendto, the application is expecting to receive one more data packet before this socket will not be used again for some time.
 
#define SO_RAI_ONGOING   53
 sockopt: Release Assistance Indication feature: If a client application expects to use the socket more it can indicate that by setting this socket option before the next send call which will keep the network up longer.
 
#define SO_RAI_WAIT_MORE   54
 sockopt: Release Assistance Indication feature: If a server application expects to use the socket more it can indicate that by setting this socket option before the next send call.
 
#define SO_RAI   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 IPPROTO_ALL   512
 IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets.
 
#define SO_SILENCE_ALL   30
 sockopt: disable all replies to unexpected traffics
 
#define SO_IP_ECHO_REPLY   31
 sockopt: enable IPv4 ICMP replies
 
#define SO_IPV6_ECHO_REPLY   32
 sockopt: enable IPv6 ICMP replies
 
#define SO_TCP_SRV_SESSTIMEO   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.
 

Detailed Description

NCS specific additions to the BSD sockets API definitions.

Macro Definition Documentation

◆ AI_PDNSERV

#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.

◆ IPPROTO_ALL

#define IPPROTO_ALL   512

IPv4 and IPv6 protocol level (pseudo-val) for nRF sockets.

◆ MSG_WAITACK

#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.

◆ RAI_LAST

#define RAI_LAST   2

Release assistance indication (RAI).

Indicate that the application does not intend to send more data after the next call to send() or sendto(). This lets the modem exit connected mode more quickly after sending the data.

◆ RAI_NO_DATA

#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.

Note
This requires the socket to be connected.

◆ RAI_ONE_RESP

#define RAI_ONE_RESP   3

Release assistance indication (RAI).

Indicate that the application is expecting to receive just one data packet after the next call to send() or sendto(). This lets the modem exit connected mode more quickly after having received the data.

◆ RAI_ONGOING

#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.

◆ RAI_WAIT_MORE

#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.

◆ SO_BINDTOPDN

#define SO_BINDTOPDN   40

sockopt: bind to PDN

◆ SO_EXCEPTIONAL_DATA

#define SO_EXCEPTIONAL_DATA   33

sockopt: enable sending data as part of exceptional events

◆ SO_IP_ECHO_REPLY

#define SO_IP_ECHO_REPLY   31

sockopt: enable IPv4 ICMP replies

◆ SO_IPV6_ECHO_REPLY

#define SO_IPV6_ECHO_REPLY   32

sockopt: enable IPv6 ICMP replies

◆ SO_KEEPOPEN

#define SO_KEEPOPEN   34

sockopt: Keep socket open when its PDN connection is lost or the device is put into flight mode.

◆ SO_RAI

#define SO_RAI   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.

◆ SO_RAI_LAST

#define SO_RAI_LAST   51

sockopt: Release Assistance Indication feature: This will indicate that the next call to send/sendto will be the last one for some time.

Deprecated:
use SO_RAI with value RAI_LAST instead.

◆ SO_RAI_NO_DATA

#define SO_RAI_NO_DATA   50

sockopt: Release Assistance Indication feature: This will indicate that the application will not send any more data.

Note
This socket option requires the socket to be connected.
Deprecated:
use SO_RAI with value RAI_NO_DATA instead.

◆ SO_RAI_ONE_RESP

#define SO_RAI_ONE_RESP   52

sockopt: Release Assistance Indication feature: This will indicate that after the next call to send/sendto, the application is expecting to receive one more data packet before this socket will not be used again for some time.

Deprecated:
use SO_RAI with value RAI_ONE_RESP instead.

◆ SO_RAI_ONGOING

#define SO_RAI_ONGOING   53

sockopt: Release Assistance Indication feature: If a client application expects to use the socket more it can indicate that by setting this socket option before the next send call which will keep the network up longer.

Deprecated:
use SO_RAI with value RAI_ONGOING instead.

◆ SO_RAI_WAIT_MORE

#define SO_RAI_WAIT_MORE   54

sockopt: Release Assistance Indication feature: If a server application expects to use the socket more it can indicate that by setting this socket option before the next send call.

Deprecated:
use SO_RAI with value RAI_WAIT_MORE instead.

◆ SO_SILENCE_ALL

#define SO_SILENCE_ALL   30

sockopt: disable all replies to unexpected traffics

◆ SO_TCP_SRV_SESSTIMEO

#define SO_TCP_SRV_SESSTIMEO   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).

◆ SOCK_NATIVE

#define SOCK_NATIVE   0x80000000

◆ SOCK_NATIVE_TLS

#define SOCK_NATIVE_TLS   0x40000000

◆ TLS_DTLS_CONN_LOAD

#define TLS_DTLS_CONN_LOAD   20

Socket option to load DTLS connection, specifically for nRF sockets.

◆ TLS_DTLS_CONN_SAVE

#define TLS_DTLS_CONN_SAVE   19

Socket option to save DTLS connection, specifically for nRF sockets.

◆ TLS_DTLS_HANDSHAKE_STATUS

#define TLS_DTLS_HANDSHAKE_STATUS   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.

◆ TLS_DTLS_HANDSHAKE_STATUS_CACHED

#define TLS_DTLS_HANDSHAKE_STATUS_CACHED   1

◆ TLS_DTLS_HANDSHAKE_STATUS_FULL

#define TLS_DTLS_HANDSHAKE_STATUS_FULL   0

◆ TLS_DTLS_HANDSHAKE_TIMEO

#define TLS_DTLS_HANDSHAKE_TIMEO   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.

◆ TLS_DTLS_HANDSHAKE_TIMEO_123S

#define TLS_DTLS_HANDSHAKE_TIMEO_123S   123

1s + 2s + 4s + 8s + 16s + 32s + 60s

◆ TLS_DTLS_HANDSHAKE_TIMEO_15S

#define TLS_DTLS_HANDSHAKE_TIMEO_15S   15

1s + 2s + 4s + 8s

◆ TLS_DTLS_HANDSHAKE_TIMEO_1S

#define TLS_DTLS_HANDSHAKE_TIMEO_1S   1

1 second

◆ TLS_DTLS_HANDSHAKE_TIMEO_31S

#define TLS_DTLS_HANDSHAKE_TIMEO_31S   31

1s + 2s + 4s + 8s + 16s

◆ TLS_DTLS_HANDSHAKE_TIMEO_3S

#define TLS_DTLS_HANDSHAKE_TIMEO_3S   3

1s + 2s

◆ TLS_DTLS_HANDSHAKE_TIMEO_63S

#define TLS_DTLS_HANDSHAKE_TIMEO_63S   63

1s + 2s + 4s + 8s + 16s + 32s

◆ TLS_DTLS_HANDSHAKE_TIMEO_7S

#define TLS_DTLS_HANDSHAKE_TIMEO_7S   7

1s + 2s + 4s

◆ TLS_DTLS_HANDSHAKE_TIMEO_NONE

#define TLS_DTLS_HANDSHAKE_TIMEO_NONE   0

No timeout.

◆ TLS_SESSION_CACHE_DISABLED

#define TLS_SESSION_CACHE_DISABLED   0

Disable TLS session caching.

◆ TLS_SESSION_CACHE_ENABLED

#define TLS_SESSION_CACHE_ENABLED   1

Enable TLS session caching.