From 4a475d56734c89875c09680d2fd8b3ff711f779d Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Mon, 15 Jul 2019 22:13:11 -0700 Subject: [PATCH] [config] ip6 (#4020) --- examples/common-switches.mk | 2 +- .../posix/openthread-core-posix-config.h | 6 +- include/openthread/ip6.h | 10 +- src/core/Makefile.am | 1 + src/core/api/ip6_api.cpp | 6 +- src/core/common/instance.hpp | 2 +- src/core/common/settings.hpp | 6 +- src/core/config/ip6.h | 131 ++++++++++++++++++ .../config/openthread-core-default-config.h | 93 ------------- src/core/net/ip6.hpp | 4 +- src/core/net/ip6_mpl.cpp | 2 +- src/core/net/netif.hpp | 4 +- src/core/openthread-core-config.h | 1 + src/core/thread/thread_netif.cpp | 2 +- src/core/thread/thread_netif.hpp | 4 +- src/core/utils/slaac_address.cpp | 4 +- src/core/utils/slaac_address.hpp | 2 +- src/ncp/ncp_base.cpp | 2 +- src/ncp/ncp_base_dispatcher.cpp | 4 +- src/ncp/ncp_base_mtd.cpp | 4 +- .../platform/openthread-core-posix-config.h | 6 +- tests/toranj/openthread-core-toranj-config.h | 12 +- 22 files changed, 174 insertions(+), 134 deletions(-) create mode 100644 src/core/config/ip6.h diff --git a/examples/common-switches.mk b/examples/common-switches.mk index d32694c1e..3338db3e3 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -169,7 +169,7 @@ configure_OPTIONS += --enable-service endif ifeq ($(SLAAC),1) -COMMONCFLAGS += -DOPENTHREAD_CONFIG_ENABLE_SLAAC=1 +COMMONCFLAGS += -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 endif ifeq ($(SNTP_CLIENT),1) diff --git a/examples/platforms/posix/openthread-core-posix-config.h b/examples/platforms/posix/openthread-core-posix-config.h index 144a92d6a..e3802b116 100644 --- a/examples/platforms/posix/openthread-core-posix-config.h +++ b/examples/platforms/posix/openthread-core-posix-config.h @@ -54,13 +54,13 @@ #endif /** - * @def OPENTHREAD_CONFIG_ENABLE_SLAAC + * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE * * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread. * */ -#ifndef OPENTHREAD_CONFIG_ENABLE_SLAAC /* allows command line override */ -#define OPENTHREAD_CONFIG_ENABLE_SLAAC 1 +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE /* allows command line override */ +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 #endif #if OPENTHREAD_RADIO diff --git a/include/openthread/ip6.h b/include/openthread/ip6.h index 8dd37a0a1..f0b677109 100644 --- a/include/openthread/ip6.h +++ b/include/openthread/ip6.h @@ -178,7 +178,7 @@ bool otIp6IsEnabled(otInstance *aInstance); * Add a Network Interface Address to the Thread interface. * * The passed-in instance @p aAddress is copied by the Thread interface. The Thread interface only - * supports a fixed number of externally added unicast addresses. See OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS. + * supports a fixed number of externally added unicast addresses. See OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS. * * @param[in] aInstance A pointer to an OpenThread instance. * @param[in] aAddress A pointer to a Network Interface Address. @@ -214,7 +214,7 @@ const otNetifAddress *otIp6GetUnicastAddresses(otInstance *aInstance); * Subscribe the Thread interface to a Network Interface Multicast Address. * * The passed in instance @p aAddress will be copied by the Thread interface. The Thread interface only - * supports a fixed number of externally added multicast addresses. See OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS. + * supports a fixed number of externally added multicast addresses. See OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS. * * @param[in] aInstance A pointer to an OpenThread instance. * @param[in] aAddress A pointer to an IP Address. @@ -518,7 +518,7 @@ otError otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageI /** * This function indicates whether the SLAAC module is enabled or not. * - * This function requires the build-time feature `OPENTHREAD_CONFIG_ENABLE_SLAAC` to be enabled. + * This function requires the build-time feature `OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` to be enabled. * * @retval TRUE SLAAC module is enabled. * @retval FALSE SLAAC module is disabled. @@ -529,7 +529,7 @@ bool otIp6IsSlaacEnabled(otInstance *aInstance); /** * This function enables/disables the SLAAC module. * - * This function requires the build-time feature `OPENTHREAD_CONFIG_ENABLE_SLAAC` to be enabled. + * This function requires the build-time feature `OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` to be enabled. * * When SLAAC module is enabled, SLAAC addresses (based on on-mesh prefixes in Network Data) are added to the interface. * When SLAAC module is disabled any previously added SLAAC address is removed. @@ -559,7 +559,7 @@ typedef bool (*otIp6SlaacPrefixFilter)(otInstance *aInstance, const otIp6Prefix /** * This function sets the SLAAC module filter handler. * - * This function requires the build-time feature `OPENTHREAD_CONFIG_ENABLE_SLAAC` to be enabled. + * This function requires the build-time feature `OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE` to be enabled. * * The filter handler is called by SLAAC module when it is about to add a SLAAC address based on a prefix to decide * whether the address should be added or not. diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 1bcf863e5..9f1963fef 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -329,6 +329,7 @@ HEADERS_COMMON = \ config/dhcp6_server.h \ config/diag.h \ config/dns_client.h \ + config/ip6.h \ config/openthread-core-config-check.h \ config/openthread-core-default-config.h \ crypto/aes_ccm.hpp \ diff --git a/src/core/api/ip6_api.cpp b/src/core/api/ip6_api.cpp index 26adc1eea..b6419a911 100644 --- a/src/core/api/ip6_api.cpp +++ b/src/core/api/ip6_api.cpp @@ -38,7 +38,7 @@ #include "common/instance.hpp" #include "common/locator-getters.hpp" #include "common/logging.hpp" -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE #include "utils/slaac_address.hpp" #endif @@ -266,7 +266,7 @@ exit: return error; } -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE bool otIp6IsSlaacEnabled(otInstance *aInstance) { @@ -294,4 +294,4 @@ void otIp6SetSlaacPrefixFilter(otInstance *aInstance, otIp6SlaacPrefixFilter aFi instance.Get().SetFilter(aFilter); } -#endif // OPENTHREAD_CONFIG_ENABLE_SLAAC +#endif // OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE diff --git a/src/core/common/instance.hpp b/src/core/common/instance.hpp index 47f31e7d1..a6591b140 100644 --- a/src/core/common/instance.hpp +++ b/src/core/common/instance.hpp @@ -612,7 +612,7 @@ template <> inline Dhcp6::Dhcp6Server &Instance::Get(void) } #endif -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE template <> inline Utils::Slaac &Instance::Get(void) { return mThreadNetif.mSlaac; diff --git a/src/core/common/settings.hpp b/src/core/common/settings.hpp index 974083b06..8e9d28276 100644 --- a/src/core/common/settings.hpp +++ b/src/core/common/settings.hpp @@ -39,7 +39,7 @@ #include "common/locator.hpp" #include "mac/mac_frame.hpp" #include "thread/mle.hpp" -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE #include "utils/slaac_address.hpp" #endif @@ -296,7 +296,7 @@ public: */ otError DeleteParentInfo(void); -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE /** * This method saves the SLAAC IID secret key. @@ -336,7 +336,7 @@ public: */ otError DeleteSlaacIidSecretKey(void) { return Delete(kKeySlaacIidSecretKey); } -#endif // OPENTHREAD_CONFIG_ENABLE_SLAAC +#endif // OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE /** * This method adds a Child Info entry to settings. diff --git a/src/core/config/ip6.h b/src/core/config/ip6.h new file mode 100644 index 000000000..4de1770fc --- /dev/null +++ b/src/core/config/ip6.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2019, The OpenThread Authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * 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 + * 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 + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This file includes compile-time configurations for the IP6 service. + * + */ + +#ifndef CONFIG_IP6_H_ +#define CONFIG_IP6_H_ + +/** + * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS + * + * The maximum number of supported IPv6 addresses allows to be externally added. + * + */ +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 4 +#endif + +/** + * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS + * + * The maximum number of supported IPv6 multicast addresses allows to be externally added. + * + */ +#ifndef OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 2 +#endif + +/** + * @def OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT + * + * This setting configures the default hop limit of IPv6. + * + */ +#ifndef OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT +#define OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT 64 +#endif + +/** + * @def OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH + * + * This setting configures the max datagram length of IPv6. + * + */ +#ifndef OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH +#define OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH 1280 +#endif + +/** + * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE + * + * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread. + * + */ +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES + * + * The number of auto-configured SLAAC addresses. Applicable only if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE is enabled. + * + */ +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES +#define OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES 4 +#endif + +/** + * @def OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES + * + * The number of MPL Seed Set entries for duplicate detection. + * + */ +#ifndef OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES +#define OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES 32 +#endif + +/** + * @def OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME + * + * The MPL Seed Set entry lifetime in seconds. + * + */ +#ifndef OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME +#define OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME 5 +#endif + +/** + * @def OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE + * + * Define as 1 to enable dynamic MPL interval feature. + * + * If this feature is enabled, the MPL forward interval will be adjusted dynamically according to + * the network scale, which helps to reduce multicast latency. + * + */ +#ifndef OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE +#define OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE 0 +#endif + +#endif // CONFIG_IP6_H_ diff --git a/src/core/config/openthread-core-default-config.h b/src/core/config/openthread-core-default-config.h index 43eb1e4fe..0b573b1e3 100644 --- a/src/core/config/openthread-core-default-config.h +++ b/src/core/config/openthread-core-default-config.h @@ -319,26 +319,6 @@ #define OPENTHREAD_CONFIG_IP_ADDRS_TO_REGISTER (OPENTHREAD_CONFIG_IP_ADDRS_PER_CHILD) #endif -/** - * @def OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS - * - * The maximum number of supported IPv6 addresses allows to be externally added. - * - */ -#ifndef OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS -#define OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS 4 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS - * - * The maximum number of supported IPv6 multicast addresses allows to be externally added. - * - */ -#ifndef OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS -#define OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS 2 -#endif - /** * @def OPENTHREAD_CONFIG_MAX_SERVICE_ALOCS * @@ -359,26 +339,6 @@ #define OPENTHREAD_CONFIG_6LOWPAN_REASSEMBLY_TIMEOUT 2 #endif -/** - * @def OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES - * - * The number of MPL Seed Set entries for duplicate detection. - * - */ -#ifndef OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES -#define OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRIES 32 -#endif - -/** - * @def OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME - * - * The MPL Seed Set entry lifetime in seconds. - * - */ -#ifndef OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME -#define OPENTHREAD_CONFIG_MPL_SEED_SET_ENTRY_LIFETIME 5 -#endif - /** * @def OPENTHREAD_CONFIG_JOINER_UDP_PORT * @@ -793,26 +753,6 @@ #define OPENTHREAD_CONFIG_PLAT_LOG_FUNCTION otPlatLog #endif -/** - * @def OPENTHREAD_CONFIG_ENABLE_SLAAC - * - * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread. - * - */ -#ifndef OPENTHREAD_CONFIG_ENABLE_SLAAC -#define OPENTHREAD_CONFIG_ENABLE_SLAAC 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_NUM_SLAAC_ADDRESSES - * - * The number of auto-configured SLAAC addresses. Applicable only if OPENTHREAD_CONFIG_ENABLE_SLAAC is enabled. - * - */ -#ifndef OPENTHREAD_CONFIG_NUM_SLAAC_ADDRESSES -#define OPENTHREAD_CONFIG_NUM_SLAAC_ADDRESSES 4 -#endif - /** * @def OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE * @@ -1346,19 +1286,6 @@ #define OPENTHREAD_CONFIG_ENABLE_DEBUG_UART 0 #endif -/** - * @def OPENTHREAD_CONFIG_ENABLE_DYNAMIC_MPL_INTERVAL - * - * Define as 1 to enable dynamic MPL interval feature. - * - * If this feature is enabled, the MPL forward interval will be adjusted dynamically according to - * the network scale, which helps to reduce multicast latency. - * - */ -#ifndef OPENTHREAD_CONFIG_ENABLE_DYNAMIC_MPL_INTERVAL -#define OPENTHREAD_CONFIG_ENABLE_DYNAMIC_MPL_INTERVAL 0 -#endif - /** * @def OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT * @@ -1511,26 +1438,6 @@ #define OPENTHREAD_CONFIG_DEFAULT_SED_DATAGRAM_COUNT 1 #endif -/** - * @def OPENTHREAD_CONFIG_IPV6_DEFAULT_HOP_LIMIT - * - * This setting configures the default hop limit of IPv6. - * - */ -#ifndef OPENTHREAD_CONFIG_IPV6_DEFAULT_HOP_LIMIT -#define OPENTHREAD_CONFIG_IPV6_DEFAULT_HOP_LIMIT 64 -#endif - -/** - * @def OPENTHREAD_CONFIG_IPV6_DEFAULT_MAX_DATAGRAM - * - * This setting configures the max datagram length of IPv6. - * - */ -#ifndef OPENTHREAD_CONFIG_IPV6_DEFAULT_MAX_DATAGRAM -#define OPENTHREAD_CONFIG_IPV6_DEFAULT_MAX_DATAGRAM 1280 -#endif - /** * @def OPENTHREAD_CONFIG_TIME_SYNC_JUMP_NOTIF_MIN_US * diff --git a/src/core/net/ip6.hpp b/src/core/net/ip6.hpp index edbe30dc2..027285386 100644 --- a/src/core/net/ip6.hpp +++ b/src/core/net/ip6.hpp @@ -104,8 +104,8 @@ class Ip6 : public InstanceLocator public: enum { - kDefaultHopLimit = OPENTHREAD_CONFIG_IPV6_DEFAULT_HOP_LIMIT, - kMaxDatagramLength = OPENTHREAD_CONFIG_IPV6_DEFAULT_MAX_DATAGRAM, + kDefaultHopLimit = OPENTHREAD_CONFIG_IP6_HOP_LIMIT_DEFAULT, + kMaxDatagramLength = OPENTHREAD_CONFIG_IP6_MAX_DATAGRAM_LENGTH, }; /** diff --git a/src/core/net/ip6_mpl.cpp b/src/core/net/ip6_mpl.cpp index 787bda26d..c04e1f581 100644 --- a/src/core/net/ip6_mpl.cpp +++ b/src/core/net/ip6_mpl.cpp @@ -242,7 +242,7 @@ void Mpl::AddBufferedMessage(Message &aMessage, uint16_t aSeedId, uint8_t aSeque uint32_t nextTransmissionTime; uint8_t hopLimit = 0; -#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_MPL_INTERVAL +#if OPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE // adjust the first MPL forward interval dynamically according to the network scale uint8_t interval = (kDataMessageInterval / Mle::kMaxRouters) * Get().GetNeighborCount(); #else diff --git a/src/core/net/netif.hpp b/src/core/net/netif.hpp index 9616c04b0..f6161194f 100644 --- a/src/core/net/netif.hpp +++ b/src/core/net/netif.hpp @@ -430,8 +430,8 @@ private: otIp6AddressCallback mAddressCallback; void * mAddressCallbackContext; - NetifUnicastAddress mExtUnicastAddresses[OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS]; - NetifMulticastAddress mExtMulticastAddresses[OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS]; + NetifUnicastAddress mExtUnicastAddresses[OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS]; + NetifMulticastAddress mExtMulticastAddresses[OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS]; static const otNetifMulticastAddress kRealmLocalAllMplForwardersMulticastAddress; static const otNetifMulticastAddress kLinkLocalAllNodesMulticastAddress; diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index ecc588119..947229ff5 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -55,6 +55,7 @@ #include "config/dhcp6_server.h" #include "config/diag.h" #include "config/dns_client.h" +#include "config/ip6.h" #if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE || OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE || \ OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_ENABLE_JOINER diff --git a/src/core/thread/thread_netif.cpp b/src/core/thread/thread_netif.cpp index 5c2e587de..5090d039e 100644 --- a/src/core/thread/thread_netif.cpp +++ b/src/core/thread/thread_netif.cpp @@ -56,7 +56,7 @@ ThreadNetif::ThreadNetif(Instance &aInstance) #if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE , mDhcp6Server(aInstance) #endif // OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE , mSlaac(aInstance) #endif #if OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE diff --git a/src/core/thread/thread_netif.hpp b/src/core/thread/thread_netif.hpp index d9aef0418..dffb5ec5a 100644 --- a/src/core/thread/thread_netif.hpp +++ b/src/core/thread/thread_netif.hpp @@ -75,7 +75,7 @@ #include "thread/time_sync_service.hpp" #include "utils/child_supervision.hpp" -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE #include "utils/slaac_address.hpp" #endif @@ -170,7 +170,7 @@ private: #if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE Dhcp6::Dhcp6Server mDhcp6Server; #endif // OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE Utils::Slaac mSlaac; #endif #if OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE diff --git a/src/core/utils/slaac_address.cpp b/src/core/utils/slaac_address.cpp index 32d368be5..2210e27d1 100644 --- a/src/core/utils/slaac_address.cpp +++ b/src/core/utils/slaac_address.cpp @@ -44,7 +44,7 @@ #include "crypto/sha256.hpp" #include "net/ip6_address.hpp" -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE namespace ot { namespace Utils { @@ -335,4 +335,4 @@ exit: } // namespace Utils } // namespace ot -#endif // OPENTHREAD_CONFIG_ENABLE_SLAAC +#endif // OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE diff --git a/src/core/utils/slaac_address.hpp b/src/core/utils/slaac_address.hpp index d4e1fc7b1..90fd9f81b 100644 --- a/src/core/utils/slaac_address.hpp +++ b/src/core/utils/slaac_address.hpp @@ -148,7 +148,7 @@ private: bool mEnabled; otIp6SlaacPrefixFilter mFilter; Notifier::Callback mNotifierCallback; - Ip6::NetifUnicastAddress mAddresses[OPENTHREAD_CONFIG_NUM_SLAAC_ADDRESSES]; + Ip6::NetifUnicastAddress mAddresses[OPENTHREAD_CONFIG_IP6_SLAAC_NUM_ADDRESSES]; }; /** diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 9f4cc9e0a..80211098d 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1789,7 +1789,7 @@ template <> otError NcpBase::HandlePropertyGet(void) SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_OOB_STEERING_DATA)); #endif -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_SLAAC)); #endif diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index a6003b2b3..aa02ba783 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -514,7 +514,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey) handler = &NcpBase::HandlePropertyGet; break; #endif -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE case SPINEL_PROP_SLAAC_ENABLED: handler = &NcpBase::HandlePropertyGet; break; @@ -864,7 +864,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) handler = &NcpBase::HandlePropertySet; break; #endif -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE case SPINEL_PROP_SLAAC_ENABLED: handler = &NcpBase::HandlePropertySet; break; diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 3c0c408dd..106d7ffbe 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -3055,7 +3055,7 @@ template <> otError NcpBase::HandlePropertyGet(void) #endif -#if OPENTHREAD_CONFIG_ENABLE_SLAAC +#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE template <> otError NcpBase::HandlePropertyGet(void) { @@ -3074,7 +3074,7 @@ exit: return error; } -#endif // OPENTHREAD_CONFIG_ENABLE_SLAAC +#endif // OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE #if OPENTHREAD_ENABLE_LEGACY diff --git a/src/posix/platform/openthread-core-posix-config.h b/src/posix/platform/openthread-core-posix-config.h index d22ca98b0..9f1924c40 100644 --- a/src/posix/platform/openthread-core-posix-config.h +++ b/src/posix/platform/openthread-core-posix-config.h @@ -43,13 +43,13 @@ #define OPENTHREAD_CONFIG_PLATFORM_INFO "POSIX-APP" /** - * @def OPENTHREAD_CONFIG_ENABLE_SLAAC + * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE * * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread. * */ -#ifndef OPENTHREAD_CONFIG_ENABLE_SLAAC /* allows command line override */ -#define OPENTHREAD_CONFIG_ENABLE_SLAAC 1 +#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE /* allows command line override */ +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 #endif #define OPENTHREAD_CONFIG_UART_CLI_RAW 1 diff --git a/tests/toranj/openthread-core-toranj-config.h b/tests/toranj/openthread-core-toranj-config.h index 967c1e16f..a31bcc78f 100644 --- a/tests/toranj/openthread-core-toranj-config.h +++ b/tests/toranj/openthread-core-toranj-config.h @@ -123,20 +123,20 @@ #define OPENTHREAD_CONFIG_IP_ADDRS_PER_CHILD 10 /** - * @def OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS + * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS * * The maximum number of supported IPv6 addresses allows to be externally added. * */ -#define OPENTHREAD_CONFIG_MAX_EXT_IP_ADDRS 8 +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_UCAST_ADDRS 8 /** - * @def OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS + * @def OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS * * The maximum number of supported IPv6 multicast addresses allows to be externally added. * */ -#define OPENTHREAD_CONFIG_MAX_EXT_MULTICAST_IP_ADDRS 4 +#define OPENTHREAD_CONFIG_IP6_MAX_EXT_MCAST_ADDRS 4 /** * @def OPENTHREAD_CONFIG_MAC_FILTER_SIZE @@ -337,12 +337,12 @@ #define OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL 1 /** - * @def OPENTHREAD_CONFIG_ENABLE_SLAAC + * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE * * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread. * */ -#define OPENTHREAD_CONFIG_ENABLE_SLAAC 1 +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 #if OPENTHREAD_RADIO /**