blob: 0434f5e189c76dd186efd5d334991e3dae64ccf4 [file] [log] [blame]
Holger Hildebrandtfa074992020-03-27 15:42:06 +00001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00005 * 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
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +000011 * 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 */
Himani Chawlaac1f5ad2021-02-04 21:21:54 +053017/*
Holger Hildebrandtfa074992020-03-27 15:42:06 +000018 * 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
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// CardholderClassID is the 16-bit ID for the OMCI
29// Managed entity Cardholder
mpagenko836a1fd2021-11-01 16:12:42 +000030const CardholderClassID = ClassID(5) // 0x0005
Holger Hildebrandtfa074992020-03-27 15:42:06 +000031
32var cardholderBME *ManagedEntityDefinition
33
mpagenko836a1fd2021-11-01 16:12:42 +000034// Cardholder (Class ID: #5 / 0x0005)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000035// The cardholder represents the fixed equipment slot configuration of the ONU. Each cardholder can
36// contain 0 or 1 circuit packs; the circuit pack models equipment information that can change over
37// the lifetime of the ONU, e.g., through replacement.
38//
39// One instance of this ME exists for each physical slot in an ONU that has pluggable circuit
40// packs. One or more instances of this ME may also exist in an integrated ONU, to represent
41// virtual slots. Instances of this ME are created automatically by the ONU, and the status
42// attributes are populated according to data within the ONU itself.
43//
44// Slot 0 is intended to be used only in an integrated ONU. If an integrated ONU is modelled with a
45// universal slot 0, it is recommended that it does not contain additional (non-zero) virtual
46// slots. A cardholder for virtual slot 0 is recommended.
47//
48// There is potential for conflict in the semantics of the expected plug-in unit type, the expected
49// port count and the expected equipment ID, both when the slot is not populated and when a new
50// circuit pack is inserted. The expected plug-in unit type and the plug-in type mismatch alarm are
51// mandatory, although plug-and-play/unknown (circuit pack type 255) may be used as a way to
52// minimize their significance. It is recommended that an ONU deny the provisioning of inconsistent
53// combinations of expected equipment attributes.
54//
55// When a circuit pack is plugged into a cardholder or when a cardholder is pre-provisioned to
56// expect a circuit pack of a given type, it may trigger the ONU to instantiate a number of MEs and
57// update the values of others, depending on the circuit pack type. The ONU may also delete a
58// variety of other MEs when a circuit pack is reprovisioned to not expect a circuit pack or to
59// expect a circuit pack of a different type. These actions are described in the definitions of the
60// various MEs.
61//
62// Expected equipment ID and expected port count are alternate ways to trigger the same
63// preprovisioning effects. These tools may be useful if an ONU is prepared to accept more than one
64// circuit pack of a given type but with different port counts, or if a circuit pack is a hybrid
65// that matches none of the types in Table 9.1.5-1, but whose identification (e.g., part number) is
66// known.
67//
68// Relationships
69// An ONU may contain zero or more instances of the cardholder, each of which may contain an
70// instance of the circuit pack ME. The slot ID, real or virtual, is a fundamental identification
71// mechanism for MEs that bear some relationship to a physical location.
72//
73// Attributes
74// Managed Entity Id
75// NOTE 1 - Some xDSL MEs use the two MSBs of the slot number for other purposes. An ONU that
76// supports these services may have slot limitations or restrictions.
77//
mpagenko836a1fd2021-11-01 16:12:42 +000078// This attribute uniquely identifies each instance of this ME. The ONU sets the first byte of this
79// 2-byte identifier to:
80//
81// 0 if the ONU contains pluggable equipment modules
82//
83// 1 if the ONU is a single piece of integrated equipment.
84//
85// The second byte of this identifier is the slot number. In integrated ONUs, this byte may be used
86// as a virtual slot or set to 0 to indicate a universal pseudoslot.
87//
88// Slot numbering schemes differ among vendors. It is only required that slot numbers be unique
89// across the ONU. Up to 254 equipment slots are supported in the range 1..254 (Note 1). The value
90// 0 is reserved for possible use in an integrated ONU to indicate a universal pseudo-slot. The
91// value 255 is also reserved. (R) (mandatory) (2-bytes)
92//
Holger Hildebrandtfa074992020-03-27 15:42:06 +000093// Actual Plug In Unit Type
94// Actual plugin unit type: This attribute is equal to the type of the circuit pack in the
95// cardholder, or 0 if the cardholder is empty. When the cardholder is populated, this attribute is
96// the same as the type attribute of the corresponding circuit pack ME. Circuit pack types are
97// defined in Table 9.1.5-1. (R) (mandatory) (1-byte)
98//
mpagenko836a1fd2021-11-01 16:12:42 +000099// The three following attributes permit the OLT to specify its intentions for any future equipped
100// configuration of a slot. Once some or all of these are set, the ONU can proceed to instantiate
101// circuit pack and PPTP MEs, along with other predeterminable MEs, and allow the OLT to create
102// related discretionary MEs, thereby supporting service pre-provisioning.
103//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000104// Expected Plug_In Unit Type
105// Expected plug-in unit type: This attribute provisions the type of circuit pack for the slot. For
106// type coding, see Table 9.1.5-1. The value 0 means that the cardholder is not provisioned to
107// contain a circuit pack. The value 255 means that the cardholder is configured for plug-and-play.
108// Upon ME instantiation, the ONU sets this attribute to 0. For integrated interfaces, this
109// attribute may be used to represent the type of interface. (R,-W) (mandatory) (1-byte)
110//
111// Expected Port Count
mpagenko836a1fd2021-11-01 16:12:42 +0000112// This attribute permits the OLT to specify the number of ports it expects in a circuit pack.
113// Prior to provisioning by the OLT, the ONU initializes this attribute to 0. (R,-W) (optional)
114// (1-byte)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000115//
116// Expected Equipment Id
mpagenko836a1fd2021-11-01 16:12:42 +0000117// This attribute provisions the specific type of expected circuit pack. This attribute applies
118// only to ONUs that do not have integrated interfaces. In some environments, this may contain the
119// expected CLEI code. Upon ME instantiation, the ONU sets this attribute to all spaces. (R,-W)
120// (optional) (20-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000121//
122// Actual Equipment Id
mpagenko836a1fd2021-11-01 16:12:42 +0000123// This attribute identifies the specific type of circuit pack, once it is installed. This
124// attribute applies only to ONUs that do not have integrated interfaces. In some environments,
125// this may include the CLEI code. When the slot is empty or the equipment ID is not known, this
126// attribute should be set to all spaces. (R) (optional) (20-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000127//
128// Protection Profile Pointer
mpagenko836a1fd2021-11-01 16:12:42 +0000129// This attribute specifies an equipment protection profile that may be associated with the
130// cardholder. Its value is the least significant byte of the ME ID of the equipment protection
131// profile with which it is associated, or 0 if equipment protection is not used. (R) (optional)
132// (1-byte)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000133//
134// Invoke Protection Switch
mpagenko836a1fd2021-11-01 16:12:42 +0000135// The OLT may use this attribute to control equipment protection switching. Code points have the
136// following meaning when set by the OLT:
137//
138// 0 Release protection switch
139//
140// 1 Operate protection switch, protect cardholder unspecified
141//
142// 2 Operate protection switch, use first protect cardholder
143//
144// 3 Operate protection switch, use second protect cardholder
145//
146// The ONU should deny attempts to switch to an unequipped, defective or already active protection
147// cardholder.
148//
149// Upon the get action from the OLT, this attribute should return the current value of the actual
150// protection configuration. Code points are as defined above; the value 1 is never returned.
151//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000152// When circuit packs that support a PON interface (IF) function are switched, the response should
153// be returned on the same PON that received the command. However, the OLT should also be prepared
154// to accept a response on the redundant PON. (R,-W) (optional) (1-byte)
155//
156// Alarm _ Reporting Control
157// Alarm-reporting control (ARC): See clause A.1.4.3. (R,-W) (optional) (1-byte)
158//
159// Arc Interval
mpagenko836a1fd2021-11-01 16:12:42 +0000160// See clause A.1.4.3. (R,-W) (optional) (1-byte)
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000161//
162type Cardholder struct {
163 ManagedEntityDefinition
164 Attributes AttributeValueMap
165}
166
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000167// Attribute name constants
168
169const Cardholder_ActualPlugInUnitType = "ActualPlugInUnitType"
170const Cardholder_ExpectedPlugInUnitType = "ExpectedPlugInUnitType"
171const Cardholder_ExpectedPortCount = "ExpectedPortCount"
172const Cardholder_ExpectedEquipmentId = "ExpectedEquipmentId"
173const Cardholder_ActualEquipmentId = "ActualEquipmentId"
174const Cardholder_ProtectionProfilePointer = "ProtectionProfilePointer"
175const Cardholder_InvokeProtectionSwitch = "InvokeProtectionSwitch"
176const Cardholder_AlarmReportingControl = "AlarmReportingControl"
177const Cardholder_ArcInterval = "ArcInterval"
178
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000179func init() {
180 cardholderBME = &ManagedEntityDefinition{
181 Name: "Cardholder",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000182 ClassID: CardholderClassID,
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000183 MessageTypes: mapset.NewSetWith(
184 Get,
185 Set,
186 ),
187 AllowedAttributeMask: 0xff80,
188 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000189 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
190 1: ByteField(Cardholder_ActualPlugInUnitType, EnumerationAttributeType, 0x8000, 0, mapset.NewSetWith(Read), true, false, false, 1),
191 2: ByteField(Cardholder_ExpectedPlugInUnitType, EnumerationAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
192 3: ByteField(Cardholder_ExpectedPortCount, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, true, false, 3),
193 4: MultiByteField(Cardholder_ExpectedEquipmentId, StringAttributeType, 0x1000, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read, Write), false, true, false, 4),
194 5: MultiByteField(Cardholder_ActualEquipmentId, StringAttributeType, 0x0800, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read), true, true, false, 5),
195 6: ByteField(Cardholder_ProtectionProfilePointer, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, true, false, 6),
196 7: ByteField(Cardholder_InvokeProtectionSwitch, EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, true, false, 7),
197 8: ByteField(Cardholder_AlarmReportingControl, EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), true, true, false, 8),
198 9: ByteField(Cardholder_ArcInterval, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, true, false, 9),
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000199 },
200 Access: CreatedByOnu,
201 Support: UnknownSupport,
Himani Chawlaac1f5ad2021-02-04 21:21:54 +0530202 Alarms: AlarmMap{
203 0: "Plug-in circuit pack missing",
204 1: "Plug-in type mismatch alarm",
205 2: "Improper card removal",
206 3: "Plug-in equipment ID mismatch alarm",
207 4: "Protection switch",
208 },
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000209 }
210}
211
212// NewCardholder (class ID 5) creates the basic
213// Managed Entity definition that is used to validate an ME of this type that
214// is received from or transmitted to the OMCC.
215func NewCardholder(params ...ParamData) (*ManagedEntity, OmciErrors) {
216 return NewManagedEntity(*cardholderBME, params...)
217}