blob: 0bd413f31998ebdd227eefa621eebb9d63b78156 [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
4
Chip Boling6e27b352020-02-14 09:10:01 -06005 * 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
Andrea Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
Chip Boling6e27b352020-02-14 09:10:01 -060011 * 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 Boling34ebcb62021-02-02 12:13:58 -060017/*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * 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
30const CardholderClassID ClassID = ClassID(5)
31
32var cardholderBME *ManagedEntityDefinition
33
34// Cardholder (class ID #5)
35// 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//
78// Actual Plug In Unit Type
79// Actual plugin unit type: This attribute is equal to the type of the circuit pack in the
80// cardholder, or 0 if the cardholder is empty. When the cardholder is populated, this attribute is
81// the same as the type attribute of the corresponding circuit pack ME. Circuit pack types are
82// defined in Table 9.1.5-1. (R) (mandatory) (1-byte)
83//
84// Expected Plug_In Unit Type
85// Expected plug-in unit type: This attribute provisions the type of circuit pack for the slot. For
86// type coding, see Table 9.1.5-1. The value 0 means that the cardholder is not provisioned to
87// contain a circuit pack. The value 255 means that the cardholder is configured for plug-and-play.
88// Upon ME instantiation, the ONU sets this attribute to 0. For integrated interfaces, this
89// attribute may be used to represent the type of interface. (R,-W) (mandatory) (1-byte)
90//
91// Expected Port Count
92// Expected port count: This attribute permits the OLT to specify the number of ports it expects in
93// a circuit pack. Prior to provisioning by the OLT, the ONU initializes this attribute to 0.
94// (R,-W) (optional) (1-byte)
95//
96// Expected Equipment Id
97// Expected equipment ID: This attribute provisions the specific type of expected circuit pack.
98// This attribute applies only to ONUs that do not have integrated interfaces. In some
99// environments, this may contain the expected CLEI code. Upon ME instantiation, the ONU sets this
100// attribute to all spaces. (R,-W) (optional) (20-bytes)
101//
102// Actual Equipment Id
103// Actual equipment ID: This attribute identifies the specific type of circuit pack, once it is
104// installed. This attribute applies only to ONUs that do not have integrated interfaces. In some
105// environments, this may include the CLEI code. When the slot is empty or the equipment ID is not
106// known, this attribute should be set to all spaces. (R) (optional) (20-bytes)
107//
108// Protection Profile Pointer
109// Protection profile pointer: This attribute specifies an equipment protection profile that may be
110// associated with the cardholder. Its value is the least significant byte of the ME ID of the
111// equipment protection profile with which it is associated, or 0 if equipment protection is not
112// used. (R) (optional) (1-byte)
113//
114// Invoke Protection Switch
115// When circuit packs that support a PON interface (IF) function are switched, the response should
116// be returned on the same PON that received the command. However, the OLT should also be prepared
117// to accept a response on the redundant PON. (R,-W) (optional) (1-byte)
118//
119// Alarm _ Reporting Control
120// Alarm-reporting control (ARC): See clause A.1.4.3. (R,-W) (optional) (1-byte)
121//
122// Arc Interval
123// ARC interval: See clause A.1.4.3. (R,-W) (optional) (1-byte)
124//
125type Cardholder struct {
126 ManagedEntityDefinition
127 Attributes AttributeValueMap
128}
129
130func init() {
131 cardholderBME = &ManagedEntityDefinition{
132 Name: "Cardholder",
133 ClassID: 5,
134 MessageTypes: mapset.NewSetWith(
135 Get,
136 Set,
137 ),
138 AllowedAttributeMask: 0xff80,
139 AttributeDefinitions: AttributeDefinitionMap{
140 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
141 1: ByteField("ActualPlugInUnitType", EnumerationAttributeType, 0x8000, 0, mapset.NewSetWith(Read), true, false, false, 1),
142 2: ByteField("ExpectedPlugInUnitType", EnumerationAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
143 3: ByteField("ExpectedPortCount", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, true, false, 3),
144 4: MultiByteField("ExpectedEquipmentId", StringAttributeType, 0x1000, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read, Write), false, true, false, 4),
145 5: MultiByteField("ActualEquipmentId", StringAttributeType, 0x0800, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read), true, true, false, 5),
146 6: ByteField("ProtectionProfilePointer", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, true, false, 6),
147 7: ByteField("InvokeProtectionSwitch", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, true, false, 7),
148 8: ByteField("AlarmReportingControl", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), true, true, false, 8),
149 9: ByteField("ArcInterval", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, true, false, 9),
150 },
151 Access: CreatedByOnu,
152 Support: UnknownSupport,
Chip Boling34ebcb62021-02-02 12:13:58 -0600153 Alarms: AlarmMap{
154 0: "Plug-in circuit pack missing",
155 1: "Plug-in type mismatch alarm",
156 2: "Improper card removal",
157 3: "Plug-in equipment ID mismatch alarm",
158 4: "Protection switch",
159 },
Chip Boling6e27b352020-02-14 09:10:01 -0600160 }
161}
162
163// NewCardholder (class ID 5) creates the basic
164// Managed Entity definition that is used to validate an ME of this type that
165// is received from or transmitted to the OMCC.
166func NewCardholder(params ...ParamData) (*ManagedEntity, OmciErrors) {
167 return NewManagedEntity(*cardholderBME, params...)
168}