blob: b879ed7ec94751c8b5503ce697713a467c825805 [file] [log] [blame]
Andrea Campanella10426e22021-10-15 17:58:04 +02001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
Andrea Campanella10426e22021-10-15 17:58:04 +02005 * 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
Elia Battiston9bfe1102022-02-03 10:38:03 +01008 *
Andrea Campanella10426e22021-10-15 17:58:04 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
Andrea Campanella10426e22021-10-15 17:58:04 +020011 * 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 */
17/*
18 * 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// Onu3GClassID is the 16-bit ID for the OMCI
29// Managed entity ONU3-G
30const Onu3GClassID = ClassID(441) // 0x01b9
31
32var onu3gBME *ManagedEntityDefinition
33
34// Onu3G (Class ID: #441 / 0x01b9)
35// This ME contains additional attributes and alarms associated with a PON ONU. The ONU
36// automatically creates an instance of this ME. Its attributes are populated according to data
37// within the ONU itself.
38//
39// Upon instantiation of this ME, the Total number of status snapshots S, the Number of valid
40// status snapshots M, and Next status snapshot index K are populated from the non-volatile memory.
41// If the non-volatile memory values are not available (e.g., at the initialization of an off-the-
42// shelf ONU), the Total number of status snapshots attribute is set to the maximum size of the
43// status snapshot record table the ONU can maintain, which is a static capability parameter, while
44// both the Number of valid status snapshots and the Next status snapshot index attributes are set
45// to zero.
46//
47// The Status snapshot record table is implemented as a circular buffer containing up to S records
48// of size N. The size and format of the snapshot record are vendor-specific. Each time the ONU
49// takes and stores a status snapshot, it increments the Number of valid status snapshots M,
50// saturating at S, and increments Next status snapshot index K in modulo S:
51//
52// K := (K-+ 1)mod S.
53//
54// By writing into the Snap action attribute, the OLT instructs the ONU to immediately take a
55// status snapshot and to store it in the Status snapshot table. By writing into Reset action
56// attribute, the OLT instructs the ONU to erase the Status snapshot record table. The OLT uses the
57// AVC indication of the Next status snapshot index and Number of valid status snapshots attributes
58// to confirm that its instructions have been executed by the ONU. If the OLT has issued no Snap
59// action instructions, a change in the value of Next status snapshot index attributes between two
60// consecutive reads indicates that a condition has arisen that has caused the ONU to record a
61// status snapshot.
62//
63// Two table attributes, the Status snapshot record table, and the Most recent status snapshot,
64// provide the OLT access to the status snapshot records. The former allows the entire Status
65// snapshot record table to be retrieved, the latter provides quick access to the latest snapshot
66// record.
67//
68// By performing the Get operation on the Most recent status snapshot, the OLT can obtain the
69// vendor-specific size of an individual snapshot record. The OLT is expected to pass the status
70// snapshot records transparently, without parsing or interpreting them.
71//
72// Relationships
73// This ME is associated with the ONU-G ME.
74//
75// Attributes
76// Managed Entity Id
77// This attribute uniquely identifies each instance of this ME. There is only one instance, number
78// 0. (R) (mandatory) (2-bytes)
79//
80// Flash Memory Performance Value
81// A number in the range from 0 to 100 that characterizes the condition of the flash memory, with 0
82// representing factory fresh device, 100 representing end of life. This attribute is vendor-
83// specific and should be calculated at the discretion of the vendor. (R) (optional) (1-byte)
84//
85// Latest Restart Reason
86// The following code points are defined:
87//
88// Total Number Of Status Snapshots
89// The maximum size S of the status snapshot record table. (R) (mandatory) (2-bytes)
90//
91// Number Of Valid Status Snapshots
92// The number M of valid status snapshot records. (R) (mandatory) (2-bytes)
93//
94// Next Status Snapshot Index
95// This attribute identifies the index (ranging from 0 to S-- 1) of the next snapshot record to be
96// taken in the snapshot record table. (R,) (mandatory) (2-bytes)
97//
98// Status Snapshot Record Table
99// The table of M status snapshot records. The size N and format of the snapshot record is vendor
100// dependent. (R) (mandatory) (MxN-bytes)
101//
102// Snap Action
103// Once the OLT writes this attribute, the ONU takes and records an urgent snapshot without
104// shutting down the transceiver. (W) (mandatory) (1-byte)
105//
106// Most Recent Status Snapshot
107// This attribute provides access to the most recently taken status snapshot record. (R)
108// (mandatory) (N-bytes)
109//
110// Reset Action
111// Once the OLT writes this attribute, the ONU sets the Number of valid status snapshots and Next
112// status snapshot index attributes to zero. (W) (mandatory) (1-byte)
113//
114// Enhanced Mode
115// The Boolean value true specifies the Enhanced received frame classification and processing table
116// is supported by the Extended VLAN tagging operation configuration ME. The value false indicates
117// the Enhanced received frame classification and processing table is not supported. (R) (optional)
118// (1-byte)
119//
120type Onu3G struct {
121 ManagedEntityDefinition
122 Attributes AttributeValueMap
123}
124
Elia Battiston9bfe1102022-02-03 10:38:03 +0100125// Attribute name constants
126
127const Onu3G_FlashMemoryPerformanceValue = "FlashMemoryPerformanceValue"
128const Onu3G_LatestRestartReason = "LatestRestartReason"
129const Onu3G_TotalNumberOfStatusSnapshots = "TotalNumberOfStatusSnapshots"
130const Onu3G_NumberOfValidStatusSnapshots = "NumberOfValidStatusSnapshots"
131const Onu3G_NextStatusSnapshotIndex = "NextStatusSnapshotIndex"
132const Onu3G_StatusSnapshotRecordTable = "StatusSnapshotRecordTable"
133const Onu3G_SnapAction = "SnapAction"
134const Onu3G_MostRecentStatusSnapshot = "MostRecentStatusSnapshot"
135const Onu3G_ResetAction = "ResetAction"
136const Onu3G_EnhancedMode = "EnhancedMode"
137
Andrea Campanella10426e22021-10-15 17:58:04 +0200138func init() {
139 onu3gBME = &ManagedEntityDefinition{
140 Name: "Onu3G",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100141 ClassID: Onu3GClassID,
Andrea Campanella10426e22021-10-15 17:58:04 +0200142 MessageTypes: mapset.NewSetWith(
143 Get,
144 ),
145 AllowedAttributeMask: 0xffc0,
146 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100147 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
148 1: ByteField(Onu3G_FlashMemoryPerformanceValue, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), true, true, false, 1),
149 2: ByteField(Onu3G_LatestRestartReason, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
150 3: Uint16Field(Onu3G_TotalNumberOfStatusSnapshots, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), true, false, false, 3),
151 4: Uint16Field(Onu3G_NumberOfValidStatusSnapshots, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
152 5: Uint16Field(Onu3G_NextStatusSnapshotIndex, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
153 6: MultiByteField(Onu3G_StatusSnapshotRecordTable, OctetsAttributeType, 0x0400, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 6),
154 7: ByteField(Onu3G_SnapAction, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Write), false, false, false, 7),
155 8: MultiByteField(Onu3G_MostRecentStatusSnapshot, OctetsAttributeType, 0x0100, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 8),
156 9: ByteField(Onu3G_ResetAction, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Write), false, false, false, 9),
157 10: ByteField(Onu3G_EnhancedMode, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
Andrea Campanella10426e22021-10-15 17:58:04 +0200158 },
159 Access: CreatedByOnu,
160 Support: UnknownSupport,
161 Alarms: AlarmMap{
162 0: "Flash memory performance yellow",
163 1: "Flash memory performance red",
164 2: "Loss of redundant power supply",
165 3: "Loss of redundant power feed",
166 4: "Ground Fault",
167 },
168 }
169}
170
171// NewOnu3G (class ID 441) creates the basic
172// Managed Entity definition that is used to validate an ME of this type that
173// is received from or transmitted to the OMCC.
174func NewOnu3G(params ...ParamData) (*ManagedEntity, OmciErrors) {
175 return NewManagedEntity(*onu3gBME, params...)
176}