Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 5 | * 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 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 8 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 10 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 11 | * 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 | */ |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 18 | * 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 | */ |
| 23 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // OnuGClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity ONU-G |
| 30 | const OnuGClassID ClassID = ClassID(256) |
| 31 | |
| 32 | var 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 |
| 47 | // one instance, number 0. (R) (mandatory) (2-bytes) |
| 48 | // |
| 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 |
| 52 | // convergence (TC) layer specification. (R) (mandatory) (4-bytes) |
| 53 | // |
| 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) |
| 57 | // (mandatory) (14-bytes) |
| 58 | // |
| 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, |
| 63 | // under the control of the ONU vendor. (R) (mandatory) (8-bytes) |
| 64 | // |
| 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) |
| 68 | // (1-byte) |
| 69 | // |
| 70 | // Deprecated |
| 71 | // Deprecated: This attribute is not used. If it is present, it should be set to 0. (R) (optional) |
| 72 | // (1-byte) |
| 73 | // |
| 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 |
| 77 | // enables battery alarm monitoring. (R,-W) (mandatory) (1-byte) |
| 78 | // |
| 79 | // Administrative State |
| 80 | // Administrative state: This attribute locks (1) and unlocks (0) the functions performed by the |
| 81 | // ONU as an entirety. Administrative state is further described in clause A.1.6. (R,-W) |
| 82 | // (mandatory) (1-byte) |
| 83 | // |
| 84 | // Operational State |
| 85 | // Operational state: This attribute reports whether the ME is currently capable of performing its |
| 86 | // function. Valid values are enabled (0) and disabled (1). (R) (optional) (1-byte) |
| 87 | // |
| 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) |
| 92 | // (optional) (1-byte) |
| 93 | // |
| 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 |
| 104 | // scope of this Recommendation. (R) (optional) (12-bytes) |
| 105 | // |
| 106 | // Credentials Status |
| 107 | // Other values are reserved. |
| 108 | // |
| 109 | // Extended Tc_Layer Options |
| 110 | // (R) (optional) (2-bytes) |
| 111 | // |
| 112 | type OnuG struct { |
| 113 | ManagedEntityDefinition |
| 114 | Attributes AttributeValueMap |
| 115 | } |
| 116 | |
| 117 | func 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 | ), |
| 128 | AllowedAttributeMask: 0xfff8, |
| 129 | AttributeDefinitions: AttributeDefinitionMap{ |
| 130 | 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), |
| 144 | }, |
| 145 | Access: CreatedByOnu, |
| 146 | Support: UnknownSupport, |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // NewOnuG (class ID 256) creates the basic |
| 151 | // Managed Entity definition that is used to validate an ME of this type that |
| 152 | // is received from or transmitted to the OMCC. |
| 153 | func NewOnuG(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 154 | return NewManagedEntity(*onugBME, params...) |
| 155 | } |