blob: b95692432f3eadd5fca3fdb0a2a77f792c407a0e [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// CardholderClassID is the 16-bit ID for the OMCI
26// Managed entity Cardholder
27const CardholderClassID ClassID = ClassID(5)
28
29var cardholderBME *ManagedEntityDefinition
30
31// Cardholder (class ID #5)
32// The cardholder represents the fixed equipment slot configuration of the ONU. Each cardholder can
33// contain 0 or 1 circuit packs; the circuit pack models equipment information that can change over
34// the lifetime of the ONU, e.g., through replacement.
35//
36// One instance of this ME exists for each physical slot in an ONU that has pluggable circuit
37// packs. One or more instances of this ME may also exist in an integrated ONU, to represent
38// virtual slots. Instances of this ME are created automatically by the ONU, and the status
39// attributes are populated according to data within the ONU itself.
40//
41// Slot 0 is intended to be used only in an integrated ONU. If an integrated ONU is modelled with a
42// universal slot 0, it is recommended that it does not contain additional (non-zero) virtual
43// slots. A cardholder for virtual slot 0 is recommended.
44//
45// There is potential for conflict in the semantics of the expected plug-in unit type, the expected
46// port count and the expected equipment ID, both when the slot is not populated and when a new
47// circuit pack is inserted. The expected plug-in unit type and the plug-in type mismatch alarm are
48// mandatory, although plug-and-play/unknown (circuit pack type 255) may be used as a way to
49// minimize their significance. It is recommended that an ONU deny the provisioning of inconsistent
50// combinations of expected equipment attributes.
51//
52// When a circuit pack is plugged into a cardholder or when a cardholder is pre-provisioned to
53// expect a circuit pack of a given type, it may trigger the ONU to instantiate a number of MEs and
54// update the values of others, depending on the circuit pack type. The ONU may also delete a
55// variety of other MEs when a circuit pack is reprovisioned to not expect a circuit pack or to
56// expect a circuit pack of a different type. These actions are described in the definitions of the
57// various MEs.
58//
59// Expected equipment ID and expected port count are alternate ways to trigger the same
60// preprovisioning effects. These tools may be useful if an ONU is prepared to accept more than one
61// circuit pack of a given type but with different port counts, or if a circuit pack is a hybrid
62// that matches none of the types in Table 9.1.5-1, but whose identification (e.g., part number) is
63// known.
64//
65// Relationships
66// An ONU may contain zero or more instances of the cardholder, each of which may contain an
67// instance of the circuit pack ME. The slot ID, real or virtual, is a fundamental identification
68// mechanism for MEs that bear some relationship to a physical location.
69//
70// Attributes
71// Managed Entity Id
72// NOTE 1 - Some xDSL MEs use the two MSBs of the slot number for other purposes. An ONU that
73// supports these services may have slot limitations or restrictions.
74//
75// Actual Plug In Unit Type
76// Actual plugin unit type: This attribute is equal to the type of the circuit pack in the
77// cardholder, or 0 if the cardholder is empty. When the cardholder is populated, this attribute is
78// the same as the type attribute of the corresponding circuit pack ME. Circuit pack types are
79// defined in Table 9.1.5-1. (R) (mandatory) (1-byte)
80//
81// Expected Plug_In Unit Type
82// Expected plug-in unit type: This attribute provisions the type of circuit pack for the slot. For
83// type coding, see Table 9.1.5-1. The value 0 means that the cardholder is not provisioned to
84// contain a circuit pack. The value 255 means that the cardholder is configured for plug-and-play.
85// Upon ME instantiation, the ONU sets this attribute to 0. For integrated interfaces, this
86// attribute may be used to represent the type of interface. (R,-W) (mandatory) (1-byte)
87//
88// Expected Port Count
89// Expected port count: This attribute permits the OLT to specify the number of ports it expects in
90// a circuit pack. Prior to provisioning by the OLT, the ONU initializes this attribute to 0.
91// (R,-W) (optional) (1-byte)
92//
93// Expected Equipment Id
94// Expected equipment ID: This attribute provisions the specific type of expected circuit pack.
95// This attribute applies only to ONUs that do not have integrated interfaces. In some
96// environments, this may contain the expected CLEI code. Upon ME instantiation, the ONU sets this
97// attribute to all spaces. (R,-W) (optional) (20-bytes)
98//
99// Actual Equipment Id
100// Actual equipment ID: This attribute identifies the specific type of circuit pack, once it is
101// installed. This attribute applies only to ONUs that do not have integrated interfaces. In some
102// environments, this may include the CLEI code. When the slot is empty or the equipment ID is not
103// known, this attribute should be set to all spaces. (R) (optional) (20-bytes)
104//
105// Protection Profile Pointer
106// Protection profile pointer: This attribute specifies an equipment protection profile that may be
107// associated with the cardholder. Its value is the least significant byte of the ME ID of the
108// equipment protection profile with which it is associated, or 0 if equipment protection is not
109// used. (R) (optional) (1-byte)
110//
111// Invoke Protection Switch
112// When circuit packs that support a PON interface (IF) function are switched, the response should
113// be returned on the same PON that received the command. However, the OLT should also be prepared
114// to accept a response on the redundant PON. (R,-W) (optional) (1-byte)
115//
116// Alarm _ Reporting Control
117// Alarm-reporting control (ARC): See clause A.1.4.3. (R,-W) (optional) (1-byte)
118//
119// Arc Interval
120// ARC interval: See clause A.1.4.3. (R,-W) (optional) (1-byte)
121//
122type Cardholder struct {
123 ManagedEntityDefinition
124 Attributes AttributeValueMap
125}
126
127func init() {
128 cardholderBME = &ManagedEntityDefinition{
129 Name: "Cardholder",
130 ClassID: 5,
131 MessageTypes: mapset.NewSetWith(
132 Get,
133 Set,
134 ),
135 AllowedAttributeMask: 0xff80,
136 AttributeDefinitions: AttributeDefinitionMap{
137 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
138 1: ByteField("ActualPlugInUnitType", EnumerationAttributeType, 0x8000, 0, mapset.NewSetWith(Read), true, false, false, 1),
139 2: ByteField("ExpectedPlugInUnitType", EnumerationAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
140 3: ByteField("ExpectedPortCount", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, true, false, 3),
141 4: MultiByteField("ExpectedEquipmentId", StringAttributeType, 0x1000, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read, Write), false, true, false, 4),
142 5: MultiByteField("ActualEquipmentId", StringAttributeType, 0x0800, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read), true, true, false, 5),
143 6: ByteField("ProtectionProfilePointer", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, true, false, 6),
144 7: ByteField("InvokeProtectionSwitch", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, true, false, 7),
145 8: ByteField("AlarmReportingControl", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), true, true, false, 8),
146 9: ByteField("ArcInterval", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, true, false, 9),
147 },
148 Access: CreatedByOnu,
149 Support: UnknownSupport,
150 }
151}
152
153// NewCardholder (class ID 5) creates the basic
154// Managed Entity definition that is used to validate an ME of this type that
155// is received from or transmitted to the OMCC.
156func NewCardholder(params ...ParamData) (*ManagedEntity, OmciErrors) {
157 return NewManagedEntity(*cardholderBME, params...)
158}