Skip to content

Commit

Permalink
[Group ]Group msg counter (#14996)
Browse files Browse the repository at this point in the history
* Add Group Message counters

* Counter Integration
  • Loading branch information
jepenven-silabs authored Feb 16, 2022
1 parent 862f170 commit f7910c9
Show file tree
Hide file tree
Showing 13 changed files with 1,075 additions and 29 deletions.
7 changes: 4 additions & 3 deletions src/app/tests/suites/TestGroupMessaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ tests:
arguments:
values:
- name: "GroupKeySet"
value:
{
value: {
GroupKeySetID: 0x01a1,
GroupKeySecurityPolicy: 0,
# TODO Revert this once MCSP is implemented
# GroupKeySecurityPolicy: 0,
GroupKeySecurityPolicy: 1, # 1 => LowLatency => TrustFirst
EpochKey0: "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf",
EpochStartTime0: 1110000,
EpochKey1: "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf",
Expand Down
21 changes: 21 additions & 0 deletions src/lib/core/CHIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,27 @@
#define CHIP_CONFIG_MAX_FABRICS 16
#endif // CHIP_CONFIG_MAX_FABRICS

/**
* @def CHIP_CONFIG_MAX_GROUP_DATA_PEERS
*
* @brief
* Maximum number of Peer within a fabric that can send group data message to a device.
*
*/
#ifndef CHIP_CONFIG_MAX_GROUP_DATA_PEERS
#define CHIP_CONFIG_MAX_GROUP_DATA_PEERS 15
#endif // CHIP_CONFIG_MAX_GROUP_DATA_PEERS

/**
* @def CHIP_CONFIG_MAX_GROUP_CONTROL_PEERS
*
* @brief
* Maximum number of Peer within a fabric that can send group control message to a device.
*/
#ifndef CHIP_CONFIG_MAX_GROUP_CONTROL_PEERS
#define CHIP_CONFIG_MAX_GROUP_CONTROL_PEERS 2
#endif // CHIP_CONFIG_MAX_GROUP_CONTROL_PEER

/**
* @def CHIP_NON_PRODUCTION_MARKER
*
Expand Down
4 changes: 4 additions & 0 deletions src/lib/support/DefaultStorageKeyAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class DefaultStorageKeyAllocator
return Format("acl/%x", static_cast<unsigned int>(index));
}

// Group Message Counters
const char * GroupDataCounter() { return Format("gdc"); }
const char * GroupControlCounter() { return Format("gcc"); }

// Group Data Provider

const char * FabricTable() { return Format("f/t"); }
Expand Down
12 changes: 12 additions & 0 deletions src/platform/telink/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@

#define CHIP_CONFIG_ERROR_CLASS 1

/**
* @def CHIP_CONFIG_MAX_FABRICS
*
* @brief
* 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_FABRICS
#define CHIP_CONFIG_MAX_FABRICS 5 // 4 fabrics + 1 for rotation slack
#endif

// ==================== Security Adaptations ====================

// ==================== General Configuration Overrides ====================
Expand Down
2 changes: 2 additions & 0 deletions src/transport/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ static_library("transport") {
sources = [
"CryptoContext.cpp",
"CryptoContext.h",
"GroupPeerMessageCounter.cpp",
"GroupPeerMessageCounter.h",
"GroupSession.h",
"MessageCounter.cpp",
"MessageCounter.h",
Expand Down
Loading

0 comments on commit f7910c9

Please sign in to comment.