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