mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-22 07:15:14 +03:00
297 lines
7.9 KiB
Plaintext
297 lines
7.9 KiB
Plaintext
# zephyr/Kconfig for libcoap
|
|
#
|
|
# Copyright (C) 2023-2026 Jon Shallow <supjps-libcoap@jpshallow.com>
|
|
#
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
#
|
|
# This file is part of the CoAP library libcoap. Please see README for terms
|
|
# of use.
|
|
#
|
|
###############################################################################
|
|
|
|
menu "libcoap Settings"
|
|
|
|
config LIBCOAP
|
|
bool "Enable libcoap"
|
|
help
|
|
This option enables libcoap as a Zephyr module.
|
|
|
|
endmenu
|
|
|
|
if LIBCOAP
|
|
|
|
config LIBCOAP_IPV4_SUPPORT
|
|
bool "Enable IPv4 support within CoAP"
|
|
default y
|
|
help
|
|
Enable IPv4 functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP IPv4 code is removed.
|
|
|
|
config LIBCOAP_IPV6_SUPPORT
|
|
bool "Enable IPv6 support within CoAP"
|
|
default y
|
|
help
|
|
Enable IPv6 functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP IPv6 code is removed.
|
|
|
|
config LIBCOAP_TCP_SUPPORT
|
|
bool "Enable TCP support within CoAP"
|
|
default n
|
|
help
|
|
Enable TCP functionality for CoAP. This is required if TLS sessions
|
|
are to be used. Note that RIOT TCP support also needs to be enabled.
|
|
|
|
If this option is disabled, redundant CoAP TCP code is removed.
|
|
|
|
config LIBCOAP_OSCORE_SUPPORT
|
|
bool "Enable OSCORE support within CoAP"
|
|
default n
|
|
help
|
|
Enable OSCORE functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP OSCORE code is removed.
|
|
|
|
config LIBCOAP_OBSERVE_PERSIST
|
|
bool "Enable Observe persist support within CoAP"
|
|
default n
|
|
help
|
|
Enable Observe persist functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP Observe persist code is removed.
|
|
|
|
config LIBCOAP_WS_SOCKET
|
|
bool "Enable WebSocket support within CoAP"
|
|
default n
|
|
help
|
|
Enable WebSocket functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP WebSocket code is removed.
|
|
|
|
config LIBCOAP_Q_BLOCK_SUPPORT
|
|
bool "Enable Q-Block (RFC9177) support within CoAP"
|
|
default n
|
|
help
|
|
Enable Q-Block (RFC9177) functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP Q-Block code is removed.
|
|
|
|
config LIBCOAP_ASYNC_SUPPORT
|
|
bool "Enable separate responses support within CoAP"
|
|
default y
|
|
help
|
|
Enable async separate responses functionality for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP async separate responses code is removed.
|
|
|
|
config LIBCOAP_THREAD_SAFE_SUPPORT
|
|
bool "Enable thread safe support within CoAP"
|
|
default y
|
|
help
|
|
Enable thread safe support functionality for CoAP.
|
|
|
|
If this option is disabled, multi-thread safe use of libcoap is not available.
|
|
|
|
config LIBCOAP_THREAD_RECURSIVE_CHECK
|
|
bool "Enable thread-safe recursion checking support within CoAP"
|
|
depends on LIBCOAP_THREAD_SAFE_SUPPORT
|
|
default n
|
|
help
|
|
Enable thread-safe recursion checking support for CoAP.
|
|
|
|
config LIBCOAP_ENABLE_THREAD_NUM_LOGGING
|
|
bool "Enable building with thread number logging support"
|
|
depends on LIBCOAP_THREAD_SAFE_SUPPORT
|
|
default y
|
|
help
|
|
Enable logging including thread number.
|
|
|
|
If this option is disabled, the thread number is not reported.
|
|
|
|
config LIBCOAP_CLIENT_SUPPORT
|
|
bool "Enable Client functionality within CoAP"
|
|
default n
|
|
help
|
|
Enable client functionality (ability to make requests and receive
|
|
responses) for CoAP. If the server is going to act as a proxy, then
|
|
this needs to be enabled to support the ongoing session going to
|
|
the next hop.
|
|
|
|
If this option is disabled, redundant CoAP client only code is
|
|
removed.
|
|
If both this option and LIBCOAP_SERVER_SUPPORT are disabled, then
|
|
both are automatically enabled for backwards compatibility.
|
|
|
|
config LIBCOAP_SERVER_SUPPORT
|
|
bool "Enable Server functionality within CoAP"
|
|
default n
|
|
help
|
|
Enable server functionality (ability to receive requests and send
|
|
responses) for CoAP.
|
|
|
|
If this option is disabled, redundant CoAP server only code is
|
|
removed.
|
|
If both this option and LIBCOAP_CLIENT_SUPPORT are disabled, then
|
|
both are automatically enabled for backwards compatibility.
|
|
|
|
config LIBCOAP_DEBUGGING
|
|
bool "Enable CoAP debugging"
|
|
default y
|
|
help
|
|
Enable CoAP debugging functions at compile time for the example code.
|
|
|
|
If this option is enabled, call coap_set_log_level()
|
|
at runtime in order to enable CoAP debug output.
|
|
|
|
choice LIBCOAP_DEBUGGING_LEVEL
|
|
bool "Set CoAP debugging level"
|
|
depends on LIBCOAP_DEBUGGING
|
|
default LIBCOAP_LOG_DEBUG
|
|
help
|
|
Set CoAP debugging level
|
|
|
|
Note: reducing the logging level also reduces the code size.
|
|
|
|
config LIBCOAP_LOG_EMERG
|
|
bool "Emergency"
|
|
config LIBCOAP_LOG_ALERT
|
|
bool "Alert"
|
|
config LIBCOAP_LOG_CRIT
|
|
bool "Critical"
|
|
config LIBCOAP_LOG_ERROR
|
|
bool "Error"
|
|
config LIBCOAP_LOG_WARNING
|
|
bool "Warning"
|
|
config LIBCOAP_LOG_NOTICE
|
|
bool "Notice"
|
|
config LIBCOAP_LOG_INFO
|
|
bool "Info"
|
|
config LIBCOAP_LOG_DEBUG
|
|
bool "Debug"
|
|
config LIBCOAP_LOG_OSCORE
|
|
bool "OSCORE"
|
|
endchoice
|
|
|
|
config LIBCOAP_LOG_DEFAULT_LEVEL
|
|
int
|
|
default 0 if !LIBCOAP_DEBUGGING
|
|
default 0 if LIBCOAP_LOG_EMERG
|
|
default 1 if LIBCOAP_LOG_ALERT
|
|
default 2 if LIBCOAP_LOG_CRIT
|
|
default 3 if LIBCOAP_LOG_ERROR
|
|
default 4 if LIBCOAP_LOG_WARNING
|
|
default 5 if LIBCOAP_LOG_NOTICE
|
|
default 6 if LIBCOAP_LOG_INFO
|
|
default 7 if LIBCOAP_LOG_DEBUG
|
|
default 8 if LIBCOAP_LOG_OSCORE
|
|
|
|
config LIBCOAP_DEFAULT_MAX_PDU_RX_SIZE
|
|
int "Default max PDU RX size in bytes"
|
|
default 1152
|
|
help
|
|
Maximum size of incoming CoAP PDU. RFC7252 4.6 suggests 1152.
|
|
Increase for larger block-wise transfers (e.g. 1024-4096).
|
|
|
|
config LIBCOAP_RXBUFFER_SIZE
|
|
int "Receive buffer size in bytes"
|
|
default 1472
|
|
help
|
|
Size of the socket receive buffer for incoming CoAP/UDP packets.
|
|
Should be at least as large as the largest expected PDU (e.g. 1472
|
|
for typical Ethernet MTU minus headers).
|
|
|
|
config LIBCOAP_DEFAULT_MTU
|
|
int "Default MTU in bytes"
|
|
default 1152
|
|
help
|
|
Default path/session MTU used for CoAP (RFC7252 4.6 suggests 1152).
|
|
Used for session MTU and PDU sizing; increase for larger block-wise
|
|
transfers.
|
|
|
|
config LIBCOAP_OBS_MAX_NON
|
|
int "Observe: max NON notifications before CON"
|
|
default 5
|
|
range 1 255
|
|
help
|
|
Number of NON notifications before sending a CON (RFC7641 4.5).
|
|
|
|
config LIBCOAP_DEFAULT_SESSION_TIMEOUT
|
|
int "Default session timeout"
|
|
default 300
|
|
help
|
|
This setting refers to the COAP_DEFAULT_SESSION_TIMEOUT, which defines server session's timeout.
|
|
|
|
if MBEDTLS
|
|
|
|
config MBEDTLS_CIPHER_CCM_ENABLED
|
|
bool
|
|
default y
|
|
config MBEDTLS_DEBUG
|
|
bool
|
|
default y
|
|
config MBEDTLS_SERVER_NAME_INDICATION
|
|
bool
|
|
default y
|
|
config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
|
bool
|
|
default y
|
|
config MBEDTLS_ENTROPY_ENABLED
|
|
bool
|
|
default y
|
|
config MBEDTLS_SSL_PROTO_DTLS
|
|
bool
|
|
default y
|
|
config MBEDTLS_SSL_DTLS_CONNECTION_ID
|
|
bool
|
|
default y
|
|
config MBEDTLS_ZEPHYR_ENTROPY
|
|
bool
|
|
default y
|
|
config MBEDTLS_SSL_PROTO_TLS1_2
|
|
bool
|
|
default y
|
|
config MBEDTLS_KEY_EXCHANGE_ALL_ENABLED
|
|
bool
|
|
default y
|
|
config MBEDTLS_CIPHER_ALL_ENABLED
|
|
bool
|
|
default n
|
|
config MBEDTLS_ECP_ALL_ENABLED
|
|
bool
|
|
default n
|
|
config MBEDTLS_MAC_ALL_ENABLED
|
|
bool
|
|
default y
|
|
config MBEDTLS_GENPRIME_ENABLED
|
|
bool
|
|
default y
|
|
config MBEDTLS_ECDH_C
|
|
bool
|
|
default y
|
|
config MBEDTLS_ECDSA_C
|
|
bool
|
|
default y
|
|
config MBEDTLS_ECJPAKE_C
|
|
bool
|
|
default y
|
|
config MBEDTLS_ECP_C
|
|
bool
|
|
default y
|
|
config MBEDTLS_PEM_CERTIFICATE_FORMAT
|
|
bool
|
|
default y
|
|
config MBEDTLS_SSL_EXTENDED_MASTER_SECRET
|
|
bool
|
|
default y
|
|
config MBEDTLS_HAVE_TIME_DATE
|
|
bool
|
|
default y
|
|
|
|
endif # MBEDTLS
|
|
|
|
module = LIBCOAP
|
|
module-str = libcoap
|
|
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
|
|
endif # LIBCOAP
|