@@ -345,13 +345,29 @@ class AccessControl
345
345
virtual CHIP_ERROR Finish () { return CHIP_NO_ERROR; }
346
346
347
347
// Capabilities
348
- virtual CHIP_ERROR GetMaxEntryCount (size_t & value) const
348
+ virtual CHIP_ERROR GetMaxEntriesPerFabric (size_t & value) const
349
+ {
350
+ value = 0 ;
351
+ return CHIP_NO_ERROR;
352
+ }
353
+
354
+ virtual CHIP_ERROR GetMaxSubjectsPerEntry (size_t & value) const
349
355
{
350
356
value = 0 ;
351
357
return CHIP_NO_ERROR;
352
358
}
353
359
354
- // TODO: add more capabilities
360
+ virtual CHIP_ERROR GetMaxTargetsPerEntry (size_t & value) const
361
+ {
362
+ value = 0 ;
363
+ return CHIP_NO_ERROR;
364
+ }
365
+
366
+ virtual CHIP_ERROR GetMaxEntryCount (size_t & value) const
367
+ {
368
+ value = 0 ;
369
+ return CHIP_NO_ERROR;
370
+ }
355
371
356
372
// Actualities
357
373
virtual CHIP_ERROR GetEntryCount (FabricIndex fabric, size_t & value) const
@@ -417,6 +433,24 @@ class AccessControl
417
433
CHIP_ERROR Finish ();
418
434
419
435
// Capabilities
436
+ CHIP_ERROR GetMaxEntriesPerFabric (size_t & value) const
437
+ {
438
+ VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
439
+ return mDelegate ->GetMaxEntriesPerFabric (value);
440
+ }
441
+
442
+ CHIP_ERROR GetMaxSubjectsPerEntry (size_t & value) const
443
+ {
444
+ VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
445
+ return mDelegate ->GetMaxSubjectsPerEntry (value);
446
+ }
447
+
448
+ CHIP_ERROR GetMaxTargetsPerEntry (size_t & value) const
449
+ {
450
+ VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
451
+ return mDelegate ->GetMaxTargetsPerEntry (value);
452
+ }
453
+
420
454
CHIP_ERROR GetMaxEntryCount (size_t & value) const
421
455
{
422
456
VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
@@ -457,19 +491,7 @@ class AccessControl
457
491
* @param [out] index (If not nullptr) index of created entry (relative to fabric).
458
492
* @param [in] entry Entry from which created entry is copied.
459
493
*/
460
- CHIP_ERROR CreateEntry (const SubjectDescriptor * subjectDescriptor, FabricIndex fabric, size_t * index, const Entry & entry)
461
- {
462
- VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
463
- ReturnErrorCodeIf (!IsValid (entry), CHIP_ERROR_INVALID_ARGUMENT);
464
- size_t i;
465
- ReturnErrorOnFailure (mDelegate ->CreateEntry (&i, entry, &fabric));
466
- if (index )
467
- {
468
- *index = i;
469
- }
470
- NotifyEntryChanged (subjectDescriptor, fabric, i, &entry, EntryListener::ChangeType::kAdded );
471
- return CHIP_NO_ERROR;
472
- }
494
+ CHIP_ERROR CreateEntry (const SubjectDescriptor * subjectDescriptor, FabricIndex fabric, size_t * index, const Entry & entry);
473
495
474
496
/* *
475
497
* Creates an entry in the access control list.
@@ -519,14 +541,7 @@ class AccessControl
519
541
* @param [in] index Index of entry to update (relative to fabric).
520
542
* @param [in] entry Entry from which updated entry is copied.
521
543
*/
522
- CHIP_ERROR UpdateEntry (const SubjectDescriptor * subjectDescriptor, FabricIndex fabric, size_t index, const Entry & entry)
523
- {
524
- VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
525
- ReturnErrorCodeIf (!IsValid (entry), CHIP_ERROR_INVALID_ARGUMENT);
526
- ReturnErrorOnFailure (mDelegate ->UpdateEntry (index , entry, &fabric));
527
- NotifyEntryChanged (subjectDescriptor, fabric, index , &entry, EntryListener::ChangeType::kUpdated );
528
- return CHIP_NO_ERROR;
529
- }
544
+ CHIP_ERROR UpdateEntry (const SubjectDescriptor * subjectDescriptor, FabricIndex fabric, size_t index, const Entry & entry);
530
545
531
546
/* *
532
547
* Updates an entry in the access control list.
@@ -549,27 +564,7 @@ class AccessControl
549
564
* @param [in] fabric Index of fabric in which to delete entry.
550
565
* @param [in] index Index of entry to delete (relative to fabric).
551
566
*/
552
- CHIP_ERROR DeleteEntry (const SubjectDescriptor * subjectDescriptor, FabricIndex fabric, size_t index)
553
- {
554
- VerifyOrReturnError (IsInitialized (), CHIP_ERROR_INCORRECT_STATE);
555
- Entry entry;
556
- Entry * p = nullptr ;
557
- if (mEntryListener != nullptr && ReadEntry (fabric, index , entry) == CHIP_NO_ERROR)
558
- {
559
- p = &entry;
560
- }
561
- ReturnErrorOnFailure (mDelegate ->DeleteEntry (index , &fabric));
562
- if (p && p->HasDefaultDelegate ())
563
- {
564
- // The entry was read prior to deletion so its latest value could be provided
565
- // to the listener after deletion. If it's been reset to its default delegate,
566
- // that best effort attempt to retain the latest value failed. This is
567
- // regretable but OK.
568
- p = nullptr ;
569
- }
570
- NotifyEntryChanged (subjectDescriptor, fabric, index , p, EntryListener::ChangeType::kRemoved );
571
- return CHIP_NO_ERROR;
572
- }
567
+ CHIP_ERROR DeleteEntry (const SubjectDescriptor * subjectDescriptor, FabricIndex fabric, size_t index);
573
568
574
569
/* *
575
570
* Deletes an entry from the access control list.
0 commit comments