blob: b08a5fcede2c8437c1b0db4d3498d56e1c7f84ea [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// OnuGClassID is the 16-bit ID for the OMCI
29// Managed entity ONU-G
30const OnuGClassID ClassID = ClassID(256)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
32var onugBME *ManagedEntityDefinition
33
34// OnuG (class ID #256)
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// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
Matteo Scandolof9d43412021-01-12 11:11:34 -080047// one instance, number 0. (R) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070048//
49// Vendor Id
50// Vendor ID: This attribute identifies the vendor of the ONU. It is the same as the four most
51// significant bytes of the ONU serial number as specified in the respective transmission
Matteo Scandolof9d43412021-01-12 11:11:34 -080052// convergence (TC) layer specification. (R) (mandatory) (4-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070053//
54// Version
55// Version: This attribute identifies the version of the ONU as defined by the vendor. The
56// character value 0 indicates that version information is not available or applicable. (R)
Matteo Scandolof9d43412021-01-12 11:11:34 -080057// (mandatory) (14-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070058//
59// Serial Number
60// Serial number: The serial number is unique for each ONU. It is defined in the respective TC
61// layer specification and contains the vendor ID and version number. The first four bytes are an
62// ASCII-encoded four-letter vendor ID. The second four bytes are a binary encoded serial number,
Matteo Scandolof9d43412021-01-12 11:11:34 -080063// under the control of the ONU vendor. (R) (mandatory) (8-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070064//
65// Traffic Management Option
66// Upon ME instantiation, the ONU sets this attribute to the value that describes its
67// implementation. The OLT must adapt its model to conform to the ONU's selection. (R) (mandatory)
Matteo Scandolof9d43412021-01-12 11:11:34 -080068// (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070069//
70// Deprecated
71// Deprecated: This attribute is not used. If it is present, it should be set to 0. (R) (optional)
Matteo Scandolof9d43412021-01-12 11:11:34 -080072// (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070073//
74// Battery Backup
75// Battery backup: This Boolean attribute controls whether the ONU performs backup battery
76// monitoring (assuming it is capable of doing so). False disables battery alarm monitoring; true
Matteo Scandolof9d43412021-01-12 11:11:34 -080077// enables battery alarm monitoring. (R,-W) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070078//
79// Administrative State
80// Administrative state: This attribute locks (1) and unlocks (0) the functions performed by the
Matteo Scandolof9d43412021-01-12 11:11:34 -080081// ONU as an entirety. Administrative state is further described in clause A.1.6. (R,-W)
82// (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070083//
84// Operational State
85// Operational state: This attribute reports whether the ME is currently capable of performing its
Matteo Scandolof9d43412021-01-12 11:11:34 -080086// function. Valid values are enabled (0) and disabled (1). (R) (optional) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070087//
88// Onu Survival Time
89// ONU survival time: This attribute indicates the minimum guaranteed time in milliseconds between
90// the loss of external power and the silence of the ONU. This does not include survival time
91// attributable to a backup battery. The value zero implies that the actual time is not known. (R)
Matteo Scandolof9d43412021-01-12 11:11:34 -080092// (optional) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070093//
94// Logical Onu Id
95// Logical ONU ID: This attribute provides a way for the ONU to identify itself. It is a text
96// string, null terminated if it is shorter than 24 bytes, with a null default value. The mechanism
97// for creation or modification of this information is beyond the scope of this Recommendation, but
98// might include, for example, a web page displayed to a user. (R) (optional) (24 bytes)
99//
100// Logical Password
101// Logical password: This attribute provides a way for the ONU to submit authentication
102// credentials. It is a text string, null terminated if it is shorter than 12 bytes, with a null
103// default value. The mechanism for creation or modification of this information is beyond the
Matteo Scandolof9d43412021-01-12 11:11:34 -0800104// scope of this Recommendation. (R) (optional) (12-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700105//
106// Credentials Status
107// Other values are reserved.
108//
109// Extended Tc_Layer Options
Matteo Scandolof9d43412021-01-12 11:11:34 -0800110// (R) (optional) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700111//
112type OnuG struct {
113 ManagedEntityDefinition
114 Attributes AttributeValueMap
115}
116
117func init() {
118 onugBME = &ManagedEntityDefinition{
119 Name: "OnuG",
120 ClassID: 256,
121 MessageTypes: mapset.NewSetWith(
122 Get,
123 Reboot,
124 Set,
125 SynchronizeTime,
126 Test,
127 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800128 AllowedAttributeMask: 0xfff8,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700129 AttributeDefinitions: AttributeDefinitionMap{
Matteo Scandolof9d43412021-01-12 11:11:34 -0800130 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
131 1: MultiByteField("VendorId", StringAttributeType, 0x8000, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read), false, false, false, 1),
132 2: MultiByteField("Version", StringAttributeType, 0x4000, 14, toOctets("MAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 2),
133 3: MultiByteField("SerialNumber", OctetsAttributeType, 0x2000, 8, toOctets("AAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 3),
134 4: ByteField("TrafficManagementOption", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
135 5: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, true, true, 5),
136 6: ByteField("BatteryBackup", EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
137 7: ByteField("AdministrativeState", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
138 8: ByteField("OperationalState", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, true, false, 8),
139 9: ByteField("OnuSurvivalTime", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
140 10: MultiByteField("LogicalOnuId", OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), false, true, false, 10),
141 11: MultiByteField("LogicalPassword", OctetsAttributeType, 0x0020, 12, toOctets("AAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), false, true, false, 11),
142 12: ByteField("CredentialsStatus", EnumerationAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
143 13: Uint16Field("ExtendedTcLayerOptions", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700144 },
Matteo Scandolof9d43412021-01-12 11:11:34 -0800145 Access: CreatedByOnu,
146 Support: UnknownSupport,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700147 }
148}
149
Matteo Scandolof9d43412021-01-12 11:11:34 -0800150// NewOnuG (class ID 256) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700151// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800152// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700153func NewOnuG(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800154 return NewManagedEntity(*onugBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700155}