[config] add guard checks for features that require DTLS/TLS support (#11068)

This commit adds guard checks for Border Agent, Commissioner, Joiner,
and CoAP Secure API features that use Secure Transport (DTLS/TLS) to
ensure `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE` is enabled. It
also moves the deprecation check for the earlier DTLS configuration
to `openthread-core-config-check.h` to be consistent with other
removed/deprecated configurations.
This commit is contained in:
Abtin Keshavarzian
2024-12-19 14:43:45 -08:00
committed by GitHub
parent 0c4b8d7733
commit 143ebbfb7c
7 changed files with 24 additions and 4 deletions
+4
View File
@@ -31,6 +31,10 @@
#include "openthread-core-config.h"
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE && !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
#error "CoAP Secure API feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
#endif
#if OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
#include "coap/coap.hpp"
@@ -694,4 +694,8 @@
#error "OPENTHREAD_CONFIG_MLE_SEND_LINK_REQUEST_ON_ADV_TIMEOUT is removed, behavior is always applied"
#endif
#ifdef OPENTHREAD_CONFIG_DTLS_ENABLE
#error "OPENTHREAD_CONFIG_DTLS_ENABLE was replaced by OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE"
#endif
#endif // OPENTHREAD_CORE_CONFIG_CHECK_H_
-4
View File
@@ -68,10 +68,6 @@
OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_CONFIG_JOINER_ENABLE || OPENTHREAD_CONFIG_BLE_TCAT_ENABLE)
#endif
#ifdef OPENTHREAD_CONFIG_DTLS_ENABLE
#error "OPENTHREAD_CONFIG_DTLS_ENABLE is deprecated please use OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE instead"
#endif
/**
* @}
*/
+4
View File
@@ -56,6 +56,10 @@ namespace ot {
namespace MeshCoP {
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
#error "Border Agent feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
#endif
class BorderAgent : public InstanceLocator, private NonCopyable
{
friend class ot::Notifier;
+4
View File
@@ -63,6 +63,10 @@ namespace ot {
namespace MeshCoP {
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
#error "Commissioner feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
#endif
class Commissioner : public InstanceLocator, private NonCopyable
{
friend class Tmf::Agent;
+4
View File
@@ -59,6 +59,10 @@ namespace ot {
namespace MeshCoP {
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
#error "Joiner feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
#endif
class Joiner : public InstanceLocator, private NonCopyable
{
friend class Tmf::Agent;
+4
View File
@@ -48,6 +48,10 @@ namespace ot {
namespace Ble {
#if !OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
#error "BLE TCAT feature requires `OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE`"
#endif
class BleSecure : public InstanceLocator, public MeshCoP::Tls::Extension, private NonCopyable
{
public: