blob: a28ffead0860b2095f8376b8e3ddf631c90c0a39 [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14/*
15 * NOTE: This file was generated, manual edits will be overwritten!
16 *
17 * Generated by 'goCodeGenerator.py':
18 * https://github.com/cboling/OMCI-parser/README.md
19 */
20
21package generated
22
23import "github.com/deckarep/golang-set"
24
25// Onu2GClassID is the 16-bit ID for the OMCI
26// Managed entity ONU2-G
27const Onu2GClassID ClassID = ClassID(257)
28
29var onu2gBME *ManagedEntityDefinition
30
31// Onu2G (class ID #257)
32// This ME contains additional attributes associated with a PON ONU. The ONU automatically creates
33// an instance of this ME. Its attributes are populated according to data within the ONU itself.
34//
35// This ME is the same as the ONT2-G of [ITUT G.984.4], with extensions.
36//
37// Relationships
38// This ME is paired with the ONU-G entity.
39//
40// Attributes
41// Managed Entity Id
42// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
43// one instance, number 0. (R) (mandatory) (2-bytes)
44//
45// Equipment Id
46// Equipment ID: This attribute may be used to identify the specific type of ONU. In some
47// environments, this attribute may include the common language equipment identification (CLEI)
48// code. (R) (optional) (20-bytes)
49//
50// Optical Network Unit Management And Control Channel Omcc Version
51// (R) (mandatory) (1-byte)
52//
53// Vendor Product Code
54// Vendor product code: This attribute contains a vendor-specific product code for the ONU. (R)
55// (optional) (2-bytes)
56//
57// Security Capability
58// (R) (mandatory) (1-byte)
59//
60// Security Mode
61// Upon ME instantiation, the ONU sets this attribute to 1, AES-128. Attribute value 1 does not
62// imply that any channels are encrypted; that process is negotiated at the PLOAM layer. It only
63// signifies that the advanced encryption standard (AES) with 128-bit keys is the security mode to
64// be used on any channels that the OLT may choose to encrypt. (R,-W) (mandatory) (1-byte)
65//
66// Total Priority Queue Number
67// Total priority queue number: This attribute reports the total number of upstream priority queues
68// that are not associated with a circuit pack, but with the ONU in its entirety. Upon ME
69// instantiation, the ONU sets this attribute to the value that represents its capabilities. (R)
70// (mandatory) (2-bytes)
71//
72// Total Traffic Scheduler Number
73// Total traffic scheduler number: This attribute reports the total number of traffic schedulers
74// that are not associated with a circuit pack, but with the ONU in its entirety. The ONU supports
75// null function, strict priority scheduling and weighted round robin (WRR) from the priority
76// control and guarantee of minimum rate control points of view, respectively. If the ONU has no
77// global traffic schedulers, this attribute is 0. (R) (mandatory) (1-byte)
78//
79// Deprecated
80// Deprecated: This attribute should always be set to 1 by the ONU and ignored by the OLT. (R)
81// (mandatory) (1-byte)
82//
83// Total Gem Port_Id Number
84// Total GEM port-ID number: This attribute reports the total number of GEM port-IDs supported by
85// the ONU. The maximum value is specified in the corresponding TC recommendations. Upon ME
86// instantiation, the ONU sets this attribute to the value that represents its capabilities. (R)
87// (optional) (2-bytes)
88//
89// Sysuptime
90// SysUpTime: This attribute counts 10 ms intervals since the ONU was last initialized. It rolls
91// over to 0 when full (see [IETF RFC 1213]). (R) (optional) (4-bytes)
92//
93// Connectivity Capability
94// (R) (optional) (2 bytes)
95//
96// Current Connectivity Mode
97// (R, W) (optional) (1 byte)
98//
99// Quality Of Service Qos Configuration Flexibility
100// The ME ID of both the T-CONT and traffic scheduler contains a slot number. Even when attributes
101// in the above list are RW, it is never permitted to change the slot number in a reference. That
102// is, configuration flexibility never extends across slots. It is also not permitted to change the
103// directionality of an upstream queue to downstream or vice versa.
104//
105// Priority Queue Scale Factor
106// NOTE 3 - Some legacy implementations may take the queue scale factor from the GEM block length
107// attribute of the ANI-G ME. That option is discouraged in new implementations.
108//
109type Onu2G struct {
110 ManagedEntityDefinition
111 Attributes AttributeValueMap
112}
113
114func init() {
115 onu2gBME = &ManagedEntityDefinition{
116 Name: "Onu2G",
117 ClassID: 257,
118 MessageTypes: mapset.NewSetWith(
119 Get,
120 Set,
121 ),
122 AllowedAttributeMask: 0xfffc,
123 AttributeDefinitions: AttributeDefinitionMap{
124 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
125 1: MultiByteField("EquipmentId", StringAttributeType, 0x8000, 20, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, true, false, 1),
126 2: ByteField("OpticalNetworkUnitManagementAndControlChannelOmccVersion", EnumerationAttributeType, 0x4000, 164, mapset.NewSetWith(Read), true, false, false, 2),
127 3: Uint16Field("VendorProductCode", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3),
128 4: ByteField("SecurityCapability", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
129 5: ByteField("SecurityMode", EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
130 6: Uint16Field("TotalPriorityQueueNumber", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
131 7: ByteField("TotalTrafficSchedulerNumber", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
132 8: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0100, 1, mapset.NewSetWith(Read), false, false, true, 8),
133 9: Uint16Field("TotalGemPortIdNumber", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
134 10: Uint32Field("Sysuptime", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
135 11: Uint16Field("ConnectivityCapability", BitFieldAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11),
136 12: ByteField("CurrentConnectivityMode", BitFieldAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
137 13: Uint16Field("QualityOfServiceQosConfigurationFlexibility", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
138 14: Uint16Field("PriorityQueueScaleFactor", UnsignedIntegerAttributeType, 0x0004, 1, mapset.NewSetWith(Read, Write), false, true, false, 14),
139 },
140 Access: CreatedByOnu,
141 Support: UnknownSupport,
142 }
143}
144
145// NewOnu2G (class ID 257) creates the basic
146// Managed Entity definition that is used to validate an ME of this type that
147// is received from or transmitted to the OMCC.
148func NewOnu2G(params ...ParamData) (*ManagedEntity, OmciErrors) {
149 return NewManagedEntity(*onu2gBME, params...)
150}