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 | // Onu2GClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity ONU2-G |
| 30 | const Onu2GClassID ClassID = ClassID(257) |
| 31 | |
| 32 | var onu2gBME *ManagedEntityDefinition |
| 33 | |
| 34 | // Onu2G (class ID #257) |
| 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 |
| 45 | // Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only |
| 46 | // one instance, number 0. (R) (mandatory) (2-bytes) |
| 47 | // |
| 48 | // Equipment Id |
| 49 | // Equipment ID: This attribute may be used to identify the specific type of ONU. In some |
| 50 | // environments, this attribute may include the common language equipment identification (CLEI) |
| 51 | // code. (R) (optional) (20-bytes) |
| 52 | // |
| 53 | // Optical Network Unit Management And Control Channel Omcc Version |
| 54 | // (R) (mandatory) (1-byte) |
| 55 | // |
| 56 | // Vendor Product Code |
| 57 | // Vendor product code: This attribute contains a vendor-specific product code for the ONU. (R) |
| 58 | // (optional) (2-bytes) |
| 59 | // |
| 60 | // Security Capability |
| 61 | // (R) (mandatory) (1-byte) |
| 62 | // |
| 63 | // Security Mode |
| 64 | // Upon ME instantiation, the ONU sets this attribute to 1, AES-128. Attribute value 1 does not |
| 65 | // imply that any channels are encrypted; that process is negotiated at the PLOAM layer. It only |
| 66 | // signifies that the advanced encryption standard (AES) with 128-bit keys is the security mode to |
| 67 | // be used on any channels that the OLT may choose to encrypt. (R,-W) (mandatory) (1-byte) |
| 68 | // |
| 69 | // Total Priority Queue Number |
| 70 | // Total priority queue number: This attribute reports the total number of upstream priority queues |
| 71 | // that are not associated with a circuit pack, but with the ONU in its entirety. Upon ME |
| 72 | // instantiation, the ONU sets this attribute to the value that represents its capabilities. (R) |
| 73 | // (mandatory) (2-bytes) |
| 74 | // |
| 75 | // Total Traffic Scheduler Number |
| 76 | // Total traffic scheduler number: This attribute reports the total number of traffic schedulers |
| 77 | // that are not associated with a circuit pack, but with the ONU in its entirety. The ONU supports |
| 78 | // null function, strict priority scheduling and weighted round robin (WRR) from the priority |
| 79 | // control and guarantee of minimum rate control points of view, respectively. If the ONU has no |
| 80 | // global traffic schedulers, this attribute is 0. (R) (mandatory) (1-byte) |
| 81 | // |
| 82 | // Deprecated |
| 83 | // Deprecated: This attribute should always be set to 1 by the ONU and ignored by the OLT. (R) |
| 84 | // (mandatory) (1-byte) |
| 85 | // |
| 86 | // Total Gem Port_Id Number |
| 87 | // Total GEM port-ID number: This attribute reports the total number of GEM port-IDs supported by |
| 88 | // the ONU. The maximum value is specified in the corresponding TC recommendations. Upon ME |
| 89 | // instantiation, the ONU sets this attribute to the value that represents its capabilities. (R) |
| 90 | // (optional) (2-bytes) |
| 91 | // |
| 92 | // Sysuptime |
| 93 | // SysUpTime: This attribute counts 10 ms intervals since the ONU was last initialized. It rolls |
| 94 | // over to 0 when full (see [IETF RFC 1213]). (R) (optional) (4-bytes) |
| 95 | // |
| 96 | // Connectivity Capability |
| 97 | // (R) (optional) (2 bytes) |
| 98 | // |
| 99 | // Current Connectivity Mode |
| 100 | // (R, W) (optional) (1 byte) |
| 101 | // |
| 102 | // Quality Of Service Qos Configuration Flexibility |
| 103 | // The ME ID of both the T-CONT and traffic scheduler contains a slot number. Even when attributes |
| 104 | // in the above list are RW, it is never permitted to change the slot number in a reference. That |
| 105 | // is, configuration flexibility never extends across slots. It is also not permitted to change the |
| 106 | // directionality of an upstream queue to downstream or vice versa. |
| 107 | // |
| 108 | // Priority Queue Scale Factor |
| 109 | // NOTE 3 - Some legacy implementations may take the queue scale factor from the GEM block length |
| 110 | // attribute of the ANI-G ME. That option is discouraged in new implementations. |
| 111 | // |
| 112 | type Onu2G struct { |
| 113 | ManagedEntityDefinition |
| 114 | Attributes AttributeValueMap |
| 115 | } |
| 116 | |
| 117 | func init() { |
| 118 | onu2gBME = &ManagedEntityDefinition{ |
| 119 | Name: "Onu2G", |
| 120 | ClassID: 257, |
| 121 | MessageTypes: mapset.NewSetWith( |
| 122 | Get, |
| 123 | Set, |
| 124 | ), |
| 125 | AllowedAttributeMask: 0xfffc, |
| 126 | AttributeDefinitions: AttributeDefinitionMap{ |
| 127 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 128 | 1: MultiByteField("EquipmentId", StringAttributeType, 0x8000, 20, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read), false, true, false, 1), |
| 129 | 2: ByteField("OpticalNetworkUnitManagementAndControlChannelOmccVersion", EnumerationAttributeType, 0x4000, 164, mapset.NewSetWith(Read), true, false, false, 2), |
| 130 | 3: Uint16Field("VendorProductCode", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3), |
| 131 | 4: ByteField("SecurityCapability", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4), |
| 132 | 5: ByteField("SecurityMode", EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5), |
| 133 | 6: Uint16Field("TotalPriorityQueueNumber", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6), |
| 134 | 7: ByteField("TotalTrafficSchedulerNumber", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7), |
| 135 | 8: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0100, 1, mapset.NewSetWith(Read), false, false, true, 8), |
| 136 | 9: Uint16Field("TotalGemPortIdNumber", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9), |
| 137 | 10: Uint32Field("Sysuptime", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10), |
| 138 | 11: Uint16Field("ConnectivityCapability", BitFieldAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11), |
| 139 | 12: ByteField("CurrentConnectivityMode", BitFieldAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, true, false, 12), |
| 140 | 13: Uint16Field("QualityOfServiceQosConfigurationFlexibility", BitFieldAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13), |
| 141 | 14: Uint16Field("PriorityQueueScaleFactor", UnsignedIntegerAttributeType, 0x0004, 1, mapset.NewSetWith(Read, Write), false, true, false, 14), |
| 142 | }, |
| 143 | Access: CreatedByOnu, |
| 144 | Support: UnknownSupport, |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // NewOnu2G (class ID 257) creates the basic |
| 149 | // Managed Entity definition that is used to validate an ME of this type that |
| 150 | // is received from or transmitted to the OMCC. |
| 151 | func NewOnu2G(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 152 | return NewManagedEntity(*onu2gBME, params...) |
| 153 | } |