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