Skip to content

Commit

Permalink
Rename CHIP_CONFIG_MAX_DEVICE_ADMINS to CHIP_CONFIG_MAX_FABRICS. (#14851
Browse files Browse the repository at this point in the history
)

That's what it really means.  There can be multiple "admins" per fabric.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Nov 13, 2023
1 parent e6371a6 commit 24aaf68
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 52 deletions.
10 changes: 5 additions & 5 deletions examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions examples/platform/qpg/project_include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/access/examples/ExampleAccessControlDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
11 changes: 4 additions & 7 deletions src/credentials/FabricTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
namespace chip {

static constexpr FabricIndex kMinValidFabricIndex = 1;
static constexpr FabricIndex kMaxValidFabricIndex = std::min<FabricIndex>(UINT8_MAX - 1, CHIP_CONFIG_MAX_DEVICE_ADMINS);
static constexpr FabricIndex kMaxValidFabricIndex = std::min<FabricIndex>(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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/include/platform/CHIPDeviceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
14 changes: 7 additions & 7 deletions src/lib/core/CHIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/platform/CYW30739/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/platform/CYW30739/KeyValueStoreManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/platform/EFR32/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ====================
Expand Down
6 changes: 3 additions & 3 deletions src/platform/cc13x2_26x2/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/platform/nrfconnect/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/platform/qpg/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24aaf68

Please sign in to comment.