blob: d922d032aed78c3ef8f456abb8948fdd87ec81fe [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Matteo Scandolof9d43412021-01-12 11:11:34 -08003 * Copyright 2020-present Open Networking Foundation
4
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07005 * 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
Matteo Scandolof9d43412021-01-12 11:11:34 -08008
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07009 * http://www.apache.org/licenses/LICENSE-2.0
Matteo Scandolof9d43412021-01-12 11:11:34 -080010
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070011 * 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 */
Matteo Scandolof9d43412021-01-12 11:11:34 -080017 /*
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070018 * 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 */
Matteo Scandolof9d43412021-01-12 11:11:34 -080023
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070024package generated
25
26import "github.com/deckarep/golang-set"
27
Matteo Scandolof9d43412021-01-12 11:11:34 -080028// Onu2GClassID is the 16-bit ID for the OMCI
29// Managed entity ONU2-G
30const Onu2GClassID ClassID = ClassID(257)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
32var onu2gBME *ManagedEntityDefinition
33
34// Onu2G (class ID #257)
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// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
Matteo Scandolof9d43412021-01-12 11:11:34 -080046// one instance, number 0. (R) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070047//
48// Equipment Id
49// Equipment ID: This attribute may be used to identify the specific type of ONU. In some
50// environments, this attribute may include the common language equipment identification (CLEI)
Matteo Scandolof9d43412021-01-12 11:11:34 -080051// code. (R) (optional) (20-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070052//
53// Optical Network Unit Management And Control Channel Omcc Version
Matteo Scandolof9d43412021-01-12 11:11:34 -080054// (R) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070055//
56// Vendor Product Code
57// Vendor product code: This attribute contains a vendor-specific product code for the ONU. (R)
Matteo Scandolof9d43412021-01-12 11:11:34 -080058// (optional) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070059//
60// Security Capability
Matteo Scandolof9d43412021-01-12 11:11:34 -080061// (R) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070062//
63// Security Mode
64// Upon ME instantiation, the ONU sets this attribute to 1, AES-128. Attribute value 1 does not
65// imply that any channels are encrypted; that process is negotiated at the PLOAM layer. It only
Matteo Scandolof9d43412021-01-12 11:11:34 -080066// signifies that the advanced encryption standard (AES) with 128-bit keys is the security mode to
67// be used on any channels that the OLT may choose to encrypt. (R,-W) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070068//
69// Total Priority Queue Number
70// Total priority queue number: This attribute reports the total number of upstream priority queues
71// that are not associated with a circuit pack, but with the ONU in its entirety. Upon ME
72// instantiation, the ONU sets this attribute to the value that represents its capabilities. (R)
Matteo Scandolof9d43412021-01-12 11:11:34 -080073// (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070074//
75// Total Traffic Scheduler Number
76// Total traffic scheduler number: This attribute reports the total number of traffic schedulers
77// that are not associated with a circuit pack, but with the ONU in its entirety. The ONU supports
78// null function, strict priority scheduling and weighted round robin (WRR) from the priority
79// control and guarantee of minimum rate control points of view, respectively. If the ONU has no
Matteo Scandolof9d43412021-01-12 11:11:34 -080080// global traffic schedulers, this attribute is 0. (R) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070081//
82// Deprecated
83// Deprecated: This attribute should always be set to 1 by the ONU and ignored by the OLT. (R)
Matteo Scandolof9d43412021-01-12 11:11:34 -080084// (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070085//
86// Total Gem Port_Id Number
87// Total GEM port-ID number: This attribute reports the total number of GEM port-IDs supported by
88// the ONU. The maximum value is specified in the corresponding TC recommendations. Upon ME
89// instantiation, the ONU sets this attribute to the value that represents its capabilities. (R)
Matteo Scandolof9d43412021-01-12 11:11:34 -080090// (optional) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070091//
92// Sysuptime
93// SysUpTime: This attribute counts 10 ms intervals since the ONU was last initialized. It rolls
Matteo Scandolof9d43412021-01-12 11:11:34 -080094// over to 0 when full (see [IETF RFC 1213]). (R) (optional) (4-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070095//
96// Connectivity Capability
97// (R) (optional) (2 bytes)
98//
99// Current Connectivity Mode
100// (R, W) (optional) (1 byte)
101//
102// Quality Of Service Qos Configuration Flexibility
103// The ME ID of both the T-CONT and traffic scheduler contains a slot number. Even when attributes
104// in the above list are RW, it is never permitted to change the slot number in a reference. That
105// is, configuration flexibility never extends across slots. It is also not permitted to change the
106// directionality of an upstream queue to downstream or vice versa.
107//
108// Priority Queue Scale Factor
Matteo Scandolof9d43412021-01-12 11:11:34 -0800109// NOTE 3 - Some legacy implementations may take the queue scale factor from the GEM block length
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700110// attribute of the ANI-G ME. That option is discouraged in new implementations.
111//
112type Onu2G struct {
113 ManagedEntityDefinition
114 Attributes AttributeValueMap
115}
116
117func init() {
118 onu2gBME = &ManagedEntityDefinition{
119 Name: "Onu2G",
120 ClassID: 257,
121 MessageTypes: mapset.NewSetWith(
122 Get,
123 Set,
124 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800125 AllowedAttributeMask: 0xfffc,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700126 AttributeDefinitions: AttributeDefinitionMap{
Matteo Scandolof9d43412021-01-12 11:11:34 -0800127 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
128 1: MultiByteField("EquipmentId", StringAttributeType, 0x8000, 20, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, true, false, 1),
129 2: ByteField("OpticalNetworkUnitManagementAndControlChannelOmccVersion", EnumerationAttributeType, 0x4000, 164, mapset.NewSetWith(Read), true, false, false, 2),
130 3: Uint16Field("VendorProductCode", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3),
131 4: ByteField("SecurityCapability", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
132 5: ByteField("SecurityMode", EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
133 6: Uint16Field("TotalPriorityQueueNumber", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
134 7: ByteField("TotalTrafficSchedulerNumber", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
135 8: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0100, 1, mapset.NewSetWith(Read), false, false, true, 8),
136 9: Uint16Field("TotalGemPortIdNumber", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
137 10: Uint32Field("Sysuptime", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
138 11: Uint16Field("ConnectivityCapability", BitFieldAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11),
139 12: ByteField("CurrentConnectivityMode", BitFieldAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
140 13: Uint16Field("QualityOfServiceQosConfigurationFlexibility", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
141 14: Uint16Field("PriorityQueueScaleFactor", UnsignedIntegerAttributeType, 0x0004, 1, mapset.NewSetWith(Read, Write), false, true, false, 14),
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700142 },
Matteo Scandolof9d43412021-01-12 11:11:34 -0800143 Access: CreatedByOnu,
144 Support: UnknownSupport,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700145 }
146}
147
Matteo Scandolof9d43412021-01-12 11:11:34 -0800148// NewOnu2G (class ID 257) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700149// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800150// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700151func NewOnu2G(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800152 return NewManagedEntity(*onu2gBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700153}