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