Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * Unless required by applicable law or agreed to in writing, software |
| 9 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | * See the License for the specific language governing permissions and |
| 12 | * limitations under the License. |
| 13 | */ |
| 14 | /* |
| 15 | * NOTE: This file was generated, manual edits will be overwritten! |
| 16 | * |
| 17 | * Generated by 'goCodeGenerator.py': |
| 18 | * https://github.com/cboling/OMCI-parser/README.md |
| 19 | */ |
| 20 | package generated |
| 21 | |
| 22 | import "github.com/deckarep/golang-set" |
| 23 | |
| 24 | const CircuitPackClassId ClassID = ClassID(6) |
| 25 | |
| 26 | var circuitpackBME *ManagedEntityDefinition |
| 27 | |
| 28 | // CircuitPack (class ID #6) |
| 29 | // This ME models a real or virtual circuit pack that is equipped in a real or virtual ONU slot. |
| 30 | // For ONUs with integrated interfaces, this ME may be used to distinguish available types of |
| 31 | // interfaces (the port-mapping package is another way). |
| 32 | // |
| 33 | // For ONUs with integrated interfaces, the ONU automatically creates an instance of this ME for |
| 34 | // each instance of the virtual cardholder ME. The ONU also creates an instance of this ME when the |
| 35 | // OLT provisions the cardholder to expect a circuit pack, i.e., when the OLT sets the expected |
| 36 | // plug-in unit type or equipment ID of the cardholder to a circuit pack type, as defined in Table |
| 37 | // 9.1.5-1. The ONU also creates an instance of this ME when a circuit pack is installed in a |
| 38 | // cardholder whose expected plug-in unit type is 255 = plugandplay, and whose equipment ID is not |
| 39 | // provisioned. Finally, when the cardholder is provisioned for plug-and-play, an instance of this |
| 40 | // ME can be created at the request of the OLT. |
| 41 | // |
| 42 | // The ONU deletes an instance of this ME when the OLT de-provisions the circuit pack (i.e., when |
| 43 | // the OLT sets the expected plug-in unit type or equipment ID of the cardholder to 0 = no LIM). |
| 44 | // The ONU also deletes an instance of this ME on request of the OLT if the expected plug-in unit |
| 45 | // type attribute of the corresponding cardholder is equal to 255, plug-and-play, and the expected |
| 46 | // equipment ID is blank (a string of all spaces). ONUs with integrated interfaces do not delete |
| 47 | // circuit pack instances. |
| 48 | // |
| 49 | // NOTE – Creation and deletion by the OLT is retained for backward compatibility. |
| 50 | // |
| 51 | // Relationships |
| 52 | // An instance of this ME is contained by an instance of the cardholder ME. |
| 53 | // |
| 54 | // Attributes |
| 55 | // Managed Entity Id |
| 56 | // Managed entity ID: This attribute uniquely identifies each instance of this ME. Its value is the |
| 57 | // same as that of the cardholder ME containing this circuit pack instance. (R, setbycreate if |
| 58 | // applicable) (mandatory) (2 bytes) |
| 59 | // |
| 60 | // Type |
| 61 | // Type: This attribute identifies the circuit pack type. This attribute is a code as defined in |
| 62 | // Table 9.1.5-1. The value 255 means unknown or undefined, i.e., the inserted circuit pack is not |
| 63 | // recognized by the ONU or is not mapped to an entry in Table 9.1.5-1. In the latter case, the |
| 64 | // equipment ID attribute may contain inventory information. Upon autonomous ME instantiation, the |
| 65 | // ONU sets this attribute to 0 or to the type of the circuit pack that is physically present. (R, |
| 66 | // setbycreate if applicable) (mandatory) (1 byte) |
| 67 | // |
| 68 | // Number Of Ports |
| 69 | // Number of ports: This attribute is the number of access ports on the circuit pack. If the port- |
| 70 | // mapping package is supported for this circuit pack, this attribute should be set to the total |
| 71 | // number of ports of all types. (R) (optional) (1 byte) |
| 72 | // |
| 73 | // Serial Number |
| 74 | // Serial number: The serial number is expected to be unique for each circuit pack, at least within |
| 75 | // the scope of the given vendor. Note that the serial number may contain the vendor ID or version |
| 76 | // number. For integrated ONUs, this value is identical to the value of the serial number attribute |
| 77 | // of the ONU-G ME. Upon creation in the absence of a physical circuit pack, this attribute |
| 78 | // comprises all spaces. (R) (mandatory) (8 bytes) |
| 79 | // |
| 80 | // Version |
| 81 | // Version: This attribute is a string that identifies the version of the circuit pack as defined |
| 82 | // by the vendor. The value 0 indicates that version information is not available or applicable. |
| 83 | // For integrated ONUs, this value is identical to the value of the version attribute of the ONU-G |
| 84 | // ME. Upon creation in the absence of a physical circuit pack, this attribute comprises all |
| 85 | // spaces. (R) (mandatory) (14 bytes) |
| 86 | // |
| 87 | // Vendor Id |
| 88 | // Vendor ID: This attribute identifies the vendor of the circuit pack. For ONUs with integrated |
| 89 | // interfaces, this value is identical to the value of the vendor ID attribute of the ONU-G ME. |
| 90 | // Upon creation in the absence of a physical circuit pack, this attribute comprises all spaces. |
| 91 | // (R) (optional) (4 bytes) |
| 92 | // |
| 93 | // Administrative State |
| 94 | // Administrative state: This attribute locks (1) and unlocks (0) the functions performed by this |
| 95 | // ME. Administrative state is further described in clause A.1.6. (R, W) (mandatory) (1 byte) |
| 96 | // |
| 97 | // Operational State |
| 98 | // Operational state: This attribute indicates whether the circuit pack is capable of performing |
| 99 | // its function. Valid values are enabled (0), disabled (1) and unknown (2). Pending completion of |
| 100 | // initialization and self-test on an installed circuit pack, the ONU sets this attribute to 2. (R) |
| 101 | // (optional) (1 byte) |
| 102 | // |
| 103 | // Bridged Or Ip Ind |
| 104 | // (R, W) (optional, only applicable for circuit packs with Ethernet interfaces) (1 byte) |
| 105 | // |
| 106 | // Equipment Id |
| 107 | // Equipment ID: This attribute may be used to identify the vendor's specific type of circuit pack. |
| 108 | // In some environments, this attribute may include the CLEI code. Upon ME instantiation, the ONU |
| 109 | // sets this attribute to all spaces or to the equipment ID of the circuit pack that is physically |
| 110 | // present. (R) (optional) (20 bytes) |
| 111 | // |
| 112 | // Card Configuration |
| 113 | // Upon autonomous instantiation, this attribute is set to 0. (R, W, setbycreate if applicable) |
| 114 | // (mandatory for configurable circuit packs) (1 byte) |
| 115 | // |
| 116 | // Total T_Cont Buffer Number |
| 117 | // Total T-CONT buffer number: This attribute reports the total number of T-CONT buffers associated |
| 118 | // with the circuit pack. Upon ME instantiation, the ONU sets this attribute to 0 or to the value |
| 119 | // supported by the physical circuit pack. (R) (mandatory for circuit packs that provide a traffic |
| 120 | // scheduler function) (1 byte) |
| 121 | // |
| 122 | // Total Priority Queue Number |
| 123 | // Total priority queue number: This value reports the total number of priority queues associated |
| 124 | // with the circuit pack. Upon ME instantiation, the ONU sets the attribute to 0 or to the value |
| 125 | // supported by the physical circuit pack. (R) (mandatory for circuit packs that provide a traffic |
| 126 | // scheduler function) (1 byte) |
| 127 | // |
| 128 | // Total Traffic Scheduler Number |
| 129 | // Total traffic scheduler number: This value reports the total number of traffic schedulers |
| 130 | // associated with the circuit pack. The ONU supports null function, strict priority scheduling and |
| 131 | // WRR from the priority control, and guarantee of minimum rate control points of view. If the |
| 132 | // circuit pack has no traffic scheduler, this attribute should be absent or have the value 0. Upon |
| 133 | // ME instantiation, the ONU sets the attribute to 0 or to the value supported by the physical |
| 134 | // circuit pack. (R) (mandatory for circuit packs that provide a traffic scheduler function) |
| 135 | // (1 byte) |
| 136 | // |
| 137 | // Power Shed Override |
| 138 | // Power shed override: This attribute allows ports to be excluded from the power shed control |
| 139 | // defined in clause 9.1.7. It is a bit mask that takes port 1 as the MSB; a bit value of 1 marks |
| 140 | // the corresponding port to override the power shed timer. For hardware that cannot shed power per |
| 141 | // port, this attribute is a slot override rather than a port override, with any non-zero port |
| 142 | // value causing the entire circuit pack to override power shedding. (R, W) (optional) (4 bytes) |
| 143 | // |
| 144 | type CircuitPack struct { |
| 145 | ManagedEntityDefinition |
| 146 | Attributes AttributeValueMap |
| 147 | } |
| 148 | |
| 149 | func init() { |
| 150 | circuitpackBME = &ManagedEntityDefinition{ |
| 151 | Name: "CircuitPack", |
| 152 | ClassID: 6, |
| 153 | MessageTypes: mapset.NewSetWith( |
| 154 | Create, |
| 155 | Get, |
| 156 | Set, |
| 157 | ), |
| 158 | AllowedAttributeMask: 0XFFFC, |
| 159 | AttributeDefinitions: AttributeDefinitionMap{ |
| 160 | 0: Uint16Field("ManagedEntityId", 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, false, 0), |
| 161 | 1: ByteField("Type", 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, false, 1), |
| 162 | 2: ByteField("NumberOfPorts", 0, mapset.NewSetWith(Read), false, false, true, false, 2), |
| 163 | 3: Uint64Field("SerialNumber", 0, mapset.NewSetWith(Read), false, false, false, false, 3), |
| 164 | 4: MultiByteField("Version", 14, nil, mapset.NewSetWith(Read), false, false, false, false, 4), |
| 165 | 5: Uint32Field("VendorId", 0, mapset.NewSetWith(Read), false, false, true, false, 5), |
| 166 | 6: ByteField("AdministrativeState", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 6), |
| 167 | 7: ByteField("OperationalState", 0, mapset.NewSetWith(Read), true, false, true, false, 7), |
| 168 | 8: ByteField("BridgedOrIpInd", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 8), |
| 169 | 9: MultiByteField("EquipmentId", 20, nil, mapset.NewSetWith(Read), false, false, true, false, 9), |
| 170 | 10: ByteField("CardConfiguration", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, false, 10), |
| 171 | 11: ByteField("TotalTContBufferNumber", 0, mapset.NewSetWith(Read), false, false, false, false, 11), |
| 172 | 12: ByteField("TotalPriorityQueueNumber", 0, mapset.NewSetWith(Read), false, false, false, false, 12), |
| 173 | 13: ByteField("TotalTrafficSchedulerNumber", 0, mapset.NewSetWith(Read), false, false, false, false, 13), |
| 174 | 14: Uint32Field("PowerShedOverride", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 14), |
| 175 | }, |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | // NewCircuitPack (class ID 6 creates the basic |
| 180 | // Managed Entity definition that is used to validate an ME of this type that |
| 181 | // is received from the wire, about to be sent on the wire. |
| 182 | func NewCircuitPack(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 183 | return NewManagedEntity(circuitpackBME, params...) |
| 184 | } |