From 2522040653879aaebba7fb138fc4cd0d9550b0d6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 Feb 2022 11:10:53 -0500 Subject: [PATCH] Rename CHIP_CONFIG_MAX_DEVICE_ADMINS to CHIP_CONFIG_MAX_FABRICS. (#14851) That's what it really means. There can be multiple "admins" per fabric. --- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 10 +++++----- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 10 +++++----- .../qpg/project_include/CHIPProjectConfig.h | 10 +++++----- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 10 +++++----- .../examples/ExampleAccessControlDelegate.cpp | 2 +- .../operational-credentials-server.cpp | 2 +- src/credentials/FabricTable.h | 11 ++++------- src/include/platform/CHIPDeviceConfig.h | 2 +- src/lib/core/CHIPConfig.h | 14 +++++++------- src/platform/CYW30739/CHIPPlatformConfig.h | 2 +- src/platform/CYW30739/KeyValueStoreManagerImpl.h | 2 +- src/platform/EFR32/CHIPPlatformConfig.h | 12 ++++++------ src/platform/cc13x2_26x2/CHIPPlatformConfig.h | 6 +++--- src/platform/nrfconnect/CHIPDevicePlatformConfig.h | 2 +- src/platform/nrfconnect/CHIPPlatformConfig.h | 4 ++-- src/platform/qpg/CHIPDevicePlatformConfig.h | 2 +- 16 files changed, 49 insertions(+), 52 deletions(-) diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index b0056fd0f95d7b..ddb2f24ecbb2e0 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -161,14 +161,14 @@ #define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack /** * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 7b2b57139300a0..71cb0c323eb144 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -161,14 +161,14 @@ #define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 1000_ms32 diff --git a/examples/platform/qpg/project_include/CHIPProjectConfig.h b/examples/platform/qpg/project_include/CHIPProjectConfig.h index 749c47b148169f..b6252bc544d7a7 100644 --- a/examples/platform/qpg/project_include/CHIPProjectConfig.h +++ b/examples/platform/qpg/project_include/CHIPProjectConfig.h @@ -116,14 +116,14 @@ #define CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI 1 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack /** * @name Interaction Model object pool configuration. diff --git a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 3790ed574daaf2..4867be87e586ad 100644 --- a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -168,14 +168,14 @@ #define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 2 // 1 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 2 // 1 fabrics + 1 for rotation slack /** * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE diff --git a/src/access/examples/ExampleAccessControlDelegate.cpp b/src/access/examples/ExampleAccessControlDelegate.cpp index c461d55d585ab0..269600fe503ad3 100644 --- a/src/access/examples/ExampleAccessControlDelegate.cpp +++ b/src/access/examples/ExampleAccessControlDelegate.cpp @@ -353,7 +353,7 @@ class EntryStorage { public: // ACL support - static constexpr size_t kNumberOfFabrics = CHIP_CONFIG_MAX_DEVICE_ADMINS; + static constexpr size_t kNumberOfFabrics = CHIP_CONFIG_MAX_FABRICS; static constexpr size_t kEntriesPerFabric = CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC; static EntryStorage acl[kNumberOfFabrics * kEntriesPerFabric]; diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 397e18039d241c..b97e703dbb9db7 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -135,7 +135,7 @@ CHIP_ERROR OperationalCredentialsAttrAccess::ReadNOCs(EndpointId endpoint, Attri CHIP_ERROR OperationalCredentialsAttrAccess::ReadSupportedFabrics(EndpointId endpoint, AttributeValueEncoder & aEncoder) { - uint8_t fabricCount = CHIP_CONFIG_MAX_DEVICE_ADMINS; + uint8_t fabricCount = CHIP_CONFIG_MAX_FABRICS; return aEncoder.Encode(fabricCount); } diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index ee59c580bc3cc8..90086c26d22471 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -43,7 +43,7 @@ namespace chip { static constexpr FabricIndex kMinValidFabricIndex = 1; -static constexpr FabricIndex kMaxValidFabricIndex = std::min(UINT8_MAX - 1, CHIP_CONFIG_MAX_DEVICE_ADMINS); +static constexpr FabricIndex kMaxValidFabricIndex = std::min(UINT8_MAX - 1, CHIP_CONFIG_MAX_FABRICS); static constexpr uint8_t kFabricLabelMaxLengthInBytes = 32; // KVS store is sensitive to length of key strings, based on the underlying @@ -441,16 +441,13 @@ class DLL_EXPORT FabricTable uint8_t FabricCount() const { return mFabricCount; } - ConstFabricIterator cbegin() const { return ConstFabricIterator(mStates, 0, CHIP_CONFIG_MAX_DEVICE_ADMINS); } - ConstFabricIterator cend() const - { - return ConstFabricIterator(mStates, CHIP_CONFIG_MAX_DEVICE_ADMINS, CHIP_CONFIG_MAX_DEVICE_ADMINS); - } + ConstFabricIterator cbegin() const { return ConstFabricIterator(mStates, 0, CHIP_CONFIG_MAX_FABRICS); } + ConstFabricIterator cend() const { return ConstFabricIterator(mStates, CHIP_CONFIG_MAX_FABRICS, CHIP_CONFIG_MAX_FABRICS); } ConstFabricIterator begin() const { return cbegin(); } ConstFabricIterator end() const { return cend(); } private: - FabricInfo mStates[CHIP_CONFIG_MAX_DEVICE_ADMINS]; + FabricInfo mStates[CHIP_CONFIG_MAX_FABRICS]; FabricStorage * mStorage = nullptr; FabricTableDelegate * mDelegate = nullptr; diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 1ea8935400403e..8a3416441d3dd2 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -743,7 +743,7 @@ * Amount of services available for advertising using SRP. */ #ifndef CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES -#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_DEVICE_ADMINS + 1) +#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1) #endif /** diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index a431c4b064bc0b..4e4cad403b690f 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1259,16 +1259,16 @@ #endif // CHIP_CONFIG_MAX_BINDINGS /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 16 -#endif // CHIP_CONFIG_MAX_DEVICE_ADMINS +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 16 +#endif // CHIP_CONFIG_MAX_FABRICS /** * @def CHIP_NON_PRODUCTION_MARKER diff --git a/src/platform/CYW30739/CHIPPlatformConfig.h b/src/platform/CYW30739/CHIPPlatformConfig.h index 2b3f19733d859a..dd8571846c9dbd 100644 --- a/src/platform/CYW30739/CHIPPlatformConfig.h +++ b/src/platform/CYW30739/CHIPPlatformConfig.h @@ -24,7 +24,7 @@ #pragma once #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_VALUE_LENGTH 2048 -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 +#define CHIP_CONFIG_MAX_FABRICS 4 #define CHIP_CONFIG_UNAUTHENTICATED_CONNECTION_POOL_SIZE 10 #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING 1 diff --git a/src/platform/CYW30739/KeyValueStoreManagerImpl.h b/src/platform/CYW30739/KeyValueStoreManagerImpl.h index a166b876681b6a..ff99be1dc75389 100644 --- a/src/platform/CYW30739/KeyValueStoreManagerImpl.h +++ b/src/platform/CYW30739/KeyValueStoreManagerImpl.h @@ -47,7 +47,7 @@ class KeyValueStoreManagerImpl final : public KeyValueStoreManager private: static constexpr uint8_t mMaxEntryCount = 1 + /* For the global message counter */ 1 + /* For the admin key count */ - CHIP_CONFIG_MAX_DEVICE_ADMINS + 1 + /* For the session key count */ + CHIP_CONFIG_MAX_FABRICS + 1 + /* For the session key count */ CHIP_CONFIG_MAX_SESSION_KEYS; struct KeyEntry diff --git a/src/platform/EFR32/CHIPPlatformConfig.h b/src/platform/EFR32/CHIPPlatformConfig.h index 3c8dd7b2238f30..b11a45fc8db344 100644 --- a/src/platform/EFR32/CHIPPlatformConfig.h +++ b/src/platform/EFR32/CHIPPlatformConfig.h @@ -81,15 +81,15 @@ #endif // CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS /** - * @def CHIP_CONFIG_MAX_DEVICE_ADMINS + * @def CHIP_CONFIG_MAX_FABRICS * * @brief - * Maximum number of administrators that can provision the device. Each admin - * can provision the device with their unique operational credentials and manage - * their access control lists. + * Maximum number of fabrics the device can participate in. Each fabric can + * provision the device with its unique operational credentials and manage + * its own access control lists. */ -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 5 // 4 fabrics + 1 for rotation slack +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 // 4 fabrics + 1 for rotation slack #endif // ==================== FreeRTOS Configuration Overrides ==================== diff --git a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h index 6763d43846e6c2..e22eef5189a422 100644 --- a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h @@ -80,6 +80,6 @@ #endif // CHIP_CONFIG_MAX_LOCAL_ADDR_UDP_ENDPOINTS // Limit the number of device admins to ensure enough ressources for handling them -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 5 -#endif // CHIP_CONFIG_MAX_DEVICE_ADMINS +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif // CHIP_CONFIG_MAX_FABRICS diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 1097f7b2ff8fd6..01fe0d0e72e934 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -90,7 +90,7 @@ #ifdef CONFIG_CHIP_ENABLE_DNSSD_SRP #define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_DEVICE_ADMINS + 1) +#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1) #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 #ifdef CONFIG_CHIP_ENABLE_DNS_CLIENT diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index 9864374c88596c..589eaceabd7522 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -68,6 +68,6 @@ #define CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS 1 #endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS -#ifndef CHIP_CONFIG_MAX_DEVICE_ADMINS -#define CHIP_CONFIG_MAX_DEVICE_ADMINS 5 +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 #endif diff --git a/src/platform/qpg/CHIPDevicePlatformConfig.h b/src/platform/qpg/CHIPDevicePlatformConfig.h index ecbad8ade3443a..74be4b6bb2ff32 100644 --- a/src/platform/qpg/CHIPDevicePlatformConfig.h +++ b/src/platform/qpg/CHIPDevicePlatformConfig.h @@ -33,7 +33,7 @@ #if CHIP_ENABLE_OPENTHREAD #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_DEVICE_ADMINS + 1) +#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1) #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 #endif