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 | */ |
David K. Bainbridge | adf422d | 2021-04-09 16:06:41 +0000 | [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 | // Onu2GClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity ONU2-G |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const Onu2GClassID = ClassID(257) // 0x0101 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var onu2gBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // Onu2G (Class ID: #257 / 0x0101) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME contains additional attributes associated with a PON ONU. The ONU automatically creates |
| 36 | // an instance of this ME. Its attributes are populated according to data within the ONU itself. |
| 37 | // |
| 38 | // This ME is the same as the ONT2-G of [ITUT G.984.4], with extensions. |
| 39 | // |
| 40 | // Relationships |
| 41 | // This ME is paired with the ONU-G entity. |
| 42 | // |
| 43 | // Attributes |
| 44 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 45 | // This attribute uniquely identifies each instance of this ME. There is only one instance, number |
| 46 | // 0. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 47 | // |
| 48 | // Equipment Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 49 | // This attribute may be used to identify the specific type of ONU. In some environments, this |
| 50 | // attribute may include the common language equipment identification (CLEI) code. (R) (optional) |
| 51 | // (20-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 52 | // |
| 53 | // Optical Network Unit Management And Control Channel Omcc Version |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 54 | // 0xA3 ITU-T G.988 (2012). Baseline message set only |
| 55 | // |
| 56 | // 0xB0 ITU-T G.988 (2010). Baseline and extended message set |
| 57 | // |
| 58 | // 0xB1 ITU-T G.988 Amd.1 (2011). Baseline and extended message set |
| 59 | // |
| 60 | // 0xB2 ITU-T G.988 Amd.2 (2012). Baseline and extended message set |
| 61 | // |
| 62 | // 0xB3 ITU-T G.988 (2012). Baseline and extended message set |
| 63 | // |
| 64 | // 0xB4 ITU-T G.988 Amd1 (2014) Baseline and extended message set |
| 65 | // |
| 66 | // 0xB5 Do not use |
| 67 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 68 | // (R) (mandatory) (1-byte) |
| 69 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 70 | // Optical network unit management and control channel (OMCC) version: This attribute identifies |
| 71 | // the version of the OMCC protocol being used by the ONU. This allows the OLT to manage a network |
| 72 | // with ONUs that support different OMCC versions. Release levels of [ITUT G.984.4] are supported |
| 73 | // with code points of the form 0x8y and 0x9y, where y is a hexadecimal digit in the range 0..F. |
| 74 | // Support for continuing revisions of this Recommendation is defined in the 0xAy and OxBy range. |
| 75 | // |
| 76 | // NOTE 1 - The complete list of managed entities supported by an ONU cannot be derived from the |
| 77 | // OMCC version attribute. Refer to other ITUT-G.988 OMCI mechanisms for deriving this information |
| 78 | // (clause I.1.1.1 which describes the use of clauses 9.12.9 Managed entity and 9.12.10 Attribute |
| 79 | // ME for retrieval of ITU-T G.988 supported ME, and clause I.1.2 for discovering the ONU hardware |
| 80 | // and service configuration of the ONU through MIB uploads.) |
| 81 | // |
| 82 | // NOTE 2 - 0xBz values greater than B5 are reserved to report new ITUT-G.988 Annex A message |
| 83 | // versions (relative to ITU-T G.988 (2014) Amd1). |
| 84 | // |
| 85 | // 0x80 ITU-T G.984.4 (06/04) |
| 86 | // |
| 87 | // NOTE - For historical reasons, this code point may also appear in ONUs that support later |
| 88 | // versions of [ITU-T G.984.4]. |
| 89 | // |
| 90 | // 0x81 ITU-T G.984.4 2004 Amd.1 (06/05) |
| 91 | // |
| 92 | // 0x82 ITU-T G.984.4 2004 Amd.2 (03/06) |
| 93 | // |
| 94 | // 0x83 ITU-T G.984.4 2004 Amd.3 (12/06) |
| 95 | // |
| 96 | // 0x84 ITU-T G.984.4 2008 (02/08) |
| 97 | // |
| 98 | // 0x85 ITU-T G.984.4 2008 Amd.1 (06/09) |
| 99 | // |
| 100 | // 0x86 ITU-T G.984.4 2008 Amd.2 (2009). Baseline message set only, without the extended message |
| 101 | // set option |
| 102 | // |
| 103 | // 0x96 ITU-T G.984.4 2008 Amd.2 (2009). Extended message set option, in addition to the baseline |
| 104 | // message set. |
| 105 | // |
| 106 | // 0xA0 ITU-T G.988 (2010). Baseline message set only, without the extended message set option |
| 107 | // |
| 108 | // 0xA1 ITU-T G.988 Amd.1 (2011). Baseline message set only |
| 109 | // |
| 110 | // 0xA2 ITU-T G.988 Amd.2 (2012). Baseline message set only |
| 111 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 112 | // Vendor Product Code |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 113 | // This attribute contains a vendor-specific product code for the ONU. (R) (optional) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 114 | // |
| 115 | // Security Capability |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 116 | // This attribute advertises the security capabilities of the ONU. The following code points are |
| 117 | // defined: |
| 118 | // |
| 119 | // 0 Reserved |
| 120 | // |
| 121 | // 1 Advanced encryption standard-128 (AES-128) payload encryption supported |
| 122 | // |
| 123 | // 2..255 Reserved |
| 124 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 125 | // (R) (mandatory) (1-byte) |
| 126 | // |
| 127 | // Security Mode |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 128 | // This attribute specifies the current security mode of the ONU. All secure GEM ports in an ONU |
| 129 | // must use the same security mode at any given time. The following code points are defined: |
| 130 | // |
| 131 | // 0 Reserved |
| 132 | // |
| 133 | // 1 AES-128 algorithm |
| 134 | // |
| 135 | // 2..255 Reserved |
| 136 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 137 | // Upon ME instantiation, the ONU sets this attribute to 1, AES-128. Attribute value 1 does not |
| 138 | // imply that any channels are encrypted; that process is negotiated at the PLOAM layer. It only |
| 139 | // signifies that the advanced encryption standard (AES) with 128-bit keys is the security mode to |
| 140 | // be used on any channels that the OLT may choose to encrypt. (R,-W) (mandatory) (1-byte) |
| 141 | // |
| 142 | // Total Priority Queue Number |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 143 | // This attribute reports the total number of upstream priority queues that are not associated with |
| 144 | // a circuit pack, but with the ONU in its entirety. Upon ME instantiation, the ONU sets this |
| 145 | // attribute to the value that represents its capabilities. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 146 | // |
| 147 | // Total Traffic Scheduler Number |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 148 | // This attribute reports the total number of traffic schedulers that are not associated with a |
| 149 | // circuit pack, but with the ONU in its entirety. The ONU supports null function, strict priority |
| 150 | // scheduling and weighted round robin (WRR) from the priority control and guarantee of minimum |
| 151 | // rate control points of view, respectively. If the ONU has no global traffic schedulers, this |
| 152 | // attribute is 0. (R) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 153 | // |
| 154 | // Deprecated |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 155 | // This attribute should always be set to 1 by the ONU and ignored by the OLT. (R) (mandatory) |
| 156 | // (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 157 | // |
| 158 | // Total Gem Port_Id Number |
| 159 | // Total GEM port-ID number: This attribute reports the total number of GEM port-IDs supported by |
| 160 | // the ONU. The maximum value is specified in the corresponding TC recommendations. Upon ME |
| 161 | // instantiation, the ONU sets this attribute to the value that represents its capabilities. (R) |
| 162 | // (optional) (2-bytes) |
| 163 | // |
| 164 | // Sysuptime |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 165 | // This attribute counts 10 ms intervals since the ONU was last initialized. It rolls over to 0 |
| 166 | // when full (see [IETF RFC 1213]). (R) (optional) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 167 | // |
| 168 | // Connectivity Capability |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 169 | // This attribute indicates the Ethernet connectivity models that the ONU can support. The value 0 |
| 170 | // indicates that the capability is not supported; 1 signifies support. The following code points |
| 171 | // are defined. |
| 172 | // |
| 173 | // NOTE 1 - It is not implied that an ONU may not support other connectivity models. |
| 174 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 175 | // (R) (optional) (2 bytes) |
| 176 | // |
| 177 | // Current Connectivity Mode |
| 178 | // (R, W) (optional) (1 byte) |
| 179 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 180 | // This attribute specifies the Ethernet connectivity model that the OLT wishes to use. The |
| 181 | // following code points are defined. |
| 182 | // |
| 183 | // NOTE 2 - It is not implied that an ONU supports a given connectivity model only when that model |
| 184 | // is explicitly selected by this attribute. The ONU is free to support additional models at any |
| 185 | // and all times. |
| 186 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 187 | // Quality Of Service Qos Configuration Flexibility |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 188 | // Quality of service (QoS) configuration flexibility: This attribute reports whether various MEs |
| 189 | // in the ONU are fixed by the ONU's architecture or whether they are configurable. For backward |
| 190 | // compatibility, and if the ONU does not support this attribute, all such attributes are |
| 191 | // understood to be hard-wired. (R) (optional) (2-bytes) |
| 192 | // |
| 193 | // Discussion: |
| 194 | // |
| 195 | // To allow for the possibility that the OLT does not support flexible configuration, the ONU |
| 196 | // vendor must assure that the priority queues and traffic schedulers are configured in a |
| 197 | // meaningful and useful way by factory default, and that this default configuration is restored |
| 198 | // upon ONU initialization and MIB reset. The specifics of such a configuration are beyond the |
| 199 | // scope of this Recommendation. |
| 200 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 201 | // The ME ID of both the T-CONT and traffic scheduler contains a slot number. Even when attributes |
| 202 | // in the above list are RW, it is never permitted to change the slot number in a reference. That |
| 203 | // is, configuration flexibility never extends across slots. It is also not permitted to change the |
| 204 | // directionality of an upstream queue to downstream or vice versa. |
| 205 | // |
| 206 | // Priority Queue Scale Factor |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 207 | // If this optional attribute is implemented, it specifies the scale factor of several attributes |
| 208 | // of the priority queue ME of clause-9.2.10. The default value of this attribute is 1. (R, W) |
| 209 | // (optional) (2-bytes) |
| 210 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 211 | // NOTE 3 - Some legacy implementations may take the queue scale factor from the GEM block length |
| 212 | // attribute of the ANI-G ME. That option is discouraged in new implementations. |
| 213 | // |
| 214 | type Onu2G struct { |
| 215 | ManagedEntityDefinition |
| 216 | Attributes AttributeValueMap |
| 217 | } |
| 218 | |
| 219 | func init() { |
| 220 | onu2gBME = &ManagedEntityDefinition{ |
| 221 | Name: "Onu2G", |
| 222 | ClassID: 257, |
| 223 | MessageTypes: mapset.NewSetWith( |
| 224 | Get, |
| 225 | Set, |
| 226 | ), |
| 227 | AllowedAttributeMask: 0xfffc, |
| 228 | AttributeDefinitions: AttributeDefinitionMap{ |
| 229 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 230 | 1: MultiByteField("EquipmentId", StringAttributeType, 0x8000, 20, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, true, false, 1), |
| 231 | 2: ByteField("OpticalNetworkUnitManagementAndControlChannelOmccVersion", EnumerationAttributeType, 0x4000, 164, mapset.NewSetWith(Read), true, false, false, 2), |
| 232 | 3: Uint16Field("VendorProductCode", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3), |
| 233 | 4: ByteField("SecurityCapability", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4), |
| 234 | 5: ByteField("SecurityMode", EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5), |
| 235 | 6: Uint16Field("TotalPriorityQueueNumber", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6), |
| 236 | 7: ByteField("TotalTrafficSchedulerNumber", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7), |
| 237 | 8: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0100, 1, mapset.NewSetWith(Read), false, false, true, 8), |
| 238 | 9: Uint16Field("TotalGemPortIdNumber", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9), |
| 239 | 10: Uint32Field("Sysuptime", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10), |
| 240 | 11: Uint16Field("ConnectivityCapability", BitFieldAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11), |
| 241 | 12: ByteField("CurrentConnectivityMode", BitFieldAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12), |
| 242 | 13: Uint16Field("QualityOfServiceQosConfigurationFlexibility", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13), |
| 243 | 14: Uint16Field("PriorityQueueScaleFactor", UnsignedIntegerAttributeType, 0x0004, 1, mapset.NewSetWith(Read, Write), false, true, false, 14), |
| 244 | }, |
| 245 | Access: CreatedByOnu, |
| 246 | Support: UnknownSupport, |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | // NewOnu2G (class ID 257) creates the basic |
| 251 | // Managed Entity definition that is used to validate an ME of this type that |
| 252 | // is received from or transmitted to the OMCC. |
| 253 | func NewOnu2G(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 254 | return NewManagedEntity(*onu2gBME, params...) |
| 255 | } |