blob: 54c7905eaf72e6a10b38f9dc2c0e53699424c07f [file] [log] [blame]
mpagenko836a1fd2021-11-01 16:12:42 +00001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
mpagenko836a1fd2021-11-01 16:12:42 +00005 * 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
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
mpagenko836a1fd2021-11-01 16:12:42 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
mpagenko836a1fd2021-11-01 16:12:42 +000011 * 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// Onu2GClassID is the 16-bit ID for the OMCI
29// Managed entity ONU2-G
30const Onu2GClassID = ClassID(257) // 0x0101
31
32var onu2gBME *ManagedEntityDefinition
33
34// Onu2G (Class ID: #257 / 0x0101)
35// This ME contains additional attributes associated with a PON ONU. The ONU automatically creates
36// an instance of this ME. Its attributes are populated according to data within the ONU itself.
37//
38// This ME is the same as the ONT2-G of [ITUT G.984.4], with extensions.
39//
40// Relationships
41// This ME is paired with the ONU-G entity.
42//
43// Attributes
44// Managed Entity Id
45// This attribute uniquely identifies each instance of this ME. There is only one instance, number
46// 0. (R) (mandatory) (2-bytes)
47//
48// Equipment Id
49// This attribute may be used to identify the specific type of ONU. In some environments, this
50// attribute may include the common language equipment identification (CLEI) code. (R) (optional)
51// (20-bytes)
52//
53// Optical Network Unit Management And Control Channel Omcc Version
54// 0xA3 ITU-T G.988 (2012). Baseline message set only
55//
56// 0xB0 ITU-T G.988 (2010). Baseline and extended message set
57//
58// 0xB1 ITU-T G.988 Amd.1 (2011). Baseline and extended message set
59//
60// 0xB2 ITU-T G.988 Amd.2 (2012). Baseline and extended message set
61//
62// 0xB3 ITU-T G.988 (2012). Baseline and extended message set
63//
64// 0xB4 ITU-T G.988 Amd1 (2014) Baseline and extended message set
65//
66// 0xB5 Do not use
67//
68// (R) (mandatory) (1-byte)
69//
70// Optical network unit management and control channel (OMCC) version: This attribute identifies
71// the version of the OMCC protocol being used by the ONU. This allows the OLT to manage a network
72// with ONUs that support different OMCC versions. Release levels of [ITUT G.984.4] are supported
73// with code points of the form 0x8y and 0x9y, where y is a hexadecimal digit in the range 0..F.
74// Support for continuing revisions of this Recommendation is defined in the 0xAy and OxBy range.
75//
76// NOTE 1 - The complete list of managed entities supported by an ONU cannot be derived from the
77// OMCC version attribute. Refer to other ITUT-G.988 OMCI mechanisms for deriving this information
78// (clause I.1.1.1 which describes the use of clauses 9.12.9 Managed entity and 9.12.10 Attribute
79// ME for retrieval of ITU-T G.988 supported ME, and clause I.1.2 for discovering the ONU hardware
80// and service configuration of the ONU through MIB uploads.)
81//
82// NOTE 2 - 0xBz values greater than B5 are reserved to report new ITUT-G.988 Annex A message
83// versions (relative to ITU-T G.988 (2014) Amd1).
84//
85// 0x80 ITU-T G.984.4 (06/04)
86//
87// NOTE - For historical reasons, this code point may also appear in ONUs that support later
88// versions of [ITU-T G.984.4].
89//
90// 0x81 ITU-T G.984.4 2004 Amd.1 (06/05)
91//
92// 0x82 ITU-T G.984.4 2004 Amd.2 (03/06)
93//
94// 0x83 ITU-T G.984.4 2004 Amd.3 (12/06)
95//
96// 0x84 ITU-T G.984.4 2008 (02/08)
97//
98// 0x85 ITU-T G.984.4 2008 Amd.1 (06/09)
99//
100// 0x86 ITU-T G.984.4 2008 Amd.2 (2009). Baseline message set only, without the extended message
101// set option
102//
103// 0x96 ITU-T G.984.4 2008 Amd.2 (2009). Extended message set option, in addition to the baseline
104// message set.
105//
106// 0xA0 ITU-T G.988 (2010). Baseline message set only, without the extended message set option
107//
108// 0xA1 ITU-T G.988 Amd.1 (2011). Baseline message set only
109//
110// 0xA2 ITU-T G.988 Amd.2 (2012). Baseline message set only
111//
112// Vendor Product Code
113// This attribute contains a vendor-specific product code for the ONU. (R) (optional) (2-bytes)
114//
115// Security Capability
116// This attribute advertises the security capabilities of the ONU. The following code points are
117// defined:
118//
119// 0 Reserved
120//
121// 1 Advanced encryption standard-128 (AES-128) payload encryption supported
122//
123// 2..255 Reserved
124//
125// (R) (mandatory) (1-byte)
126//
127// Security Mode
128// This attribute specifies the current security mode of the ONU. All secure GEM ports in an ONU
129// must use the same security mode at any given time. The following code points are defined:
130//
131// 0 Reserved
132//
133// 1 AES-128 algorithm
134//
135// 2..255 Reserved
136//
137// Upon ME instantiation, the ONU sets this attribute to 1, AES-128. Attribute value 1 does not
138// imply that any channels are encrypted; that process is negotiated at the PLOAM layer. It only
139// signifies that the advanced encryption standard (AES) with 128-bit keys is the security mode to
140// be used on any channels that the OLT may choose to encrypt. (R,-W) (mandatory) (1-byte)
141//
142// Total Priority Queue Number
143// This attribute reports the total number of upstream priority queues that are not associated with
144// a circuit pack, but with the ONU in its entirety. Upon ME instantiation, the ONU sets this
145// attribute to the value that represents its capabilities. (R) (mandatory) (2-bytes)
146//
147// Total Traffic Scheduler Number
148// This attribute reports the total number of traffic schedulers that are not associated with a
149// circuit pack, but with the ONU in its entirety. The ONU supports null function, strict priority
150// scheduling and weighted round robin (WRR) from the priority control and guarantee of minimum
151// rate control points of view, respectively. If the ONU has no global traffic schedulers, this
152// attribute is 0. (R) (mandatory) (1-byte)
153//
154// Deprecated
155// This attribute should always be set to 1 by the ONU and ignored by the OLT. (R) (mandatory)
156// (1-byte)
157//
158// Total Gem Port_Id Number
159// Total GEM port-ID number: This attribute reports the total number of GEM port-IDs supported by
160// the ONU. The maximum value is specified in the corresponding TC recommendations. Upon ME
161// instantiation, the ONU sets this attribute to the value that represents its capabilities. (R)
162// (optional) (2-bytes)
163//
164// Sysuptime
165// This attribute counts 10 ms intervals since the ONU was last initialized. It rolls over to 0
166// when full (see [IETF RFC 1213]). (R) (optional) (4-bytes)
167//
168// Connectivity Capability
169// This attribute indicates the Ethernet connectivity models that the ONU can support. The value 0
170// indicates that the capability is not supported; 1 signifies support. The following code points
171// are defined.
172//
173// NOTE 1 - It is not implied that an ONU may not support other connectivity models.
174//
175// (R) (optional) (2 bytes)
176//
177// Current Connectivity Mode
178// (R, W) (optional) (1 byte)
179//
180// This attribute specifies the Ethernet connectivity model that the OLT wishes to use. The
181// following code points are defined.
182//
183// NOTE 2 - It is not implied that an ONU supports a given connectivity model only when that model
184// is explicitly selected by this attribute. The ONU is free to support additional models at any
185// and all times.
186//
187// Quality Of Service Qos Configuration Flexibility
188// Quality of service (QoS) configuration flexibility: This attribute reports whether various MEs
189// in the ONU are fixed by the ONU's architecture or whether they are configurable. For backward
190// compatibility, and if the ONU does not support this attribute, all such attributes are
191// understood to be hard-wired. (R) (optional) (2-bytes)
192//
193// Discussion:
194//
195// To allow for the possibility that the OLT does not support flexible configuration, the ONU
196// vendor must assure that the priority queues and traffic schedulers are configured in a
197// meaningful and useful way by factory default, and that this default configuration is restored
198// upon ONU initialization and MIB reset. The specifics of such a configuration are beyond the
199// scope of this Recommendation.
200//
201// The ME ID of both the T-CONT and traffic scheduler contains a slot number. Even when attributes
202// in the above list are RW, it is never permitted to change the slot number in a reference. That
203// is, configuration flexibility never extends across slots. It is also not permitted to change the
204// directionality of an upstream queue to downstream or vice versa.
205//
206// Priority Queue Scale Factor
207// If this optional attribute is implemented, it specifies the scale factor of several attributes
208// of the priority queue ME of clause-9.2.10. The default value of this attribute is 1. (R, W)
209// (optional) (2-bytes)
210//
211// NOTE 3 - Some legacy implementations may take the queue scale factor from the GEM block length
212// attribute of the ANI-G ME. That option is discouraged in new implementations.
213//
214type Onu2G struct {
215 ManagedEntityDefinition
216 Attributes AttributeValueMap
217}
218
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000219// Attribute name constants
220
221const Onu2G_EquipmentId = "EquipmentId"
222const Onu2G_OpticalNetworkUnitManagementAndControlChannelOmccVersion = "OpticalNetworkUnitManagementAndControlChannelOmccVersion"
223const Onu2G_VendorProductCode = "VendorProductCode"
224const Onu2G_SecurityCapability = "SecurityCapability"
225const Onu2G_SecurityMode = "SecurityMode"
226const Onu2G_TotalPriorityQueueNumber = "TotalPriorityQueueNumber"
227const Onu2G_TotalTrafficSchedulerNumber = "TotalTrafficSchedulerNumber"
228const Onu2G_Deprecated = "Deprecated"
229const Onu2G_TotalGemPortIdNumber = "TotalGemPortIdNumber"
230const Onu2G_Sysuptime = "Sysuptime"
231const Onu2G_ConnectivityCapability = "ConnectivityCapability"
232const Onu2G_CurrentConnectivityMode = "CurrentConnectivityMode"
233const Onu2G_QualityOfServiceQosConfigurationFlexibility = "QualityOfServiceQosConfigurationFlexibility"
234const Onu2G_PriorityQueueScaleFactor = "PriorityQueueScaleFactor"
235
mpagenko836a1fd2021-11-01 16:12:42 +0000236func init() {
237 onu2gBME = &ManagedEntityDefinition{
238 Name: "Onu2G",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000239 ClassID: Onu2GClassID,
mpagenko836a1fd2021-11-01 16:12:42 +0000240 MessageTypes: mapset.NewSetWith(
241 Get,
242 Set,
243 ),
244 AllowedAttributeMask: 0xfffc,
245 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000246 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
247 1: MultiByteField(Onu2G_EquipmentId, StringAttributeType, 0x8000, 20, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, true, false, 1),
248 2: ByteField(Onu2G_OpticalNetworkUnitManagementAndControlChannelOmccVersion, EnumerationAttributeType, 0x4000, 164, mapset.NewSetWith(Read), true, false, false, 2),
249 3: Uint16Field(Onu2G_VendorProductCode, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3),
250 4: ByteField(Onu2G_SecurityCapability, EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
251 5: ByteField(Onu2G_SecurityMode, EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
252 6: Uint16Field(Onu2G_TotalPriorityQueueNumber, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
253 7: ByteField(Onu2G_TotalTrafficSchedulerNumber, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
254 8: ByteField(Onu2G_Deprecated, UnsignedIntegerAttributeType, 0x0100, 1, mapset.NewSetWith(Read), false, false, true, 8),
255 9: Uint16Field(Onu2G_TotalGemPortIdNumber, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
256 10: Uint32Field(Onu2G_Sysuptime, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
257 11: Uint16Field(Onu2G_ConnectivityCapability, BitFieldAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11),
258 12: ByteField(Onu2G_CurrentConnectivityMode, BitFieldAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
259 13: Uint16Field(Onu2G_QualityOfServiceQosConfigurationFlexibility, BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
260 14: Uint16Field(Onu2G_PriorityQueueScaleFactor, UnsignedIntegerAttributeType, 0x0004, 1, mapset.NewSetWith(Read, Write), false, true, false, 14),
mpagenko836a1fd2021-11-01 16:12:42 +0000261 },
262 Access: CreatedByOnu,
263 Support: UnknownSupport,
264 }
265}
266
267// NewOnu2G (class ID 257) creates the basic
268// Managed Entity definition that is used to validate an ME of this type that
269// is received from or transmitted to the OMCC.
270func NewOnu2G(params ...ParamData) (*ManagedEntity, OmciErrors) {
271 return NewManagedEntity(*onu2gBME, params...)
272}