blob: 04bdca017cffc9bdffebb5c5443823c24178171d [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
4
Chip Boling6e27b352020-02-14 09:10:01 -06005 * 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
Andrea Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
Chip Boling6e27b352020-02-14 09:10:01 -060011 * 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 */
David K. Bainbridgeadf422d2021-04-09 16:06:41 +000017/*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * 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
Chip Boling610117d2021-09-09 11:24:34 -050030const OnuGClassID = ClassID(256) // 0x0100
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var onugBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// OnuG (Class ID: #256 / 0x0100)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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
Chip Boling610117d2021-09-09 11:24:34 -050046// This attribute uniquely identifies each instance of this ME. There is only one instance, number
47// 0. (R) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060048//
49// Vendor Id
Chip Boling610117d2021-09-09 11:24:34 -050050// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060053//
54// Version
Chip Boling610117d2021-09-09 11:24:34 -050055// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060057//
58// Serial Number
Chip Boling610117d2021-09-09 11:24:34 -050059// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060063//
64// Traffic Management Option
Chip Boling610117d2021-09-09 11:24:34 -050065// 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//
Chip Boling6e27b352020-02-14 09:10:01 -060082// 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
Chip Boling610117d2021-09-09 11:24:34 -050087// This attribute is not used. If it is present, it should be set to 0. (R) (optional) (1-byte)
Chip Boling6e27b352020-02-14 09:10:01 -060088//
89// Battery Backup
Chip Boling610117d2021-09-09 11:24:34 -050090// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060093//
94// Administrative State
Chip Boling610117d2021-09-09 11:24:34 -050095// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060097//
98// Operational State
Chip Boling610117d2021-09-09 11:24:34 -050099// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600101//
102// Onu Survival Time
Chip Boling610117d2021-09-09 11:24:34 -0500103// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600107//
108// Logical Onu Id
Chip Boling610117d2021-09-09 11:24:34 -0500109// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600113//
114// Logical Password
Chip Boling610117d2021-09-09 11:24:34 -0500115// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600119//
120// Credentials Status
Chip Boling610117d2021-09-09 11:24:34 -0500121// 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//
Chip Boling6e27b352020-02-14 09:10:01 -0600137// Other values are reserved.
138//
139// Extended Tc_Layer Options
Chip Boling610117d2021-09-09 11:24:34 -0500140// 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//
Chip Boling6e27b352020-02-14 09:10:01 -0600153// (R) (optional) (2-bytes)
154//
155type OnuG struct {
156 ManagedEntityDefinition
157 Attributes AttributeValueMap
158}
159
160func init() {
161 onugBME = &ManagedEntityDefinition{
162 Name: "OnuG",
163 ClassID: 256,
164 MessageTypes: mapset.NewSetWith(
165 Get,
166 Reboot,
167 Set,
168 SynchronizeTime,
169 Test,
170 ),
171 AllowedAttributeMask: 0xfff8,
172 AttributeDefinitions: AttributeDefinitionMap{
173 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
174 1: MultiByteField("VendorId", StringAttributeType, 0x8000, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read), false, false, false, 1),
175 2: MultiByteField("Version", StringAttributeType, 0x4000, 14, toOctets("MAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 2),
176 3: MultiByteField("SerialNumber", OctetsAttributeType, 0x2000, 8, toOctets("AAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 3),
177 4: ByteField("TrafficManagementOption", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
178 5: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, true, true, 5),
179 6: ByteField("BatteryBackup", EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
180 7: ByteField("AdministrativeState", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
181 8: ByteField("OperationalState", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, true, false, 8),
182 9: ByteField("OnuSurvivalTime", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
183 10: MultiByteField("LogicalOnuId", OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), false, true, false, 10),
184 11: MultiByteField("LogicalPassword", OctetsAttributeType, 0x0020, 12, toOctets("AAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), false, true, false, 11),
185 12: ByteField("CredentialsStatus", EnumerationAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
186 13: Uint16Field("ExtendedTcLayerOptions", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
187 },
188 Access: CreatedByOnu,
189 Support: UnknownSupport,
190 }
191}
192
193// NewOnuG (class ID 256) creates the basic
194// Managed Entity definition that is used to validate an ME of this type that
195// is received from or transmitted to the OMCC.
196func NewOnuG(params ...ParamData) (*ManagedEntity, OmciErrors) {
197 return NewManagedEntity(*onugBME, params...)
198}