[config] remaining configure options (#4020)

This commit is contained in:
Jonathan Hui
2019-07-31 14:16:30 -07:00
parent 149640da49
commit 02da206f39
43 changed files with 264 additions and 330 deletions
+37 -43
View File
@@ -55,40 +55,40 @@ python --version || die
export CPPFLAGS="${CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
# UART transport
export CPPFLAGS="${CPPFLAGS} \
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \
-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1"
export CPPFLAGS="${CPPFLAGS} \
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 \
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
-DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \
-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 \
-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
scan-build ./configure \
--enable-builtin-mbedtls=no \
--enable-cert-log \
--enable-cli \
--enable-ecdsa \
--enable-executable=no \
--enable-ftd \
--enable-jam-detection \
--enable-legacy \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--enable-udp-forward \
--with-examples=posix || die
scan-build --status-bugs -analyze-headers -v make -j2 || die
@@ -96,17 +96,12 @@ python --version || die
# SPI transport
scan-build ./configure \
--enable-builtin-mbedtls=no \
--enable-cert-log \
--enable-cli \
--enable-ecdsa \
--enable-executable=no \
--enable-ftd \
--enable-jam-detection \
--enable-legacy \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--enable-udp-forward \
--with-examples=posix || die
scan-build --status-bugs -analyze-headers -v make -j2 || die
@@ -345,14 +340,16 @@ build_samr21() {
./bootstrap || die
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-posix || die
export CPPFLAGS=" \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 \
export CPPFLAGS=" \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 \
-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 \
-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 \
-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
git checkout -- . || die
@@ -363,8 +360,6 @@ build_samr21() {
--enable-ftd \
--enable-mtd \
--with-examples=posix \
--enable-jam-detection \
--enable-legacy \
--disable-docs \
--disable-tests \
--with-vendor-extension=./src/core/common/extension_example.cpp || die
@@ -377,14 +372,13 @@ build_samr21() {
--enable-cli \
--enable-mtd \
--with-examples=posix \
--enable-legacy \
--disable-docs \
--disable-tests || die
make -j 8 || die
export CPPFLAGS=" \
export CPPFLAGS=" \
-DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1 \
-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 \
-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 \
-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
git checkout -- . || die
+1 -1
View File
@@ -58,8 +58,8 @@ OPENTHREAD_COMMON_FLAGS += \
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=0 \
-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 \
-DOPENTHREAD_ENABLE_REFERENCE_DEVICE=0 \
$(NULL)
endif
-1
View File
@@ -32,7 +32,6 @@ AM_MAKEFLAGS = --no-print-directory
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-address-sanitizer \
--enable-cert-log \
--enable-cli \
--enable-ftd \
--enable-mtd \
-164
View File
@@ -378,37 +378,6 @@ NL_ENABLE_TESTS([yes])
AM_CONDITIONAL([OPENTHREAD_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
#
# Multiple OpenThread Instances
#
AC_ARG_ENABLE(multiple-instances,
[AS_HELP_STRING([--enable-multiple-instances],[Enable support for multiple OpenThread instances @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_multiple_instances=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_multiple_instances} for --enable-multiple-instances])
;;
esac
],
[enable_multiple_instances=no])
if test "$enable_multiple_instances" = "yes"; then
OPENTHREAD_ENABLE_MULTIPLE_INSTANCES=1
else
OPENTHREAD_ENABLE_MULTIPLE_INSTANCES=0
fi
AC_MSG_RESULT(${enable_multiple_instances})
AC_SUBST(OPENTHREAD_ENABLE_MULTIPLE_INSTANCES)
AM_CONDITIONAL([OPENTHREAD_ENABLE_MULTIPLE_INSTANCES], [test "${enable_multiple_instances}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MULTIPLE_INSTANCES],[${OPENTHREAD_ENABLE_MULTIPLE_INSTANCES}],[Define to 1 if you want to enable support for multiple OpenThread instances.])
#
# Builtin mbedtls
#
@@ -732,70 +701,6 @@ case "${with_readline}" in
;;
esac
#
# Thread UDP forward
#
AC_MSG_CHECKING([whether to enable UDP forward])
AC_ARG_ENABLE(udp_forward,
[AS_HELP_STRING([--enable-udp-forward], [Enable UDP forward support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_udp_forward=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_udp_forward} for --enable-udp-forward])
;;
esac
],
[enable_udp_forward=no])
if test "$enable_udp_forward" = "yes"; then
OPENTHREAD_ENABLE_UDP_FORWARD=1
else
OPENTHREAD_ENABLE_UDP_FORWARD=0
fi
AC_MSG_RESULT(${enable_udp_forward})
AC_SUBST(OPENTHREAD_ENABLE_UDP_FORWARD)
AM_CONDITIONAL([OPENTHREAD_ENABLE_UDP_FORWARD], [test "${enable_udp_forward}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_UDP_FORWARD], [${OPENTHREAD_ENABLE_UDP_FORWARD}], [Define to 1 to enable the UDP forward feature.])
#
# Jam Detection
#
AC_ARG_ENABLE(jam_detection,
[AS_HELP_STRING([--enable-jam-detection],[Enable Jam Detection support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_jam_detection=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_jam_detection} for --enable-jam-detection])
;;
esac
],
[enable_jam_detection=no])
if test "$enable_jam_detection" = "yes"; then
OPENTHREAD_ENABLE_JAM_DETECTION=1
else
OPENTHREAD_ENABLE_JAM_DETECTION=0
fi
AC_MSG_CHECKING([whether to enable jam detection])
AC_MSG_RESULT(${enable_jam_detection})
AC_SUBST(OPENTHREAD_ENABLE_JAM_DETECTION)
AM_CONDITIONAL([OPENTHREAD_ENABLE_JAM_DETECTION], [test "${enable_jam_detection}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_JAM_DETECTION],[${OPENTHREAD_ENABLE_JAM_DETECTION}],[Define to 1 if you want to use jam detection feature])
#
# Vendor Extension - Specify a C++ source file which will be built as part of OpenThread core library.
#
@@ -826,38 +731,6 @@ AC_SUBST(OPENTHREAD_VENDOR_EXTENSION_SOURCE)
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_VENDOR_EXTENSION],[${OPENTHREAD_ENABLE_VENDOR_EXTENSION}],[Define to 1 if using vendor extension])
AM_CONDITIONAL([OPENTHREAD_ENABLE_VENDOR_EXTENSION], [test "${OPENTHREAD_ENABLE_VENDOR_EXTENSION}" = "1"])
#
# Legacy Network
#
AC_ARG_ENABLE(legacy,
[AS_HELP_STRING([--enable-legacy],[Enable legacy network support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_legacy=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_legacy} for --enable-legacy])
;;
esac
],
[enable_legacy=no])
if test "$enable_legacy" = "yes"; then
OPENTHREAD_ENABLE_LEGACY=1
else
OPENTHREAD_ENABLE_LEGACY=0
fi
AC_MSG_CHECKING([whether to enable legacy])
AC_MSG_RESULT(${enable_legacy})
AC_SUBST(OPENTHREAD_ENABLE_LEGACY)
AM_CONDITIONAL([OPENTHREAD_ENABLE_LEGACY], [test "${enable_legacy}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_LEGACY],[${OPENTHREAD_ENABLE_LEGACY}],[Define to 1 if you want to use legacy network support])
#
# NCP Vendor Hook Source - Specify a C++ file that implements the NCP vendor hook.
#
@@ -956,38 +829,6 @@ AC_ARG_WITH(
AC_SUBST(OPENTHREAD_CUSTOM_LINKER_FILE)
AM_CONDITIONAL([OPENTHREAD_ENABLE_CUSTOM_LINKER_FILE], [test "${with_custom_linker_file}" = "yes"])
#
# Support for ECDSA
#
AC_MSG_CHECKING([whether to build with ECDSA support])
AC_ARG_ENABLE(ecdsa,
[AS_HELP_STRING([--enable-ecdsa], [Enable ECDSA support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_ecdsa=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_ecdsa} for --enable-ecdsa])
;;
esac
],
[enable_ecdsa=no])
if test "$enable_ecdsa" = "yes"; then
OPENTHREAD_ENABLE_ECDSA=1
else
OPENTHREAD_ENABLE_ECDSA=0
fi
AC_MSG_RESULT(${enable_ecdsa})
AC_SUBST(OPENTHREAD_ENABLE_ECDSA)
AM_CONDITIONAL([OPENTHREAD_ENABLE_ECDSA], [test "${enable_ecdsa}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_ECDSA], [${OPENTHREAD_ENABLE_ECDSA}], [Define to 1 if you want to enable ECDSA support])
#
# Examples
#
@@ -1368,12 +1209,7 @@ AC_MSG_NOTICE([
OpenThread NCP Vendor Hook Source : ${with_ncp_vendor_hook_source}
OpenThread NCP Spinel Encrypter : ${with_ncp_spinel_encrypter_libs}
OpenThread Vendor Extension Source : ${with_vendor_extension}
OpenThread Multiple Instances support : ${enable_multiple_instances}
OpenThread builtin mbedtls support : ${enable_builtin_mbedtls}
OpenThread UDP forward support : ${enable_udp_forward}
OpenThread Jam Detection support : ${enable_jam_detection}
OpenThread Legacy network support : ${enable_legacy}
OpenThread ECDSA support : ${enable_ecdsa}
OpenThread Examples : ${with_examples}
OpenThread POSIX Application : ${enable_posix_app}
+4 -4
View File
@@ -46,7 +46,7 @@ jmp_buf gResetJump;
void __gcov_flush();
#endif
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
void *otPlatCAlloc(size_t aNum, size_t aSize)
{
return calloc(aNum, aSize);
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
}
#endif
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
size_t otInstanceBufferLength = 0;
uint8_t *otInstanceBuffer = NULL;
#endif
@@ -87,7 +87,7 @@ pseudo_reset:
otSysInit(argc, argv);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
// Call to query the buffer size
(void)otInstanceInit(NULL, &otInstanceBufferLength);
@@ -111,7 +111,7 @@ pseudo_reset:
}
otInstanceFinalize(instance);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
free(otInstanceBuffer);
#endif
+4 -4
View File
@@ -45,7 +45,7 @@ jmp_buf gResetJump;
void __gcov_flush();
#endif
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
void *otPlatCAlloc(size_t aNum, size_t aSize)
{
return calloc(aNum, aSize);
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
}
#endif
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
size_t otInstanceBufferLength = 0;
uint8_t *otInstanceBuffer = NULL;
#endif
@@ -86,7 +86,7 @@ pseudo_reset:
otSysInit(argc, argv);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
// Call to query the buffer size
(void)otInstanceInit(NULL, &otInstanceBufferLength);
@@ -110,7 +110,7 @@ pseudo_reset:
}
otInstanceFinalize(instance);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
free(otInstanceBuffer);
#endif
+5 -5
View File
@@ -127,11 +127,11 @@ COMMONCFLAGS += -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1
endif
ifeq ($(ECDSA),1)
configure_OPTIONS += --enable-ecdsa
COMMONCFLAGS += -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1
endif
ifeq ($(JAM_DETECTION),1)
configure_OPTIONS += --enable-jam-detection
COMMONCFLAGS += -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1
endif
ifeq ($(JOINER),1)
@@ -139,7 +139,7 @@ COMMONCFLAGS += -DOPENTHREAD_CONFIG_JOINER_ENABLE=1
endif
ifeq ($(LEGACY),1)
configure_OPTIONS += --enable-legacy
COMMONCFLAGS += -DOPENTHREAD_CONFIG_LEGACY_ENABLE=1
endif
ifeq ($(LINK_RAW),1)
@@ -161,7 +161,7 @@ endif
# Enable features only required for reference device during certification.
ifeq ($(REFERENCE_DEVICE),1)
COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_APP
COMMONCFLAGS += -DOPENTHREAD_ENABLE_REFERENCE_DEVICE=1
COMMONCFLAGS += -DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1
endif
ifeq ($(SERVICE),1)
@@ -181,7 +181,7 @@ COMMONCFLAGS += -DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1 -DOPENT
endif
ifeq ($(UDP_FORWARD),1)
configure_OPTIONS += --enable-udp-forward
COMMONCFLAGS += -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1
endif
ifeq ($(DISABLE_BUILTIN_MBEDTLS),1)
+3 -3
View File
@@ -45,13 +45,13 @@
#define OPENTHREAD_CONFIG_DTLS_ENABLE 1
/* Define to 1 if you want to use jam detection feature */
#define OPENTHREAD_ENABLE_JAM_DETECTION 1
#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 1
/* Define to 1 to enable the joiner role. */
#define OPENTHREAD_CONFIG_JOINER_ENABLE 1
/* Define to 1 if you want to use legacy network support */
#define OPENTHREAD_ENABLE_LEGACY 1
#define OPENTHREAD_CONFIG_LEGACY_ENABLE 1
/* Define to 1 to enable the NCP UART interface. */
#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1
@@ -63,7 +63,7 @@
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1
/* Define to 1 to enable the UDP forward feature. */
#define OPENTHREAD_ENABLE_UDP_FORWARD 1
#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 1
/* OpenThread examples */
#define OPENTHREAD_EXAMPLES none
+2 -2
View File
@@ -47,8 +47,8 @@ extern "C" {
* @brief
* This module includes functions for signal jamming detection feature.
*
* The functions in this module are available when jam-detection feature (`OPENTHREAD_ENABLE_JAM_DETECTION`) is
* enabled.
* The functions in this module are available when jam-detection feature (`OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE`)
* is enabled.
*
* @{
*
+2 -1
View File
@@ -251,7 +251,8 @@ otError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo
* @brief
* This module includes functions for UDP forward feature.
*
* The functions in this module are available when udp-forward feature (`OPENTHREAD_ENABLE_UDP_FORWARD`) is enabled.
* The functions in this module are available when udp-forward feature (`OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE`) is
* enabled.
*
* @{
*
+3 -3
View File
@@ -3555,7 +3555,7 @@ void Interpreter::SetUserCommands(const otCliCommand *aCommands, uint8_t aLength
Interpreter &Interpreter::GetOwner(OwnerLocator &aOwnerLocator)
{
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
Interpreter &interpreter = (aOwnerLocator.GetOwner<Interpreter>());
#else
OT_UNUSED_VARIABLE(aOwnerLocator);
@@ -3610,7 +3610,7 @@ exit:
} // namespace Cli
} // namespace ot
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
OT_TOOL_WEAK void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
{
OT_UNUSED_VARIABLE(aHandlers);
@@ -3625,4 +3625,4 @@ OT_TOOL_WEAK void otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr)
{
OT_UNUSED_VARIABLE(aExtAddr);
}
#endif // OPENTHREAD_ENABLE_LEGACY
#endif // OPENTHREAD_CONFIG_LEGACY_ENABLE
+1 -1
View File
@@ -218,7 +218,7 @@ otError Uart::ProcessCommand(void)
* Thus this is here to affirmatively LOG exactly when the CLI
* command is being executed.
*/
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
/* TODO: how exactly do we get the instance here? */
#else
otLogInfoCli("execute command: %s", mRxBuffer);
+2 -2
View File
@@ -95,7 +95,7 @@ exit:
return;
}
#if OPENTHREAD_ENABLE_ECDSA
#if OPENTHREAD_CONFIG_ECDSA_ENABLE
otError otCryptoEcdsaSign(uint8_t * aOutput,
uint16_t * aOutputLength,
@@ -107,4 +107,4 @@ otError otCryptoEcdsaSign(uint8_t * aOutput,
return Ecdsa::Sign(aOutput, aOutputLength, aInputHash, aInputHashLength, aPrivateKey, aPrivateKeyLength);
}
#endif // OPENTHREAD_ENABLE_ECDSA
#endif // OPENTHREAD_CONFIG_ECDSA_ENABLE
+2 -2
View File
@@ -44,7 +44,7 @@
using namespace ot;
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize)
{
Instance *instance;
@@ -59,7 +59,7 @@ otInstance *otInstanceInitSingle(void)
{
return &Instance::InitSingle();
}
#endif // #if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#endif // #if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
bool otInstanceIsInitialized(otInstance *aInstance)
{
+2 -2
View File
@@ -40,7 +40,7 @@
using namespace ot;
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
otError otJamDetectionSetRssiThreshold(otInstance *aInstance, int8_t aRssiThreshold)
{
@@ -121,4 +121,4 @@ uint64_t otJamDetectionGetHistoryBitmap(otInstance *aInstance)
return instance.Get<Utils::JamDetector>().GetHistoryBitmap();
}
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
+3 -3
View File
@@ -40,7 +40,7 @@
using namespace ot;
otLogLevel otLoggingGetLevel(void)
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL && !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL && !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
{
return Instance::Get().GetLogLevel();
}
@@ -57,8 +57,8 @@ otError otLoggingSetLevel(otLogLevel aLogLevel)
otError error = OT_ERROR_DISABLED_FEATURE;
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#warning "Dynamic log level is not supported along with multiple OT instance feature (`ENABLE_MULTIPLE_INSTANCES`)"
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
#warning "Dynamic log level is not supported along with multiple OT instance feature"
#else
Instance::Get().SetLogLevel(aLogLevel);
error = OT_ERROR_NONE;
+2 -2
View File
@@ -97,7 +97,7 @@ otError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo
return socket.SendTo(*static_cast<Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
}
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
void otUdpForwardSetForwarder(otInstance *aInstance, otUdpForwarder aForwarder, void *aContext)
{
Instance &instance = *static_cast<Instance *>(aInstance);
@@ -126,7 +126,7 @@ void otUdpForwardReceive(otInstance * aInstance,
static_cast<ot::Message *>(aMessage)->Free();
}
#endif // OPENTHREAD_ENABLE_UDP_FORWARD
#endif // OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
#if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
otUdpSocket *otUdpGetSockets(otInstance *aInstance)
+7 -7
View File
@@ -41,7 +41,7 @@
namespace ot {
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
// Define the raw storage used for OpenThread instance (in single-instance case).
otDEFINE_ALIGNED_VAR(gInstanceRaw, sizeof(Instance), uint64_t);
@@ -55,7 +55,7 @@ Instance::Instance(void)
, mTimerMicroScheduler(*this)
#endif
#if OPENTHREAD_MTD || OPENTHREAD_FTD
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
, mHeap()
#endif
, mMbedTls()
@@ -103,7 +103,7 @@ Instance::Instance(void)
{
}
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
Instance &Instance::InitSingle(void)
{
@@ -126,7 +126,7 @@ Instance &Instance::Get(void)
return *static_cast<Instance *>(instance);
}
#else // #if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#else // #if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
Instance *Instance::Init(void *aBuffer, size_t *aBufferSize)
{
@@ -147,7 +147,7 @@ exit:
return instance;
}
#endif // OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#endif // OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
void Instance::Reset(void)
{
@@ -185,7 +185,7 @@ void Instance::Finalize(void)
Get<Settings>().Deinit();
#endif
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
/**
* Object was created on buffer, so instead of deleting
@@ -193,7 +193,7 @@ void Instance::Finalize(void)
*/
this->~Instance();
#endif // !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#endif // !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
exit:
return;
+6 -6
View File
@@ -54,7 +54,7 @@
#include "coap/coap.hpp"
#include "common/code_utils.hpp"
#include "crypto/mbedtls.hpp"
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
#include "utils/heap.hpp"
#endif
#include "common/notifier.hpp"
@@ -104,7 +104,7 @@ namespace ot {
class Instance : public otInstance
{
public:
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
/**
* This static method initializes the OpenThread instance.
*
@@ -119,7 +119,7 @@ public:
*/
static Instance *Init(void *aBuffer, size_t *aBufferSize);
#else // OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#else // OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
/**
* This static method initializes the single OpenThread instance.
@@ -249,7 +249,7 @@ public:
*/
void InvokeEnergyScanCallback(otEnergyScanResult *aResult) const;
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
/**
* This method returns a reference to the Heap object.
*
@@ -315,7 +315,7 @@ private:
#if OPENTHREAD_MTD || OPENTHREAD_FTD
// RandomManager is initialized before other objects. Note that it
// requires MbedTls which itself may use Heap.
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
Utils::Heap mHeap;
#endif
Crypto::MbedTls mMbedTls;
@@ -619,7 +619,7 @@ template <> inline Utils::Slaac &Instance::Get(void)
}
#endif
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
template <> inline Utils::JamDetector &Instance::Get(void)
{
return mThreadNetif.mJamDetector;
+1 -1
View File
@@ -63,7 +63,7 @@ template <typename Type> inline Type &InstanceLocator::Get(void) const
return GetInstance().Get<Type>();
}
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
template <typename OwnerType> OwnerType &OwnerLocator::GetOwner(void)
{
+7 -7
View File
@@ -44,7 +44,7 @@ namespace ot {
class Instance;
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
extern uint64_t gInstanceRaw[];
#endif
@@ -78,7 +78,7 @@ public:
* @returns A reference to the parent otInstance.
*
*/
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
Instance &GetInstance(void) const { return mInstance; }
#else
Instance &GetInstance(void) const { return *reinterpret_cast<Instance *>(&gInstanceRaw); }
@@ -105,14 +105,14 @@ protected:
*
*/
explicit InstanceLocator(Instance &aInstance)
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
: mInstance(aInstance)
#endif
{
OT_UNUSED_VARIABLE(aInstance);
}
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
private:
Instance &mInstance;
#endif
@@ -136,7 +136,7 @@ public:
*
*/
template <typename OwnerType> OwnerType &GetOwner(void)
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
{
return *static_cast<OwnerType *>(mOwner);
}
@@ -153,14 +153,14 @@ protected:
*
*/
explicit OwnerLocator(void *aOwner)
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
: mOwner(aOwner)
#endif
{
OT_UNUSED_VARIABLE(aOwner);
}
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
private:
void *mOwner;
#endif
+2 -2
View File
@@ -1020,7 +1020,7 @@ extern "C" {
*
*
*/
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
#define otLogCertMeshCoP(aFormat, ...) \
_otLogFormatter(OT_LOG_LEVEL_NONE, OT_LOG_REGION_MESH_COP, aFormat, ##__VA_ARGS__)
#else
@@ -1858,7 +1858,7 @@ extern "C" {
* @param[in] aLength Number of bytes to print.
*
*/
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
#define otDumpCertMeshCoP(aId, aBuf, aLength) otDump(OT_LOG_LEVEL_NONE, OT_LOG_REGION_MESH_COP, aId, aBuf, aLength)
#else
#define otDumpCertMeshCoP(aId, aBuf, aLength)
@@ -34,8 +34,8 @@
#ifndef OPENTHREAD_CORE_CONFIG_CHECK_H_
#define OPENTHREAD_CORE_CONFIG_CHECK_H_
#if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE && OPENTHREAD_ENABLE_UDP_FORWARD
#error "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE and OPENTHREAD_ENABLE_UDP_FORWARD must not both be set."
#if OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE && OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
#error "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE and OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE must not both be set."
#endif
/*
@@ -66,6 +66,6 @@
#endif
#ifdef OPENTHREAD_ENABLE_CERT_LOG
#error "OPENTHREAD_ENABLE_CERT_LOG was replaced by OPENTHREAD_ENABLE_REFERENCE_DEVICE."
#error "OPENTHREAD_ENABLE_CERT_LOG was replaced by OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE."
#endif
#endif // OPENTHREAD_CORE_CONFIG_CHECK_H_
@@ -6,7 +6,7 @@
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
>* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
@@ -75,6 +75,86 @@
#define OPENTHREAD_CONFIG_STACK_VERSION_MINOR 1
#endif
/**
* @def OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
*
* Define to 1 to enable the Border Agent service.
*
*/
#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
*
* Define to 1 to enable the Border Router service.
*
*/
#ifndef OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE
#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_ECDSA_ENABLE
*
* Define to 1 to enable ECDSA support.
*
*/
#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE
#define OPENTHREAD_CONFIG_ECDSA_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
*
* Define to 1 to enable the Jam Detection service.
*
*/
#ifndef OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
*
* Define to 1 to enable multiple instance support.
*
*/
#ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0
#endif
/**
* @def OPENTHREAD_ENABLE_POSIX_APP_DAEMON
*
* Define to 1 to enable posix-app daemon support.
*
*/
#ifndef OPENTHREAD_ENABLE_POSIX_APP_DAEMON
#define OPENTHREAD_ENABLE_POSIX_APP_DAEMON 0
#endif
/**
* @def OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
*
* Define to 1 to enable Thread Test Harness reference device support.
*
*/
#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
*
* Define to 1 to enable UDP forward support.
*
*/
#ifndef OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
*
@@ -326,4 +406,14 @@
#endif // OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT
#endif // OPENTHREAD_CONFIG_DEFAULT_CHANNEL
/**
* @def OPENTHREAD_CONFIG_LEGACY_ENABLE
*
* Define to 1 to enable legacy network support.
*
*/
#ifndef OPENTHREAD_CONFIG_LEGACY_ENABLE
#define OPENTHREAD_CONFIG_LEGACY_ENABLE 0
#endif
#endif // OPENTHREAD_CORE_DEFAULT_CONFIG_H_
+2 -2
View File
@@ -44,7 +44,7 @@
namespace ot {
namespace Crypto {
#if OPENTHREAD_ENABLE_ECDSA
#if OPENTHREAD_CONFIG_ECDSA_ENABLE
otError Ecdsa::Sign(uint8_t * aOutput,
uint16_t * aOutputLength,
@@ -98,7 +98,7 @@ exit:
return error;
}
#endif // OPENTHREAD_ENABLE_ECDSA
#endif // OPENTHREAD_CONFIG_ECDSA_ENABLE
} // namespace Crypto
} // namespace ot
+4 -4
View File
@@ -49,7 +49,7 @@
namespace ot {
namespace Crypto {
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
static void *CAlloc(size_t aCount, size_t aSize)
{
@@ -61,17 +61,17 @@ static void Free(void *aPointer)
Instance::Get().GetHeap().Free(aPointer);
}
#endif // !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
#endif // !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
MbedTls::MbedTls(void)
{
#if !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
#if !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
#ifdef MBEDTLS_DEBUG_C
// mbedTLS's debug level is almost the same as OpenThread's
mbedtls_debug_set_threshold(OPENTHREAD_CONFIG_LOG_LEVEL);
#endif
mbedtls_platform_set_calloc_free(CAlloc, Free);
#endif // !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
#endif // !OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE && OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
}
otError MbedTls::MapError(int rval)
+2 -2
View File
@@ -953,7 +953,7 @@ void Commissioner::HandleJoinerFinalize(Coap::Message &aMessage, const Ip6::Mess
}
}
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
if (aMessage.GetLength() <= OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE)
{
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
@@ -990,7 +990,7 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Message &aRequest, State
joinerMessageInfo.GetPeerAddr().SetIid(mJoinerIid);
joinerMessageInfo.SetPeerPort(mJoinerPort);
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
VerifyOrExit(message->GetLength() <= sizeof(buf));
+3 -3
View File
@@ -463,7 +463,7 @@ void Joiner::SendJoinerFinalize(void)
{
assert(mFinalizeMessage != NULL);
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
LogCertMessage("[THCI] direction=send | type=JOIN_FIN.req |", *mFinalizeMessage);
#endif
@@ -504,7 +504,7 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Message & aMessage,
otLogInfoMeshCoP("Joiner received finalize response %d", static_cast<uint8_t>(state.GetState()));
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
LogCertMessage("[THCI] direction=recv | type=JOIN_FIN.rsp |", aMessage);
#endif
@@ -668,7 +668,7 @@ const char *Joiner::JoinerStateToString(otJoinerState aState)
return str;
}
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
void Joiner::LogCertMessage(const char *aText, const Coap::Message &aMessage) const
{
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
+1 -1
View File
@@ -162,7 +162,7 @@ private:
void SendJoinerFinalize(void);
void SendJoinerEntrustResponse(const Coap::Message &aRequest, const Ip6::MessageInfo &aRequestInfo);
#if OPENTHREAD_ENABLE_REFERENCE_DEVICE
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
void LogCertMessage(const char *aText, const Coap::Message &aMessage) const;
#endif
+2 -2
View File
@@ -206,7 +206,7 @@ Udp::Udp(Instance &aInstance)
, mEphemeralPort(kDynamicPortMin)
, mReceivers(NULL)
, mSockets(NULL)
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
, mUdpForwarderContext(NULL)
, mUdpForwarder(NULL)
#endif
@@ -322,7 +322,7 @@ otError Udp::SendDatagram(Message &aMessage, MessageInfo &aMessageInfo, IpProto
{
otError error = OT_ERROR_NONE;
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
if (aMessageInfo.IsHostInterface())
{
VerifyOrExit(mUdpForwarder != NULL, error = OT_ERROR_NO_ROUTE);
+3 -3
View File
@@ -332,7 +332,7 @@ public:
otUdpSocket *GetUdpSockets(void) { return mSockets; }
#endif
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
/**
* This method sets the forward sender.
*
@@ -345,7 +345,7 @@ public:
mUdpForwarder = aForwarder;
mUdpForwarderContext = aContext;
}
#endif // OPENTHREAD_ENABLE_UDP_FORWARD
#endif // OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
private:
enum
@@ -357,7 +357,7 @@ private:
uint16_t mEphemeralPort;
UdpReceiver *mReceivers;
UdpSocket * mSockets;
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
void * mUdpForwarderContext;
otUdpForwarder mUdpForwarder;
#endif
+2 -2
View File
@@ -92,9 +92,9 @@ ThreadNetif::ThreadNetif(Instance &aInstance)
#if OPENTHREAD_CONFIG_JOINER_ENABLE
, mJoiner(aInstance)
#endif // OPENTHREAD_CONFIG_JOINER_ENABLE
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
, mJamDetector(aInstance)
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
#if OPENTHREAD_FTD
, mJoinerRouter(aInstance)
, mLeader(aInstance)
+4 -4
View File
@@ -79,9 +79,9 @@
#include "utils/slaac_address.hpp"
#endif
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
#include "utils/jam_detector.hpp"
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
namespace ot {
@@ -211,9 +211,9 @@ private:
MeshCoP::Joiner mJoiner;
#endif // OPENTHREAD_CONFIG_JOINER_ENABLE
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
Utils::JamDetector mJamDetector;
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
#if OPENTHREAD_FTD
MeshCoP::JoinerRouter mJoinerRouter;
+2 -2
View File
@@ -40,7 +40,7 @@
#include "common/random.hpp"
#include "thread/thread_netif.hpp"
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
namespace ot {
namespace Utils {
@@ -286,4 +286,4 @@ void JamDetector::HandleStateChanged(otChangedFlags aFlags)
} // namespace Utils
} // namespace ot
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
+2 -2
View File
@@ -65,10 +65,10 @@ const ChangedPropsSet::Entry ChangedPropsSet::mSupportedProps[] = {
{SPINEL_PROP_NET_REQUIRE_JOIN_EXISTING, SPINEL_STATUS_OK, true},
{SPINEL_PROP_LAST_STATUS, SPINEL_STATUS_NOMEM, true},
{SPINEL_PROP_LAST_STATUS, SPINEL_STATUS_DROPPED, true},
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
{SPINEL_PROP_JAM_DETECTED, SPINEL_STATUS_OK, true},
#endif
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
{SPINEL_PROP_NEST_LEGACY_ULA_PREFIX, SPINEL_STATUS_OK, true},
{SPINEL_PROP_NEST_LEGACY_LAST_NODE_JOINED, SPINEL_STATUS_OK, true},
#endif
+5 -5
View File
@@ -269,7 +269,7 @@ NcpBase::NcpBase(Instance *aInstance)
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
otNetworkTimeSyncSetCallback(mInstance, &NcpBase::HandleTimeSyncUpdate, this);
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
otUdpForwardSetForwarder(mInstance, &NcpBase::HandleUdpForwardStream, this);
#endif
otIcmp6SetEchoMode(mInstance, OT_ICMP6_ECHO_HANDLER_DISABLED);
@@ -280,7 +280,7 @@ NcpBase::NcpBase(Instance *aInstance)
#endif
otThreadRegisterParentResponseCallback(mInstance, &NcpBase::HandleParentResponseInfo, static_cast<void *>(this));
#endif // OPENTHREAD_FTD
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
mLegacyNodeDidJoin = false;
mLegacyHandlers = NULL;
memset(mLegacyUlaPrefix, 0, sizeof(mLegacyUlaPrefix));
@@ -1761,7 +1761,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>(void)
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_MAC_WHITELIST));
#endif
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_JAM_DETECT));
#endif
@@ -1803,7 +1803,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>(void)
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_ROLE_SLEEPY));
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_NEST_LEGACY_INTERFACE));
#endif
@@ -1819,7 +1819,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>(void)
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_BORDER_ROUTER));
#endif
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_UDP_FORWARD));
#endif
+5 -5
View File
@@ -130,7 +130,7 @@ public:
#endif
#if OPENTHREAD_MTD || OPENTHREAD_FTD
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
/**
* This callback is invoked by the legacy stack to notify that a new
* legacy node did join the network.
@@ -336,14 +336,14 @@ protected:
otError EncodeChildInfo(const otChildInfo &aChildInfo);
#endif
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
static void HandleUdpForwardStream(otMessage * aMessage,
uint16_t aPeerPort,
otIp6Address *aPeerAddr,
uint16_t aSockPort,
void * aContext);
void HandleUdpForwardStream(otMessage *aMessage, uint16_t aPeerPort, otIp6Address &aPeerAddr, uint16_t aPort);
#endif // OPENTHREAD_ENABLE_UDP_FORWARD
#endif // OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
otError CommandHandler_NOOP(uint8_t aHeader);
@@ -424,7 +424,7 @@ protected:
otError HandlePropertySet_SPINEL_PROP_STREAM_RAW(uint8_t aHeader);
#endif
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
void StartLegacy(void);
void StopLegacy(void);
#else
@@ -581,7 +581,7 @@ protected:
uint32_t mOutboundInsecureIpFrameCounter; // Number of insecure outbound data/IP frames.
uint32_t mDroppedOutboundIpFrameCounter; // Number of dropped outbound data/IP frames.
uint32_t mDroppedInboundIpFrameCounter; // Number of dropped inbound data/IP frames.
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
const otNcpLegacyHandlers *mLegacyHandlers;
uint8_t mLegacyUlaPrefix[OT_NCP_LEGACY_ULA_PREFIX_LENGTH];
otExtAddress mLegacyLastJoinedNode;
+5 -5
View File
@@ -313,7 +313,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey)
case SPINEL_PROP_IPV6_ROUTE_TABLE:
handler = &NcpBase::HandlePropertyGet<SPINEL_PROP_IPV6_ROUTE_TABLE>;
break;
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
case SPINEL_PROP_JAM_DETECT_ENABLE:
handler = &NcpBase::HandlePropertyGet<SPINEL_PROP_JAM_DETECT_ENABLE>;
break;
@@ -350,7 +350,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey)
handler = &NcpBase::HandlePropertyGet<SPINEL_PROP_CHANNEL_MONITOR_CHANNEL_OCCUPANCY>;
break;
#endif
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
case SPINEL_PROP_NEST_LEGACY_ULA_PREFIX:
handler = &NcpBase::HandlePropertyGet<SPINEL_PROP_NEST_LEGACY_ULA_PREFIX>;
break;
@@ -837,7 +837,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_MGMT_GET_PENDING_DATASET>;
break;
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
case SPINEL_PROP_JAM_DETECT_ENABLE:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_JAM_DETECT_ENABLE>;
break;
@@ -851,7 +851,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_JAM_DETECT_BUSY>;
break;
#endif
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
case SPINEL_PROP_NEST_LEGACY_ULA_PREFIX:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_NEST_LEGACY_ULA_PREFIX>;
break;
@@ -918,7 +918,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_STEERING_DATA>;
break;
#endif
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
case SPINEL_PROP_THREAD_UDP_FORWARD_STREAM:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_UDP_FORWARD_STREAM>;
break;
+11 -11
View File
@@ -45,7 +45,7 @@
#endif
#include <openthread/diag.h>
#include <openthread/icmp6.h>
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
#include <openthread/jam_detection.h>
#endif
#include <openthread/ncp.h>
@@ -1992,7 +1992,7 @@ exit:
return error;
}
#if OPENTHREAD_ENABLE_JAM_DETECTION
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_JAM_DETECT_ENABLE>(void)
{
@@ -2096,7 +2096,7 @@ void NcpBase::HandleJamStateChange(bool aJamState)
mUpdateChangedPropsTask.Post();
}
#endif // OPENTHREAD_ENABLE_JAM_DETECTION
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE
@@ -3076,7 +3076,7 @@ exit:
#endif // OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
void NcpBase::RegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
{
@@ -3183,7 +3183,7 @@ void NcpBase::StopLegacy(void)
}
}
#endif // OPENTHREAD_ENABLE_LEGACY
#endif // OPENTHREAD_CONFIG_LEGACY_ENABLE
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_THREAD_NETWORK_TIME>(void)
@@ -3435,7 +3435,7 @@ exit:
return error;
}
#if OPENTHREAD_ENABLE_UDP_FORWARD
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_UDP_FORWARD_STREAM>(void)
{
const uint8_t * framePtr = NULL;
@@ -3509,7 +3509,7 @@ exit:
otMessageFree(aMessage);
}
}
#endif // OPENTHREAD_ENABLE_UDP_FORWARD
#endif // OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
// ----------------------------------------------------------------------------
// MARK: Pcap frame handling
@@ -3646,7 +3646,7 @@ void NcpBase::ProcessThreadChangedFlags(void)
}
if ((otThreadGetDeviceRole(mInstance) == OT_DEVICE_ROLE_LEADER) && otThreadIsSingleton(mInstance)
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
&& !mLegacyNodeDidJoin
#endif
)
@@ -3718,7 +3718,7 @@ exit:
void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
{
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
ot::Ncp::NcpBase *ncp = ot::Ncp::NcpBase::GetNcpInstance();
if (ncp != NULL)
@@ -3733,7 +3733,7 @@ void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
void otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix)
{
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
ot::Ncp::NcpBase *ncp = ot::Ncp::NcpBase::GetNcpInstance();
if (ncp != NULL)
@@ -3748,7 +3748,7 @@ void otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix)
void otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr)
{
#if OPENTHREAD_ENABLE_LEGACY
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
ot::Ncp::NcpBase *ncp = ot::Ncp::NcpBase::GetNcpInstance();
if (ncp != NULL)
-2
View File
@@ -79,8 +79,6 @@ configure_options=" \
--disable-tests \
--enable-coverage=$coverage \
--enable-ftd \
--enable-jam-detection \
--enable-legacy \
--enable-ncp \
"
@@ -88,6 +88,22 @@
*/
#define OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_LEGACY_ENABLE
*
* Define to 1 to enable legacy network support.
*
*/
#define OPENTHREAD_CONFIG_LEGACY_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
*
* Define to 1 to enable the Jam Detection service.
*
*/
#define OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
*
+3 -3
View File
@@ -71,7 +71,7 @@ ot::Instance *testInitInstance(void)
{
otInstance *instance = NULL;
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
size_t instanceBufferLength = 0;
uint8_t *instanceBuffer = NULL;
@@ -96,7 +96,7 @@ void testFreeInstance(otInstance *aInstance)
{
otInstanceFinalize(aInstance);
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
free(aInstance);
#endif
}
@@ -105,7 +105,7 @@ bool sDiagMode = false;
extern "C" {
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
void *otPlatCAlloc(size_t aNum, size_t aSize)
{
return calloc(aNum, aSize);
+2 -2
View File
@@ -99,7 +99,7 @@
#define MBEDTLS_X509_CRT_PARSE_C
#endif
#if OPENTHREAD_ENABLE_ECDSA
#if OPENTHREAD_ECDSA_ENABLE
#define MBEDTLS_BASE64_C
#define MBEDTLS_ECDH_C
#define MBEDTLS_ECDSA_C
@@ -114,7 +114,7 @@
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /**< Enable fixed-point speed-up */
#define MBEDTLS_ENTROPY_MAX_SOURCES 1 /**< Maximum number of sources supported */
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
#define MBEDTLS_PLATFORM_STD_CALLOC otPlatCAlloc /**< Default allocator to use, can be undefined */
#define MBEDTLS_PLATFORM_STD_FREE otPlatFree /**< Default free to use, can be undefined */
#else