blob: 3e156b692dcc918f9fa04ef696f84b5b7ca18fd0 [file] [log] [blame]
Chip Boling610117d2021-09-09 11:24:34 -05001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
4
5 * 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
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * 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
125func init() {
126 onu3gBME = &ManagedEntityDefinition{
127 Name: "Onu3G",
128 ClassID: 441,
129 MessageTypes: mapset.NewSetWith(
130 Get,
131 ),
132 AllowedAttributeMask: 0xffc0,
133 AttributeDefinitions: AttributeDefinitionMap{
134 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
135 1: ByteField("FlashMemoryPerformanceValue", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), true, true, false, 1),
136 2: ByteField("LatestRestartReason", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
137 3: Uint16Field("TotalNumberOfStatusSnapshots", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), true, false, false, 3),
138 4: Uint16Field("NumberOfValidStatusSnapshots", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
139 5: Uint16Field("NextStatusSnapshotIndex", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
140 6: MultiByteField("StatusSnapshotRecordTable", OctetsAttributeType, 0x0400, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 6),
141 7: ByteField("SnapAction", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Write), false, false, false, 7),
142 8: MultiByteField("MostRecentStatusSnapshot", OctetsAttributeType, 0x0100, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 8),
143 9: ByteField("ResetAction", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Write), false, false, false, 9),
144 10: ByteField("EnhancedMode", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
145 },
146 Access: CreatedByOnu,
147 Support: UnknownSupport,
148 Alarms: AlarmMap{
149 0: "Flash memory performance yellow",
150 1: "Flash memory performance red",
151 2: "Loss of redundant power supply",
152 3: "Loss of redundant power feed",
153 4: "Ground Fault",
154 },
155 }
156}
157
158// NewOnu3G (class ID 441) creates the basic
159// Managed Entity definition that is used to validate an ME of this type that
160// is received from or transmitted to the OMCC.
161func NewOnu3G(params ...ParamData) (*ManagedEntity, OmciErrors) {
162 return NewManagedEntity(*onu3gBME, params...)
163}