blob: 55633f6a770aa97f8da179925c7d6f893892fbae [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// OnuGClassID is the 16-bit ID for the OMCI
29// Managed entity ONU-G
30const OnuGClassID = ClassID(256) // 0x0100
31
32var onugBME *ManagedEntityDefinition
33
34// OnuG (Class ID: #256 / 0x0100)
35// This ME represents the ONU as equipment. The ONU automatically creates an instance of this ME.
36// It assigns values to read-only attributes according to data within the ONU itself.
37//
38// This ME has evolved from the ONT-G of [ITUT G.984.4].
39//
40// Relationships
41// In ITU-T GTC based PON applications, all other MEs in this Recommendation are related directly
42// or indirectly to the ONU-G entity.
43//
44// Attributes
45// Managed Entity Id
46// This attribute uniquely identifies each instance of this ME. There is only one instance, number
47// 0. (R) (mandatory) (2-bytes)
48//
49// Vendor Id
50// This attribute identifies the vendor of the ONU. It is the same as the four most significant
51// bytes of the ONU serial number as specified in the respective transmission convergence (TC)
52// layer specification. (R) (mandatory) (4-bytes)
53//
54// Version
55// This attribute identifies the version of the ONU as defined by the vendor. The character value 0
56// indicates that version information is not available or applicable. (R) (mandatory) (14-bytes)
57//
58// Serial Number
59// The serial number is unique for each ONU. It is defined in the respective TC layer specification
60// and contains the vendor ID and version number. The first four bytes are an ASCII-encoded four-
61// letter vendor ID. The second four bytes are a binary encoded serial number, under the control of
62// the ONU vendor. (R) (mandatory) (8-bytes)
63//
64// Traffic Management Option
65// This attribute identifies the upstream traffic management function implemented in the ONU. There
66// are three options:
67//
68// 0 Priority controlled and flexibly scheduled upstream traffic. The traffic scheduler and
69// priority queue mechanism are used for upstream traffic.
70//
71// 1 Rate controlled upstream traffic. The maximum upstream traffic of each individual connection
72// is guaranteed by shaping.
73//
74// 2 Priority and rate controlled. The traffic scheduler and priority queue mechanism are used for
75// upstream traffic. The maximum upstream traffic of each individual connection is guaranteed by
76// shaping.
77//
78// For a further explanation, see Appendix II.
79//
80// Downstream priority queues are managed via the GEM port network CTP ME.
81//
82// Upon ME instantiation, the ONU sets this attribute to the value that describes its
83// implementation. The OLT must adapt its model to conform to the ONU's selection. (R) (mandatory)
84// (1-byte)
85//
86// Deprecated
87// This attribute is not used. If it is present, it should be set to 0. (R) (optional) (1-byte)
88//
89// Battery Backup
90// This Boolean attribute controls whether the ONU performs backup battery monitoring (assuming it
91// is capable of doing so). False disables battery alarm monitoring; true enables battery alarm
92// monitoring. (R,-W) (mandatory) (1-byte)
93//
94// Administrative State
95// This attribute locks (1) and unlocks (0) the functions performed by the ONU as an entirety.
96// Administrative state is further described in clause A.1.6. (R,-W) (mandatory) (1-byte)
97//
98// Operational State
99// This attribute reports whether the ME is currently capable of performing its function. Valid
100// values are enabled (0) and disabled (1). (R) (optional) (1-byte)
101//
102// Onu Survival Time
103// This attribute indicates the minimum guaranteed time in milliseconds between the loss of
104// external power and the silence of the ONU. This does not include survival time attributable to a
105// backup battery. The value zero implies that the actual time is not known. (R) (optional)
106// (1-byte)
107//
108// Logical Onu Id
109// This attribute provides a way for the ONU to identify itself. It is a text string, null
110// terminated if it is shorter than 24 bytes, with a null default value. The mechanism for creation
111// or modification of this information is beyond the scope of this Recommendation, but might
112// include, for example, a web page displayed to a user. (R) (optional) (24 bytes)
113//
114// Logical Password
115// This attribute provides a way for the ONU to submit authentication credentials. It is a text
116// string, null terminated if it is shorter than 12 bytes, with a null default value. The mechanism
117// for creation or modification of this information is beyond the scope of this Recommendation. (R)
118// (optional) (12-bytes)
119//
120// Credentials Status
121// This attribute permits the OLT to signal to the ONU whether its credentials are valid or not.
122// The behaviour of the ONU is not specified, but might, for example, include displaying an error
123// screen to the user. (R, W) (optional) (1-byte)
124//
125// Values include:
126//
127// 0 Initial state, status indeterminate
128//
129// 1 Successful authentication
130//
131// 2 Logical ONU ID (LOID) error
132//
133// 3 Password error
134//
135// 4 Duplicate LOID
136//
137// Other values are reserved.
138//
139// Extended Tc_Layer Options
140// Extended TC-layer options: This attribute is meaningful in ITU-T G.984 systems only. It is a bit
141// map that defines whether the ONU supports (1) or does not support (0) various optional TC-layer
142// capabilities of [ITU-T G.984.3]. Bits are assigned as follows.
143//
144// Bit Meaning
145//
146// 1 (LSB) Annex C of [ITU-T G.984.3], PON-ID maintenance.
147//
148// 2 Annex D of [ITU-T G.984.3], PLOAM channel enhancements: swift_POPUP and Ranging_adjustment
149// messages.
150//
151// 3..16 Reserved
152//
153// (R) (optional) (2-bytes)
154//
155type OnuG struct {
156 ManagedEntityDefinition
157 Attributes AttributeValueMap
158}
159
Elia Battiston9bfe1102022-02-03 10:38:03 +0100160// Attribute name constants
161
162const OnuG_VendorId = "VendorId"
163const OnuG_Version = "Version"
164const OnuG_SerialNumber = "SerialNumber"
165const OnuG_TrafficManagementOption = "TrafficManagementOption"
166const OnuG_Deprecated = "Deprecated"
167const OnuG_BatteryBackup = "BatteryBackup"
168const OnuG_AdministrativeState = "AdministrativeState"
169const OnuG_OperationalState = "OperationalState"
170const OnuG_OnuSurvivalTime = "OnuSurvivalTime"
171const OnuG_LogicalOnuId = "LogicalOnuId"
172const OnuG_LogicalPassword = "LogicalPassword"
173const OnuG_CredentialsStatus = "CredentialsStatus"
174const OnuG_ExtendedTcLayerOptions = "ExtendedTcLayerOptions"
175
Andrea Campanella10426e22021-10-15 17:58:04 +0200176func init() {
177 onugBME = &ManagedEntityDefinition{
178 Name: "OnuG",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100179 ClassID: OnuGClassID,
Andrea Campanella10426e22021-10-15 17:58:04 +0200180 MessageTypes: mapset.NewSetWith(
181 Get,
182 Reboot,
183 Set,
184 SynchronizeTime,
185 Test,
186 ),
187 AllowedAttributeMask: 0xfff8,
188 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100189 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
190 1: MultiByteField(OnuG_VendorId, StringAttributeType, 0x8000, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read), false, false, false, 1),
191 2: MultiByteField(OnuG_Version, StringAttributeType, 0x4000, 14, toOctets("MAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 2),
192 3: MultiByteField(OnuG_SerialNumber, OctetsAttributeType, 0x2000, 8, toOctets("AAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 3),
193 4: ByteField(OnuG_TrafficManagementOption, EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
194 5: ByteField(OnuG_Deprecated, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, true, true, 5),
195 6: ByteField(OnuG_BatteryBackup, EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
196 7: ByteField(OnuG_AdministrativeState, EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
Holger Hildebrandt73c447b2023-03-16 13:46:44 +0000197 8: ByteField(OnuG_OperationalState, EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read), true, true, false, 8),
Elia Battiston9bfe1102022-02-03 10:38:03 +0100198 9: ByteField(OnuG_OnuSurvivalTime, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
Holger Hildebrandt73c447b2023-03-16 13:46:44 +0000199 10: MultiByteField(OnuG_LogicalOnuId, OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), true, true, false, 10),
200 11: MultiByteField(OnuG_LogicalPassword, OctetsAttributeType, 0x0020, 12, toOctets("AAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), true, true, false, 11),
Elia Battiston9bfe1102022-02-03 10:38:03 +0100201 12: ByteField(OnuG_CredentialsStatus, EnumerationAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
202 13: Uint16Field(OnuG_ExtendedTcLayerOptions, BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
Andrea Campanella10426e22021-10-15 17:58:04 +0200203 },
204 Access: CreatedByOnu,
205 Support: UnknownSupport,
Holger Hildebrandt73c447b2023-03-16 13:46:44 +0000206 Alarms: AlarmMap{
207 0: "Equipment alarm",
208 1: "Powering alarm",
209 2: "Battery missing",
210 3: "Battery failure",
211 4: "Battery low",
212 5: "Physical intrusion",
213 6: "ONU self-test failure",
214 7: "Dying gasp",
215 8: "Temperature yellow",
216 9: "Temperature red",
217 10: "Voltage yellow",
218 11: "Voltage red",
219 12: "ONU manual power off",
220 13: "Inv-Image",
221 14: "PSE overload yellow",
222 15: "PSE overload red",
223 },
Andrea Campanella10426e22021-10-15 17:58:04 +0200224 }
225}
226
227// NewOnuG (class ID 256) creates the basic
228// Managed Entity definition that is used to validate an ME of this type that
229// is received from or transmitted to the OMCC.
230func NewOnuG(params ...ParamData) (*ManagedEntity, OmciErrors) {
231 return NewManagedEntity(*onugBME, params...)
232}