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 | */ |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [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 | // CircuitPackClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Circuit pack |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const CircuitPackClassID = ClassID(6) // 0x0006 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var circuitpackBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // CircuitPack (Class ID: #6 / 0x0006) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME models a real or virtual circuit pack that is equipped in a real or virtual ONU slot. |
| 36 | // For ONUs with integrated interfaces, this ME may be used to distinguish available types of |
| 37 | // interfaces (the port-mapping package is another way). |
| 38 | // |
| 39 | // For ONUs with integrated interfaces, the ONU automatically creates an instance of this ME for |
| 40 | // each instance of the virtual cardholder ME. The ONU also creates an instance of this ME when the |
| 41 | // OLT provisions the cardholder to expect a circuit pack, i.e., when the OLT sets the expected |
| 42 | // plug-in unit type or equipment ID of the cardholder to a circuit pack type, as defined in Table |
| 43 | // 9.1.5-1. The ONU also creates an instance of this ME when a circuit pack is installed in a |
| 44 | // cardholder whose expected plug-in unit type is 255-= plugandplay, and whose equipment ID is not |
| 45 | // provisioned. Finally, when the cardholder is provisioned for plug-and-play, an instance of this |
| 46 | // ME can be created at the request of the OLT. |
| 47 | // |
| 48 | // The ONU deletes an instance of this ME when the OLT de-provisions the circuit pack (i.e., when |
| 49 | // the OLT sets the expected plug-in unit type or equipment ID of the cardholder to 0-= no LIM). |
| 50 | // The ONU also deletes an instance of this ME on request of the OLT if the expected plug-in unit |
| 51 | // type attribute of the corresponding cardholder is equal to 255, plug-and-play, and the expected |
| 52 | // equipment ID is blank (a string of all spaces). ONUs with integrated interfaces do not delete |
| 53 | // circuit pack instances. |
| 54 | // |
| 55 | // NOTE - Creation and deletion by the OLT is retained for backward compatibility. |
| 56 | // |
| 57 | // Relationships |
| 58 | // An instance of this ME is contained by an instance of the cardholder ME. |
| 59 | // |
| 60 | // Attributes |
| 61 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 62 | // This attribute uniquely identifies each instance of this ME. Its value is the same as that of |
| 63 | // the cardholder ME containing this circuit pack instance. (R, setbycreate if applicable) |
| 64 | // (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 65 | // |
| 66 | // Type |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 67 | // This attribute identifies the circuit pack type. This attribute is a code as defined in Table |
| 68 | // 9.1.5-1. The value 255 means unknown or undefined, i.e., the inserted circuit pack is not |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 69 | // recognized by the ONU or is not mapped to an entry in Table 9.1.5-1. In the latter case, the |
| 70 | // equipment ID attribute may contain inventory information. Upon autonomous ME instantiation, the |
| 71 | // ONU sets this attribute to 0 or to the type of the circuit pack that is physically present. (R, |
| 72 | // setbycreate if applicable) (mandatory) (1-byte) |
| 73 | // |
| 74 | // Number Of Ports |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 75 | // This attribute is the number of access ports on the circuit pack. If the port-mapping package is |
| 76 | // supported for this circuit pack, this attribute should be set to the total number of ports of |
| 77 | // all types. (R) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 78 | // |
| 79 | // Serial Number |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 80 | // The serial number is expected to be unique for each circuit pack, at least within the scope of |
| 81 | // the given vendor. Note that the serial number may contain the vendor ID or version number. For |
| 82 | // integrated ONUs, this value is identical to the value of the serial number attribute of the |
| 83 | // ONU-G ME. Upon creation in the absence of a physical circuit pack, this attribute comprises all |
| 84 | // spaces. (R) (mandatory) (8-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 85 | // |
| 86 | // Version |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 87 | // This attribute is a string that identifies the version of the circuit pack as defined by the |
| 88 | // vendor. The value 0 indicates that version information is not available or applicable. For |
| 89 | // integrated ONUs, this value is identical to the value of the version attribute of the ONU-G ME. |
| 90 | // Upon creation in the absence of a physical circuit pack, this attribute comprises all spaces. |
| 91 | // (R) (mandatory) (14-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 92 | // |
| 93 | // Vendor Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 94 | // This attribute identifies the vendor of the circuit pack. For ONUs with integrated interfaces, |
| 95 | // this value is identical to the value of the vendor ID attribute of the ONU-G ME. Upon creation |
| 96 | // in the absence of a physical circuit pack, this attribute comprises all spaces. (R) (optional) |
| 97 | // (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 98 | // |
| 99 | // Administrative State |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 100 | // This attribute locks (1) and unlocks (0) the functions performed by this ME. Administrative |
| 101 | // state is further described in clause A.1.6. (R,-W) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 102 | // |
| 103 | // Operational State |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 104 | // This attribute indicates whether the circuit pack is capable of performing its function. Valid |
| 105 | // values are enabled (0), disabled (1) and unknown (2). Pending completion of initialization and |
| 106 | // self-test on an installed circuit pack, the ONU sets this attribute to 2. (R) (optional) |
| 107 | // (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 108 | // |
| 109 | // Bridged Or Ip Ind |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 110 | // This attribute specifies whether an Ethernet interface is bridged or derived from an IP router |
| 111 | // function. |
| 112 | // |
| 113 | // 0 Bridged |
| 114 | // |
| 115 | // 1 IP router |
| 116 | // |
| 117 | // 2 Both bridged and IP router functions |
| 118 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 119 | // (R,-W) (optional, only applicable for circuit packs with Ethernet interfaces) (1-byte) |
| 120 | // |
| 121 | // Equipment Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 122 | // This attribute may be used to identify the vendor's specific type of circuit pack. In some |
| 123 | // environments, this attribute may include the CLEI code. Upon ME instantiation, the ONU sets this |
| 124 | // attribute to all spaces or to the equipment ID of the circuit pack that is physically present. |
| 125 | // (R) (optional) (20-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 126 | // |
| 127 | // Card Configuration |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 128 | // This attribute selects the appropriate configuration of configurable circuit packs. Table |
| 129 | // 9.1.5-1 specifies two configurable card types: C-DS1/E1 (code 16), and C-DS1/E1/J1 (code 17). |
| 130 | // Values are indicated below for the allowed card types and configurations. |
| 131 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 132 | // Upon autonomous instantiation, this attribute is set to 0. (R,-W, setbycreate if applicable) |
| 133 | // (mandatory for configurable circuit packs) (1-byte) |
| 134 | // |
| 135 | // Total T_Cont Buffer Number |
| 136 | // Total T-CONT buffer number: This attribute reports the total number of T-CONT buffers associated |
| 137 | // with the circuit pack. Upon ME instantiation, the ONU sets this attribute to 0 or to the value |
| 138 | // supported by the physical circuit pack. (R) (mandatory for circuit packs that provide a traffic |
| 139 | // scheduler function) (1-byte) |
| 140 | // |
| 141 | // Total Priority Queue Number |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 142 | // This value reports the total number of priority queues associated with the circuit pack. Upon ME |
| 143 | // instantiation, the ONU sets the attribute to 0 or to the value supported by the physical circuit |
| 144 | // pack. (R) (mandatory for circuit packs that provide a traffic scheduler function) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 145 | // |
| 146 | // Total Traffic Scheduler Number |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 147 | // This value reports the total number of traffic schedulers associated with the circuit pack. The |
| 148 | // ONU supports null function, strict priority scheduling and WRR from the priority control, and |
| 149 | // guarantee of minimum rate control points of view. If the circuit pack has no traffic scheduler, |
| 150 | // this attribute should be absent or have the value 0. Upon ME instantiation, the ONU sets the |
| 151 | // attribute to 0 or to the value supported by the physical circuit pack. (R) (mandatory for |
| 152 | // circuit packs that provide a traffic scheduler function) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 153 | // |
| 154 | // Power Shed Override |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 155 | // This attribute allows ports to be excluded from the power shed control defined in clause 9.1.7. |
| 156 | // It is a bit mask that takes port 1 as the MSB; a bit value of 1 marks the corresponding port to |
| 157 | // override the power shed timer. For hardware that cannot shed power per port, this attribute is a |
| 158 | // slot override rather than a port override, with any non-zero port value causing the entire |
| 159 | // circuit pack to override power shedding. (R,-W) (optional) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 160 | // |
| 161 | type CircuitPack struct { |
| 162 | ManagedEntityDefinition |
| 163 | Attributes AttributeValueMap |
| 164 | } |
| 165 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 166 | // Attribute name constants |
| 167 | |
| 168 | const CircuitPack_Type = "Type" |
| 169 | const CircuitPack_NumberOfPorts = "NumberOfPorts" |
| 170 | const CircuitPack_SerialNumber = "SerialNumber" |
| 171 | const CircuitPack_Version = "Version" |
| 172 | const CircuitPack_VendorId = "VendorId" |
| 173 | const CircuitPack_AdministrativeState = "AdministrativeState" |
| 174 | const CircuitPack_OperationalState = "OperationalState" |
| 175 | const CircuitPack_BridgedOrIpInd = "BridgedOrIpInd" |
| 176 | const CircuitPack_EquipmentId = "EquipmentId" |
| 177 | const CircuitPack_CardConfiguration = "CardConfiguration" |
| 178 | const CircuitPack_TotalTContBufferNumber = "TotalTContBufferNumber" |
| 179 | const CircuitPack_TotalPriorityQueueNumber = "TotalPriorityQueueNumber" |
| 180 | const CircuitPack_TotalTrafficSchedulerNumber = "TotalTrafficSchedulerNumber" |
| 181 | const CircuitPack_PowerShedOverride = "PowerShedOverride" |
| 182 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 183 | func init() { |
| 184 | circuitpackBME = &ManagedEntityDefinition{ |
| 185 | Name: "CircuitPack", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 186 | ClassID: CircuitPackClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 187 | MessageTypes: mapset.NewSetWith( |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 188 | Get, |
| 189 | Set, |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 190 | Create, |
| 191 | Delete, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 192 | ), |
| 193 | AllowedAttributeMask: 0xfffc, |
| 194 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 195 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 196 | 1: ByteField(CircuitPack_Type, EnumerationAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 1), |
| 197 | 2: ByteField(CircuitPack_NumberOfPorts, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, true, false, 2), |
| 198 | 3: MultiByteField(CircuitPack_SerialNumber, OctetsAttributeType, 0x2000, 8, toOctets("ICAgICAgICA="), mapset.NewSetWith(Read), false, false, false, 3), |
| 199 | 4: MultiByteField(CircuitPack_Version, OctetsAttributeType, 0x1000, 14, toOctets("ICAgICAgICAgICAgICA="), mapset.NewSetWith(Read), false, false, false, 4), |
| 200 | 5: MultiByteField(CircuitPack_VendorId, StringAttributeType, 0x0800, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read), false, true, false, 5), |
| 201 | 6: ByteField(CircuitPack_AdministrativeState, EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6), |
| 202 | 7: ByteField(CircuitPack_OperationalState, EnumerationAttributeType, 0x0200, 2, mapset.NewSetWith(Read), true, true, false, 7), |
| 203 | 8: ByteField(CircuitPack_BridgedOrIpInd, EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8), |
| 204 | 9: MultiByteField(CircuitPack_EquipmentId, StringAttributeType, 0x0080, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read), false, true, false, 9), |
| 205 | 10: ByteField(CircuitPack_CardConfiguration, EnumerationAttributeType, 0x0040, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 10), |
| 206 | 11: ByteField(CircuitPack_TotalTContBufferNumber, UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, false, false, 11), |
| 207 | 12: ByteField(CircuitPack_TotalPriorityQueueNumber, UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read), false, false, false, 12), |
| 208 | 13: ByteField(CircuitPack_TotalTrafficSchedulerNumber, UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, false, false, 13), |
| 209 | 14: Uint32Field(CircuitPack_PowerShedOverride, BitFieldAttributeType, 0x0004, 0, mapset.NewSetWith(Read, Write), false, true, false, 14), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 210 | }, |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 211 | Access: CreatedByOnu, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 212 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 213 | Alarms: AlarmMap{ |
| 214 | 0: "Equipment alarm", |
| 215 | 1: "Powering alarm", |
| 216 | 2: "Self-test failure", |
| 217 | 3: "Laser end of life", |
| 218 | 4: "Temperature yellow", |
| 219 | 5: "Temperature red", |
| 220 | }, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 221 | } |
| 222 | } |
| 223 | |
| 224 | // NewCircuitPack (class ID 6) creates the basic |
| 225 | // Managed Entity definition that is used to validate an ME of this type that |
| 226 | // is received from or transmitted to the OMCC. |
| 227 | func NewCircuitPack(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 228 | return NewManagedEntity(*circuitpackBME, params...) |
| 229 | } |