Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 4 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 8 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 10 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
David K. Bainbridge | adf422d | 2021-04-09 16:06:41 +0000 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 18 | * NOTE: This file was generated, manual edits will be overwritten! |
| 19 | * |
| 20 | * Generated by 'goCodeGenerator.py': |
| 21 | * https://github.com/cboling/OMCI-parser/README.md |
| 22 | */ |
| 23 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // Dot1AgCfmStackClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Dot1ag CFM stack |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const Dot1AgCfmStackClassID = ClassID(305) // 0x0131 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var dot1agcfmstackBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // Dot1AgCfmStack (Class ID: #305 / 0x0131) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME reports the maintenance status of a bridge port at any given time. An ONU that supports |
| 36 | // [IEEE 802.1ag] functionality automatically creates an instance of the dot1ag CFM stack ME for |
| 37 | // each MAC bridge or IEEE 802.1p mapper, depending on its provisioning model. |
| 38 | // |
| 39 | // The dot1ag CFM stack also lists any VLANs and bridge ports against which configuration errors |
| 40 | // are currently identified. The ONU should reject operations that create configuration errors. |
| 41 | // However, these errors can arise because of operations on other MEs that are not necessarily |
| 42 | // possible to detect during CFM configuration. |
| 43 | // |
| 44 | // Relationships |
| 45 | // An ONU that supports [IEEE 802.1ag] creates one instance of this ME for each MAC bridge or IEEE |
| 46 | // 802.1p mapper, depending on its provisioning model. It should not create an instance for an |
| 47 | // IEEE-802.1p mapper that is associated with a MAC bridge. |
| 48 | // |
| 49 | // Attributes |
| 50 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 51 | // This attribute uniquely identifies an instance of this ME. Through an identical ID, this ME is |
| 52 | // implicitly linked to an instance of the MAC bridge service profile ME or an IEEE 802.1p mapper |
| 53 | // ME. It is expected that an ONU will implement CFM on bridges or on IEEE-802.1p mappers, but not |
| 54 | // both. For precision, the reference is disambiguated by the value of the layer 2 type pointer |
| 55 | // attribute. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 56 | // |
| 57 | // Layer 2 Type |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 58 | // This attribute specifies whether the dot1ag CFM stack is associated with a MAC bridge service |
| 59 | // profile (value 0) or an IEEE 802.1p mapper (value 1). (R) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 60 | // |
| 61 | // Mp Status Table |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 62 | // This attribute is a list of entries, each entry reporting one aspect of the maintenance status |
| 63 | // of one port. If a port is associated with more than one CFM maintenance entity, each is |
| 64 | // represented as a separate item in this table attribute; a port that has no current maintenance |
| 65 | // functions is not represented in the table (so the table may be empty). Each entry is defined as |
| 66 | // follows. |
| 67 | // |
| 68 | // Port ID: The ME ID of the MAC bridge port config data whose information is reported in this |
| 69 | // entry. If the layer 2 parent is an IEEE 802.1p mapper, a null pointer. (2-bytes) |
| 70 | // |
| 71 | // Level: The level at which the reported maintenance function exists, 0..7. (1-byte) |
| 72 | // |
| 73 | // Direction: The value 1 (down) or 2 (up). (1-byte) |
| 74 | // |
| 75 | // VLAN ID: If this table entry reports a maintenance function associated with a VLAN, this field |
| 76 | // contains the value of the primary VLAN ID. If no VLAN is associated with this entry, this field |
| 77 | // contains the value 0. (2-bytes) |
| 78 | // |
| 79 | // MD: A pointer to the associated dot1ag maintenance domain ME. If no MD is associated with this |
| 80 | // entry, a null pointer. (2-bytes) |
| 81 | // |
| 82 | // MA: A pointer to the associated dot1ag maintenance association ME. If no MA is associated with |
| 83 | // this entry, a null pointer. (2-bytes) |
| 84 | // |
| 85 | // MEP ID: If this table entry reports an MEP, this field contains the value of its MEP ID (range |
| 86 | // 1..8191). If this table entry reports an MHF, this field contains the value 0. (2-bytes) |
| 87 | // |
| 88 | // MAC address: The MAC address of the MP. (6-bytes) |
| 89 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 90 | // (R) (mandatory) (18N bytes) |
| 91 | // |
| 92 | // Configuration Error List Table |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 93 | // This attribute is based on the [IEEE 802.1ag] configuration error list. It is a list of entries, |
| 94 | // each entry reporting a VLAN and a bridge port against which a configuration error has been |
| 95 | // detected. The table may be empty at any given time. Entries are defined as follows: |
| 96 | // |
| 97 | // VLAN ID: If this table entry reports a maintenance function associated with a VLAN, this field |
| 98 | // contains the value of the VLAN ID in error. If no VLAN is associated with this entry, this field |
| 99 | // contains the value 0. (2-bytes) |
| 100 | // |
| 101 | // Port ID: A pointer to the MAC bridge port config data whose information is reported in this |
| 102 | // entry. If the layer 2 parent is an IEEE 802.1p mapper, a null pointer. (2-bytes) |
| 103 | // |
| 104 | // Detected configuration error: A bit mask with the following meanings. A list entry exists if and |
| 105 | // only if at least one of these bits is set. Definitions appear in clause 22.2.4 of [IEEE |
| 106 | // 802.1ag]: (1-byte) |
| 107 | // |
| 108 | // 0x01 CFM leak. MA x is associated with a specific VID list, one or more of the VIDs in MA x can |
| 109 | // pass through the bridge port, no up MEP is configured for MA x on the bridge port, no down MEP |
| 110 | // is configured on any bridge port for MA x, and another MA y, at a higher MD level than MA x, and |
| 111 | // associated with at least one of the VID(s) also in MA x, does have an MEP configured on the |
| 112 | // bridge port. |
| 113 | // |
| 114 | // 0x02 Conflicting VIDs. MA x is associated with a specific VID list, an up MEP is configured on |
| 115 | // MA x on the bridge port, and another MA y, associated with at least one of the VID(s) also in MA |
| 116 | // x, and at the same MD level as MA x, also has an up MEP configured on some bridge port. |
| 117 | // |
| 118 | // 0x04 Excessive levels. The number of different MD levels at which maintenance domain |
| 119 | // intermediate points (MIPs) are to be created on this port exceeds the bridge's capabilities. |
| 120 | // |
| 121 | // 0x08 Overlapped levels. An MEP is created for one VID at one MD level, but an MEP is also |
| 122 | // configured on another VID at that MD level or higher, exceeding the bridge's capabilities. |
| 123 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 124 | // (R) (mandatory) (5N bytes) |
| 125 | // |
| 126 | type Dot1AgCfmStack struct { |
| 127 | ManagedEntityDefinition |
| 128 | Attributes AttributeValueMap |
| 129 | } |
| 130 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 131 | // Attribute name constants |
| 132 | |
| 133 | const Dot1AgCfmStack_Layer2Type = "Layer2Type" |
| 134 | const Dot1AgCfmStack_MpStatusTable = "MpStatusTable" |
| 135 | const Dot1AgCfmStack_ConfigurationErrorListTable = "ConfigurationErrorListTable" |
| 136 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 137 | func init() { |
| 138 | dot1agcfmstackBME = &ManagedEntityDefinition{ |
| 139 | Name: "Dot1AgCfmStack", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 140 | ClassID: Dot1AgCfmStackClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 141 | MessageTypes: mapset.NewSetWith( |
| 142 | Get, |
| 143 | GetNext, |
| 144 | ), |
| 145 | AllowedAttributeMask: 0xe000, |
| 146 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 147 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 148 | 1: ByteField(Dot1AgCfmStack_Layer2Type, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1), |
| 149 | 2: TableField(Dot1AgCfmStack_MpStatusTable, TableAttributeType, 0x4000, TableInfo{nil, 18}, mapset.NewSetWith(Read), false, false, false, 2), |
| 150 | 3: TableField(Dot1AgCfmStack_ConfigurationErrorListTable, TableAttributeType, 0x2000, TableInfo{nil, 5}, mapset.NewSetWith(Read), true, false, false, 3), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 151 | }, |
| 152 | Access: CreatedByOnu, |
| 153 | Support: UnknownSupport, |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | // NewDot1AgCfmStack (class ID 305) creates the basic |
| 158 | // Managed Entity definition that is used to validate an ME of this type that |
| 159 | // is received from or transmitted to the OMCC. |
| 160 | func NewDot1AgCfmStack(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 161 | return NewManagedEntity(*dot1agcfmstackBME, params...) |
| 162 | } |