mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-04 03:51:57 +00:00
When is NET_SOCKETS_SOCKOPT_TLS set, it should set TLS_CREDENTIALS even when NET_NATIVE=n, so that platforms that use socket offloading can continue to set TLS credentials. We are now setting this via 'imply' instead of 'select', so that prj.conf can opt out if necessary. Fixes #22390 Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
167 lines
5.7 KiB
Plaintext
167 lines
5.7 KiB
Plaintext
# BSD Sockets compatible API
|
|
|
|
# Copyright (c) 2017 Linaro Limited.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
menuconfig NET_SOCKETS
|
|
bool "BSD Sockets compatible API"
|
|
help
|
|
Provide BSD Sockets like API on top of native Zephyr networking API.
|
|
|
|
if NET_SOCKETS
|
|
|
|
config NET_SOCKETS_POSIX_NAMES
|
|
bool "Standard POSIX names for Sockets API"
|
|
depends on !POSIX_API
|
|
help
|
|
By default, Sockets API function are prefixed with ``zsock_`` to avoid
|
|
namespacing issues. If this option is enabled, they will be provided
|
|
with standard POSIX names like socket(), recv(), and close(), to help
|
|
with porting existing code. Note that close() may require a special
|
|
attention, as in POSIX it closes any file descriptor, while with this
|
|
option enabled, it will still apply only to sockets.
|
|
|
|
config NET_SOCKETS_POLL_MAX
|
|
int "Max number of supported poll() entries"
|
|
default 3
|
|
help
|
|
Maximum number of entries supported for poll() call.
|
|
|
|
config NET_SOCKETS_CONNECT_TIMEOUT
|
|
int "Timeout value in milliseconds to CONNECT"
|
|
default 3000
|
|
range 0 60000
|
|
help
|
|
This variable specifies time in milliseconds after connect()
|
|
API call will timeout if we have not received SYN-ACK from
|
|
peer.
|
|
|
|
config NET_SOCKETS_DNS_TIMEOUT
|
|
int "Timeout value in milliseconds for DNS queries"
|
|
default 2000
|
|
range 1000 300000
|
|
depends on DNS_RESOLVER
|
|
help
|
|
This variable specifies time in milliseconds after which DNS
|
|
query is considered timeout. Minimum timeout is 1 second and
|
|
maximum timeout is 5 min.
|
|
|
|
config NET_SOCKETS_SOCKOPT_TLS
|
|
bool "Enable TCP TLS socket option support [EXPERIMENTAL]"
|
|
imply TLS_CREDENTIALS
|
|
select MBEDTLS if NET_NATIVE
|
|
help
|
|
Enable TLS socket option support which automatically establishes
|
|
a TLS connection to the remote host.
|
|
|
|
config NET_SOCKETS_ENABLE_DTLS
|
|
bool "Enable DTLS socket support [EXPERIMENTAL]"
|
|
depends on NET_SOCKETS_SOCKOPT_TLS
|
|
select MBEDTLS_DTLS if NET_NATIVE
|
|
help
|
|
Enable DTLS socket support. By default only TLS over TCP is supported.
|
|
|
|
config NET_SOCKETS_DTLS_TIMEOUT
|
|
int "Timeout value in milliseconds for DTLS connection"
|
|
default 5000
|
|
depends on NET_SOCKETS_ENABLE_DTLS
|
|
help
|
|
This variable specifies time in milliseconds after which DTLS
|
|
connection is considered dead by TLS server and DTLS resources are
|
|
freed. This is needed to prevent situation when DTLS client shuts down
|
|
without closing connection gracefully, which can prevent other peers
|
|
from connecting. Value of 0 indicates no timeout - resources will be
|
|
freed only when connection is gracefully closed by peer sending TLS
|
|
notification or socket is closed.
|
|
|
|
config NET_SOCKETS_TLS_MAX_CONTEXTS
|
|
int "Maximum number of TLS/DTLS contexts"
|
|
default 1
|
|
depends on NET_SOCKETS_SOCKOPT_TLS
|
|
help
|
|
"This variable specifies maximum number of TLS/DTLS contexts that can
|
|
be allocated at the same time."
|
|
|
|
config NET_SOCKETS_TLS_MAX_CREDENTIALS
|
|
int "Maximum number of TLS/DTLS credentials per socket"
|
|
default 4
|
|
depends on NET_SOCKETS_SOCKOPT_TLS
|
|
help
|
|
This variable sets maximum number of TLS/DTLS credentials that can be
|
|
used with a specific socket.
|
|
|
|
config NET_SOCKETS_TLS_MAX_CIPHERSUITES
|
|
int "Maximum number of TLS/DTLS ciphersuites per socket"
|
|
default 4
|
|
depends on NET_SOCKETS_SOCKOPT_TLS
|
|
help
|
|
This variable sets maximum number of TLS/DTLS ciphersuites that can
|
|
be used with specific socket, if set explicitly by socket option.
|
|
By default, all ciphersuites that are available in the system are
|
|
available to the socket.
|
|
|
|
config NET_SOCKETS_OFFLOAD
|
|
bool "Offload Socket APIs [EXPERIMENTAL]"
|
|
select NET_SOCKETS_POSIX_NAMES
|
|
help
|
|
Enables direct offloading of socket operations to dedicated TCP/IP
|
|
hardware.
|
|
This feature is intended to save resources by bypassing the Zephyr
|
|
TCP/IP stack in the case where there is only one network interface
|
|
required in the system, providing full BSD socket offload capability.
|
|
As a result, it bypasses any potential IP routing that Zephyr might
|
|
provide between multiple network interfaces.
|
|
See NET_OFFLOAD for a more deeply integrated approach which offloads
|
|
from the net_context() API within the Zephyr IP stack.
|
|
|
|
config NET_SOCKETS_PACKET
|
|
bool "Enable packet socket support"
|
|
depends on NET_L2_ETHERNET
|
|
help
|
|
This is an initial version of packet socket support (special type
|
|
raw socket). Packets are passed to and from the device driver
|
|
without any changes in the packet headers. It's API caller
|
|
responsibility to provide all the headers (e.g L2, L3 and so on)
|
|
while sending. While receiving, packets (including all the headers)
|
|
will be feed to sockets as it as from the driver.
|
|
|
|
config NET_SOCKETS_CAN
|
|
bool "Enable socket CAN support [EXPERIMENTAL]"
|
|
select NET_L2_CANBUS_RAW
|
|
help
|
|
The value depends on your network needs.
|
|
|
|
config NET_SOCKETS_CAN_RECEIVERS
|
|
int "How many simultaneous SocketCAN receivers are allowed"
|
|
default 1
|
|
depends on NET_SOCKETS_CAN
|
|
help
|
|
The value tells how many sockets can receive data from same
|
|
Socket-CAN interface.
|
|
|
|
config NET_SOCKETS_NET_MGMT
|
|
bool "Enable network management socket support [EXPERIMENTAL]"
|
|
depends on NET_MGMT_EVENT
|
|
select NET_MGMT_EVENT_INFO
|
|
help
|
|
Select this if you want to use socket API to get network
|
|
managements events to your application.
|
|
|
|
config NET_SOCKETS_NET_MGMT_MAX_LISTENERS
|
|
int "Max number of sockets to listen"
|
|
default 1
|
|
depends on NET_SOCKETS_NET_MGMT
|
|
help
|
|
This sets the maximum number of net_mgmt sockets that can
|
|
be set by the socket interface. So if you have two separate
|
|
sockets that are used for listening events, you need to set
|
|
this to two.
|
|
|
|
module = NET_SOCKETS
|
|
module-dep = NET_LOG
|
|
module-str = Log level for BSD sockets compatible API calls
|
|
module-help = Enables logging for sockets code.
|
|
source "subsys/net/Kconfig.template.log_config.net"
|
|
|
|
endif # NET_SOCKETS
|