#![allow(unused_imports)]
use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
use crate::dm::meta::{EventPriority, Reporting};
use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
use crate::error::Result;
use crate::im::{AttributeId, ClusterId, CommandId, EventId};
use crate::tlv::{
ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
};
pub const ID: ClusterId = 0x001F;
pub const REVISION: u16 = 3;
pub const PICS: &str = "ACL";
pub mod feature {
pub const EXTENSION: u32 = 1 << 0;
pub const MANAGED_DEVICE: u32 = 1 << 1;
pub const AUXILIARY: u32 = 1 << 2;
}
pub const FEATURES: &[Feature] = &[
Feature {
bit: 0,
code: "EXTS",
name: "Extension",
conform: Conform::OPTIONAL,
},
Feature {
bit: 1,
code: "MNGD",
name: "ManagedDevice",
conform: Conform::DESCRIBED,
},
Feature {
bit: 2,
code: "AUX",
name: "Auxiliary",
conform: Conform {
clauses: &[
Clause {
verdict: Conformance::Provisional,
when: Condition::Always,
},
Clause {
verdict: Conformance::Described,
when: Condition::Always,
},
],
},
},
];
pub mod attribute {
use crate::im::AttributeId;
pub const ACL: AttributeId = 0x00;
pub const EXTENSION: AttributeId = 0x01;
pub const SUBJECTS_PER_ACCESS_CONTROL_ENTRY: AttributeId = 0x02;
pub const TARGETS_PER_ACCESS_CONTROL_ENTRY: AttributeId = 0x03;
pub const ACCESS_CONTROL_ENTRIES_PER_FABRIC: AttributeId = 0x04;
pub const COMMISSIONING_ARL: AttributeId = 0x05;
pub const ARL: AttributeId = 0x06;
pub const AUXILIARY_ACL: AttributeId = 0x07;
}
pub mod command {
use crate::im::CommandId;
pub const REVIEW_FABRIC_RESTRICTIONS: CommandId = 0x00;
pub const REVIEW_FABRIC_RESTRICTIONS_RESPONSE: CommandId = 0x01;
}
pub mod event {
use crate::im::EventId;
pub const ACCESS_CONTROL_ENTRY_CHANGED: EventId = 0x00;
pub const ACCESS_CONTROL_EXTENSION_CHANGED: EventId = 0x01;
pub const FABRIC_RESTRICTION_REVIEW_UPDATE: EventId = 0x02;
pub const AUXILIARY_ACCESS_UPDATED: EventId = 0x03;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum AccessControlAuxiliaryTypeEnum {
System = 0,
Groupcast = 1,
}
impl AccessControlAuxiliaryTypeEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::System),
1 => Some(Self::Groupcast),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for AccessControlAuxiliaryTypeEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for AccessControlAuxiliaryTypeEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum AccessControlEntryAuthModeEnum {
PASE = 1,
CASE = 2,
Group = 3,
}
impl AccessControlEntryAuthModeEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
1 => Some(Self::PASE),
2 => Some(Self::CASE),
3 => Some(Self::Group),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for AccessControlEntryAuthModeEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for AccessControlEntryAuthModeEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum AccessControlEntryPrivilegeEnum {
View = 1,
ProxyView = 2,
Operate = 3,
Manage = 4,
Administer = 5,
}
impl AccessControlEntryPrivilegeEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
1 => Some(Self::View),
2 => Some(Self::ProxyView),
3 => Some(Self::Operate),
4 => Some(Self::Manage),
5 => Some(Self::Administer),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for AccessControlEntryPrivilegeEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for AccessControlEntryPrivilegeEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum AccessRestrictionTypeEnum {
AttributeAccessForbidden = 0,
AttributeWriteForbidden = 1,
CommandForbidden = 2,
EventForbidden = 3,
}
impl AccessRestrictionTypeEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::AttributeAccessForbidden),
1 => Some(Self::AttributeWriteForbidden),
2 => Some(Self::CommandForbidden),
3 => Some(Self::EventForbidden),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for AccessRestrictionTypeEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for AccessRestrictionTypeEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ChangeTypeEnum {
Changed = 0,
Added = 1,
Removed = 2,
}
impl ChangeTypeEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::Changed),
1 => Some(Self::Added),
2 => Some(Self::Removed),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for ChangeTypeEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for ChangeTypeEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AccessControlEntryStruct<'a> {
pub privilege: AccessControlEntryPrivilegeEnum,
pub auth_mode: AccessControlEntryAuthModeEnum,
pub subjects: Nullable<TlvList<'a, u64>>,
pub targets: Nullable<TlvList<'a, AccessControlTargetStruct>>,
pub auxiliary_type: Option<AccessControlAuxiliaryTypeEnum>,
pub fabric_index: crate::msg::FabricIndex,
}
impl<'a> ToTlv for AccessControlEntryStruct<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.privilege.to_tlv(w, Tag::Context(1))?;
self.auth_mode.to_tlv(w, Tag::Context(2))?;
self.subjects.to_tlv(w, Tag::Context(3))?;
self.targets.to_tlv(w, Tag::Context(4))?;
if let Some(value) = &self.auxiliary_type {
value.to_tlv(w, Tag::Context(5))?;
}
self.fabric_index.to_tlv(w, Tag::Context(254))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for AccessControlEntryStruct<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut privilege = None;
let mut auth_mode = None;
let mut subjects = None;
let mut targets = None;
let mut auxiliary_type = None;
let mut fabric_index = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(1) => {
privilege = Some(<AccessControlEntryPrivilegeEnum>::from_tlv(reader, &field)?)
}
Some(2) => {
auth_mode = Some(<AccessControlEntryAuthModeEnum>::from_tlv(reader, &field)?)
}
Some(3) => subjects = Some(<Nullable<TlvList<'a, u64>>>::from_tlv(reader, &field)?),
Some(4) => {
targets = Some(
<Nullable<TlvList<'a, AccessControlTargetStruct>>>::from_tlv(
reader, &field,
)?,
)
}
Some(5) => {
auxiliary_type =
Some(<AccessControlAuxiliaryTypeEnum>::from_tlv(reader, &field)?)
}
Some(254) => {
fabric_index = Some(<crate::msg::FabricIndex>::from_tlv(reader, &field)?)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
privilege: privilege.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
auth_mode: auth_mode.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
subjects: subjects.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
targets: targets.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
auxiliary_type,
fabric_index: fabric_index.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AccessControlExtensionStruct<'a> {
pub data: &'a [u8],
pub fabric_index: crate::msg::FabricIndex,
}
impl<'a> ToTlv for AccessControlExtensionStruct<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.data.to_tlv(w, Tag::Context(1))?;
self.fabric_index.to_tlv(w, Tag::Context(254))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for AccessControlExtensionStruct<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut data = None;
let mut fabric_index = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(1) => data = Some(<&'a [u8]>::from_tlv(reader, &field)?),
Some(254) => {
fabric_index = Some(<crate::msg::FabricIndex>::from_tlv(reader, &field)?)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
data: data.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
fabric_index: fabric_index.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AccessControlTargetStruct {
pub cluster: Nullable<u32>,
pub endpoint: Nullable<u16>,
pub device_type: Nullable<u32>,
}
impl ToTlv for AccessControlTargetStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.cluster.to_tlv(w, Tag::Context(0))?;
self.endpoint.to_tlv(w, Tag::Context(1))?;
self.device_type.to_tlv(w, Tag::Context(2))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for AccessControlTargetStruct {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut cluster = None;
let mut endpoint = None;
let mut device_type = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => cluster = Some(<Nullable<u32>>::from_tlv(reader, &field)?),
Some(1) => endpoint = Some(<Nullable<u16>>::from_tlv(reader, &field)?),
Some(2) => device_type = Some(<Nullable<u32>>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
cluster: cluster.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
endpoint: endpoint.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
device_type: device_type.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AccessRestrictionEntryStruct<'a> {
pub endpoint: u16,
pub cluster: u32,
pub restrictions: TlvList<'a, AccessRestrictionStruct>,
pub fabric_index: crate::msg::FabricIndex,
}
impl<'a> ToTlv for AccessRestrictionEntryStruct<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.endpoint.to_tlv(w, Tag::Context(0))?;
self.cluster.to_tlv(w, Tag::Context(1))?;
self.restrictions.to_tlv(w, Tag::Context(2))?;
self.fabric_index.to_tlv(w, Tag::Context(254))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for AccessRestrictionEntryStruct<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut endpoint = None;
let mut cluster = None;
let mut restrictions = None;
let mut fabric_index = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => endpoint = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => cluster = Some(<u32>::from_tlv(reader, &field)?),
Some(2) => {
restrictions = Some(<TlvList<'a, AccessRestrictionStruct>>::from_tlv(
reader, &field,
)?)
}
Some(254) => {
fabric_index = Some(<crate::msg::FabricIndex>::from_tlv(reader, &field)?)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
endpoint: endpoint.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
cluster: cluster.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
restrictions: restrictions.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
fabric_index: fabric_index.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AccessRestrictionStruct {
pub type_: AccessRestrictionTypeEnum,
pub id: Nullable<u32>,
}
impl ToTlv for AccessRestrictionStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.type_.to_tlv(w, Tag::Context(0))?;
self.id.to_tlv(w, Tag::Context(1))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for AccessRestrictionStruct {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut type_ = None;
let mut id = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => type_ = Some(<AccessRestrictionTypeEnum>::from_tlv(reader, &field)?),
Some(1) => id = Some(<Nullable<u32>>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
type_: type_.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
id: id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct CommissioningAccessRestrictionEntryStruct<'a> {
pub endpoint: u16,
pub cluster: u32,
pub restrictions: TlvList<'a, AccessRestrictionStruct>,
}
impl<'a> ToTlv for CommissioningAccessRestrictionEntryStruct<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.endpoint.to_tlv(w, Tag::Context(0))?;
self.cluster.to_tlv(w, Tag::Context(1))?;
self.restrictions.to_tlv(w, Tag::Context(2))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for CommissioningAccessRestrictionEntryStruct<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut endpoint = None;
let mut cluster = None;
let mut restrictions = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => endpoint = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => cluster = Some(<u32>::from_tlv(reader, &field)?),
Some(2) => {
restrictions = Some(<TlvList<'a, AccessRestrictionStruct>>::from_tlv(
reader, &field,
)?)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
endpoint: endpoint.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
cluster: cluster.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
restrictions: restrictions.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ReviewFabricRestrictionsFields<'a> {
pub arl: TlvList<'a, CommissioningAccessRestrictionEntryStruct<'a>>,
}
impl<'a> ToTlv for ReviewFabricRestrictionsFields<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.arl.to_tlv(w, Tag::Context(0))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for ReviewFabricRestrictionsFields<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut arl = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => {
arl = Some(
<TlvList<'a, CommissioningAccessRestrictionEntryStruct<'a>>>::from_tlv(
reader, &field,
)?,
)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
arl: arl.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ReviewFabricRestrictionsResponseFields {
pub token: u64,
}
impl ToTlv for ReviewFabricRestrictionsResponseFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.token.to_tlv(w, Tag::Context(0))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for ReviewFabricRestrictionsResponseFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut token = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => token = Some(<u64>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
token: token.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
pub const ATTRIBUTES: &[Attribute] = &[
Attribute {
id: 0x0000,
name: "ACL",
kind: "list[AccessControlEntryStruct]",
access: Access::read_write_with(Privilege::Administer, Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SCOPED),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform::MANDATORY,
},
Attribute {
id: 0x0001,
name: "Extension",
kind: "list[AccessControlExtensionStruct]",
access: Access::read_write_with(Privilege::Administer, Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SCOPED),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
Attribute {
id: 0x0002,
name: "SubjectsPerAccessControlEntry",
kind: "uint16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform::MANDATORY,
},
Attribute {
id: 0x0003,
name: "TargetsPerAccessControlEntry",
kind: "uint16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform::MANDATORY,
},
Attribute {
id: 0x0004,
name: "AccessControlEntriesPerFabric",
kind: "uint16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform::MANDATORY,
},
Attribute {
id: 0x0005,
name: "CommissioningARL",
kind: "list[CommissioningAccessRestrictionEntryStruct]",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
Attribute {
id: 0x0006,
name: "ARL",
kind: "list[AccessRestrictionEntryStruct]",
access: Access::read_only(Privilege::View).with_qualities(AccessQualities::FABRIC_SCOPED),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
Attribute {
id: 0x0007,
name: "AuxiliaryACL",
kind: "list[AccessControlEntryStruct]",
access: Access::read_only(Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SCOPED),
qualities: AttributeQualities::empty(),
reporting: Reporting::ChangesOmitted,
conform: Conform {
clauses: &[
Clause {
verdict: Conformance::Provisional,
when: Condition::Always,
},
Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(2),
},
],
},
},
];
pub const COMMANDS: &[Command] = &[
Command {
id: 0x00,
name: "ReviewFabricRestrictions",
to_server: true,
response: Some(0x01),
access: Access::invoke(Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SCOPED),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
Command {
id: 0x01,
name: "ReviewFabricRestrictionsResponse",
to_server: false,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
];
pub const EVENTS: &[Event] = &[
Event {
id: 0x00,
name: "AccessControlEntryChanged",
priority: EventPriority::Info,
access: Access::read_only(Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SENSITIVE),
conform: Conform::MANDATORY,
},
Event {
id: 0x01,
name: "AccessControlExtensionChanged",
priority: EventPriority::Info,
access: Access::read_only(Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SENSITIVE),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
Event {
id: 0x02,
name: "FabricRestrictionReviewUpdate",
priority: EventPriority::Info,
access: Access::read_only(Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SENSITIVE),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
Event {
id: 0x03,
name: "AuxiliaryAccessUpdated",
priority: EventPriority::Info,
access: Access::read_only(Privilege::Administer)
.with_qualities(AccessQualities::FABRIC_SENSITIVE),
conform: Conform {
clauses: &[
Clause {
verdict: Conformance::Provisional,
when: Condition::Always,
},
Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(2),
},
],
},
},
];
pub const CLUSTER: Cluster = Cluster {
id: ID,
name: "Access Control",
revision: REVISION,
pics: "ACL",
derived_from: None,
features: FEATURES,
attributes: ATTRIBUTES,
commands: COMMANDS,
events: EVENTS,
};