blob: fa92a59d973d58b2ba694b1ea879afb410df24b5 [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// OnuGClassID is the 16-bit ID for the OMCI
26// Managed entity ONU-G
27const OnuGClassID ClassID = ClassID(256)
28
29var onugBME *ManagedEntityDefinition
30
31// OnuG (class ID #256)
32// This ME represents the ONU as equipment. The ONU automatically creates an instance of this ME.
33// It assigns values to read-only attributes according to data within the ONU itself.
34//
35// This ME has evolved from the ONT-G of [ITUT G.984.4].
36//
37// Relationships
38// In ITU-T GTC based PON applications, all other MEs in this Recommendation are related directly
39// or indirectly to the ONU-G entity.
40//
41// Attributes
42// Managed Entity Id
43// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
44// one instance, number 0. (R) (mandatory) (2-bytes)
45//
46// Vendor Id
47// Vendor ID: This attribute identifies the vendor of the ONU. It is the same as the four most
48// significant bytes of the ONU serial number as specified in the respective transmission
49// convergence (TC) layer specification. (R) (mandatory) (4-bytes)
50//
51// Version
52// Version: This attribute identifies the version of the ONU as defined by the vendor. The
53// character value 0 indicates that version information is not available or applicable. (R)
54// (mandatory) (14-bytes)
55//
56// Serial Number
57// Serial number: The serial number is unique for each ONU. It is defined in the respective TC
58// layer specification and contains the vendor ID and version number. The first four bytes are an
59// ASCII-encoded four-letter vendor ID. The second four bytes are a binary encoded serial number,
60// under the control of the ONU vendor. (R) (mandatory) (8-bytes)
61//
62// Traffic Management Option
63// Upon ME instantiation, the ONU sets this attribute to the value that describes its
64// implementation. The OLT must adapt its model to conform to the ONU's selection. (R) (mandatory)
65// (1-byte)
66//
67// Deprecated
68// Deprecated: This attribute is not used. If it is present, it should be set to 0. (R) (optional)
69// (1-byte)
70//
71// Battery Backup
72// Battery backup: This Boolean attribute controls whether the ONU performs backup battery
73// monitoring (assuming it is capable of doing so). False disables battery alarm monitoring; true
74// enables battery alarm monitoring. (R,-W) (mandatory) (1-byte)
75//
76// Administrative State
77// Administrative state: This attribute locks (1) and unlocks (0) the functions performed by the
78// ONU as an entirety. Administrative state is further described in clause A.1.6. (R,-W)
79// (mandatory) (1-byte)
80//
81// Operational State
82// Operational state: This attribute reports whether the ME is currently capable of performing its
83// function. Valid values are enabled (0) and disabled (1). (R) (optional) (1-byte)
84//
85// Onu Survival Time
86// ONU survival time: This attribute indicates the minimum guaranteed time in milliseconds between
87// the loss of external power and the silence of the ONU. This does not include survival time
88// attributable to a backup battery. The value zero implies that the actual time is not known. (R)
89// (optional) (1-byte)
90//
91// Logical Onu Id
92// Logical ONU ID: This attribute provides a way for the ONU to identify itself. It is a text
93// string, null terminated if it is shorter than 24 bytes, with a null default value. The mechanism
94// for creation or modification of this information is beyond the scope of this Recommendation, but
95// might include, for example, a web page displayed to a user. (R) (optional) (24 bytes)
96//
97// Logical Password
98// Logical password: This attribute provides a way for the ONU to submit authentication
99// credentials. It is a text string, null terminated if it is shorter than 12 bytes, with a null
100// default value. The mechanism for creation or modification of this information is beyond the
101// scope of this Recommendation. (R) (optional) (12-bytes)
102//
103// Credentials Status
104// Other values are reserved.
105//
106// Extended Tc_Layer Options
107// (R) (optional) (2-bytes)
108//
109type OnuG struct {
110 ManagedEntityDefinition
111 Attributes AttributeValueMap
112}
113
114func init() {
115 onugBME = &ManagedEntityDefinition{
116 Name: "OnuG",
117 ClassID: 256,
118 MessageTypes: mapset.NewSetWith(
119 Get,
120 Reboot,
121 Set,
122 SynchronizeTime,
123 Test,
124 ),
125 AllowedAttributeMask: 0xfff8,
126 AttributeDefinitions: AttributeDefinitionMap{
127 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
128 1: MultiByteField("VendorId", StringAttributeType, 0x8000, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read), false, false, false, 1),
129 2: MultiByteField("Version", StringAttributeType, 0x4000, 14, toOctets("MAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 2),
130 3: MultiByteField("SerialNumber", OctetsAttributeType, 0x2000, 8, toOctets("AAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 3),
131 4: ByteField("TrafficManagementOption", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
132 5: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, true, true, 5),
133 6: ByteField("BatteryBackup", EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
134 7: ByteField("AdministrativeState", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
135 8: ByteField("OperationalState", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, true, false, 8),
136 9: ByteField("OnuSurvivalTime", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
137 10: MultiByteField("LogicalOnuId", OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), false, true, false, 10),
138 11: MultiByteField("LogicalPassword", OctetsAttributeType, 0x0020, 12, toOctets("AAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read), false, true, false, 11),
139 12: ByteField("CredentialsStatus", EnumerationAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12),
140 13: Uint16Field("ExtendedTcLayerOptions", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
141 },
142 Access: CreatedByOnu,
143 Support: UnknownSupport,
144 }
145}
146
147// NewOnuG (class ID 256) creates the basic
148// Managed Entity definition that is used to validate an ME of this type that
149// is received from or transmitted to the OMCC.
150func NewOnuG(params ...ParamData) (*ManagedEntity, OmciErrors) {
151 return NewManagedEntity(*onugBME, params...)
152}