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 | */ |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [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 | // AniGClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity ANI-G |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const AniGClassID = ClassID(263) // 0x0107 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var anigBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // AniG (Class ID: #263 / 0x0107) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME organizes data associated with each access network interface supported by a GPON ONU. |
| 36 | // The ONU automatically creates one instance of this ME for each PON physical port. |
| 37 | // |
| 38 | // Relationships |
| 39 | // An instance of this ME is associated with each instance of a physical PON interface. |
| 40 | // |
| 41 | // Attributes |
| 42 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 43 | // This attribute uniquely identifies each instance of this ME. Its value indicates the physical |
| 44 | // position of the PON interface. The first byte is the slot ID, defined in clause 9.1.5. The |
| 45 | // second byte is the port ID. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 46 | // |
| 47 | // Sr Indication |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 48 | // This Boolean attribute indicates the ONU's capability to report queue status for DBA. The value |
| 49 | // true means that status reporting is available for all TCONTs that are associated with the ANI. |
| 50 | // (R) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 51 | // |
| 52 | // Total TCont Number |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 53 | // This attribute indicates the total number of T-CONTs that can be supported on this ANI. (R) |
| 54 | // (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 55 | // |
| 56 | // Gem Block Length |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 57 | // This attribute specifies the queue occupancy reporting granularity for DBA, expressed in bytes. |
| 58 | // This attribute is meaningful only in ITUT G.984.x systems. (R, W) (mandatory) (2 bytes) |
| 59 | // |
| 60 | // In ITU-T G.984 systems, the value set by the OLT is used by all TCONTs on this ANI. Upon ME |
| 61 | // instantiation, the ONU sets this attribute to 48. See [ITUT G.984.3] for further details. |
| 62 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 63 | // In all other ITU-T PON systems, the unit for queue occupancy reporting is fixed in at 4-bytes by |
| 64 | // the respective TC layer specification. |
| 65 | // |
| 66 | // Piggyback Dba Reporting |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 67 | // This attribute indicates the ONU's piggyback DBA reporting format capabilities. [ITUT G.984.3] |
| 68 | // defines two possible piggyback reporting modes. For reporting mode 0, the single field is the |
| 69 | // entire report. For reporting mode 1, the DBA report is two fields long. Mode 0 is mandatory for |
| 70 | // ITU-T G.984 ONUs that support piggyback DBA reporting; mode 1 is optional. Subsequent PON |
| 71 | // specifications allows only one mode, which should be reported in this attribute as code point 0. |
| 72 | // |
| 73 | // The following coding indicates the ONU's piggyback DBA reporting mode capabilities: |
| 74 | // |
| 75 | // 0 Mode 0 only |
| 76 | // |
| 77 | // 1 Modes 0 and 1 |
| 78 | // |
| 79 | // 2 Deprecated |
| 80 | // |
| 81 | // 3 Deprecated |
| 82 | // |
| 83 | // 4 Piggyback DBA reporting not supported |
| 84 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 85 | // (R) (mandatory) (1-byte) |
| 86 | // |
| 87 | // Deprecated |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 88 | // This attribute should be set to 0 by the ONU and ignored by the OLT. (R) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 89 | // |
| 90 | // Signal Fail Threshold |
| 91 | // Signal fail (SF) threshold: This attribute specifies the downstream bit error rate (BER) |
| 92 | // threshold to detect the SF alarm. When this value is y, the BER threshold is 10-y. Valid values |
| 93 | // are 3..8. Upon ME instantiation, the ONU sets this attribute to 5. (R,-W) (mandatory) (1-byte) |
| 94 | // |
| 95 | // Signal Degrade Threshold |
| 96 | // Signal degrade (SD) threshold: This attribute specifies the downstream BER threshold to detect |
| 97 | // the SD alarm. When this value is x, the BER threshold for SD is 10-x. Valid values are 4..10. |
| 98 | // The SD threshold must be lower than the SF threshold; i.e., x-> y. Upon ME instantiation, the |
| 99 | // ONU sets this attribute to 9. (R,-W) (mandatory) (1-byte) |
| 100 | // |
| 101 | // Arc |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 102 | // See clause A.1.4.3. (R,-W) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 103 | // |
| 104 | // Arc Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 105 | // See clause A.1.4.3. (R,-W) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 106 | // |
| 107 | // Optical Signal Level |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 108 | // This attribute reports the current measurement of the total downstream optical signal level. Its |
| 109 | // value is a 2s complement integer referred to 1- mW (i.e., 1-dBm), with 0.002 dB granularity. (R) |
| 110 | // (optional) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 111 | // |
| 112 | // Lower Optical Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 113 | // This attribute specifies the optical level the ONU uses to declare the downstream low received |
| 114 | // optical power alarm. Valid values are -127 dBm (coded as 254) to 0 dBm (coded as 0) in 0.5 dB |
| 115 | // increments. The default value 0xFF selects the ONU's internal policy. (R,-W) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 116 | // |
| 117 | // Upper Optical Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 118 | // This attribute specifies the optical level the ONU uses to declare the downstream high received |
| 119 | // optical power alarm. Valid values are -127 dBm (coded as 254) to 0 dBm (coded as 0) in 0.5 dB |
| 120 | // increments. The default value 0xFF selects the ONU's internal policy. (R,-W) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 121 | // |
| 122 | // Onu Response Time |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 123 | // This attribute indicates the ONU's actual response time. This attribute is in the range |
| 124 | // 34..36-us. Although this attribute is expressed in nanoseconds, its accuracy is likely to be |
| 125 | // more coarse. Furthermore, the value may change from one activation cycle to the next. Valid |
| 126 | // values are: |
| 127 | // |
| 128 | // 0 (Null, function not supported) |
| 129 | // |
| 130 | // 34000 to 36000 (response time in nanoseconds) |
| 131 | // |
| 132 | // All other values reserved |
| 133 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 134 | // (R) (optional) (2-bytes) |
| 135 | // |
| 136 | // Transmit Optical Level |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 137 | // This attribute reports the current measurement of mean optical launch power. Its value is a 2s |
| 138 | // complement integer referred to 1-mW (i.e., 1-dBm), with 0.002 dB granularity. (R) (optional) |
| 139 | // (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 140 | // |
| 141 | // Lower Transmit Power Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 142 | // This attribute specifies the minimum mean optical launch power that the ONU uses to declare the |
| 143 | // low transmit optical power alarm. Its value is a 2s complement integer referred to 1-mW (i.e., |
| 144 | // dBm), with 0.5-dB granularity. The default value -63.5 (0x81) selects the ONU's internal policy. |
| 145 | // (R,-W) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 146 | // |
| 147 | // Upper Transmit Power Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 148 | // This attribute specifies the maximum mean optical launch power that the ONU uses to declare the |
| 149 | // high transmit optical power alarm. Its value is a 2s complement integer referred to 1-mW (i.e., |
| 150 | // dBm), with 0.5-dB granularity. The default value -63.5 (0x81) selects the ONU's internal policy. |
| 151 | // (R,-W) (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 152 | // |
| 153 | type AniG struct { |
| 154 | ManagedEntityDefinition |
| 155 | Attributes AttributeValueMap |
| 156 | } |
| 157 | |
| 158 | func init() { |
| 159 | anigBME = &ManagedEntityDefinition{ |
| 160 | Name: "AniG", |
| 161 | ClassID: 263, |
| 162 | MessageTypes: mapset.NewSetWith( |
| 163 | Get, |
| 164 | Set, |
| 165 | Test, |
| 166 | ), |
| 167 | AllowedAttributeMask: 0xffff, |
| 168 | AttributeDefinitions: AttributeDefinitionMap{ |
| 169 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 170 | 1: ByteField("SrIndication", EnumerationAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1), |
| 171 | 2: Uint16Field("TotalTcontNumber", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2), |
| 172 | 3: Uint16Field("GemBlockLength", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3), |
| 173 | 4: ByteField("PiggybackDbaReporting", EnumerationAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4), |
| 174 | 5: ByteField("Deprecated", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, true, 5), |
| 175 | 6: ByteField("SignalFailThreshold", UnsignedIntegerAttributeType, 0x0400, 5, mapset.NewSetWith(Read, Write), false, false, false, 6), |
| 176 | 7: ByteField("SignalDegradeThreshold", UnsignedIntegerAttributeType, 0x0200, 9, mapset.NewSetWith(Read, Write), false, false, false, 7), |
| 177 | 8: ByteField("Arc", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), true, true, false, 8), |
| 178 | 9: ByteField("ArcInterval", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, true, false, 9), |
| 179 | 10: Uint16Field("OpticalSignalLevel", SignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10), |
| 180 | 11: ByteField("LowerOpticalThreshold", SignedIntegerAttributeType, 0x0020, 255, mapset.NewSetWith(Read, Write), false, true, false, 11), |
| 181 | 12: ByteField("UpperOpticalThreshold", SignedIntegerAttributeType, 0x0010, 255, mapset.NewSetWith(Read, Write), false, true, false, 12), |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 182 | 13: Uint16Field("OnuResponseTime", UnsignedIntegerAttributeType, 0x0008, 35000, mapset.NewSetWith(Read), false, true, false, 13), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 183 | 14: Uint16Field("TransmitOpticalLevel", SignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read), false, true, false, 14), |
| 184 | 15: ByteField("LowerTransmitPowerThreshold", SignedIntegerAttributeType, 0x0002, 129, mapset.NewSetWith(Read, Write), false, true, false, 15), |
| 185 | 16: ByteField("UpperTransmitPowerThreshold", SignedIntegerAttributeType, 0x0001, 129, mapset.NewSetWith(Read, Write), false, true, false, 16), |
| 186 | }, |
| 187 | Access: CreatedByOnu, |
| 188 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 189 | Alarms: AlarmMap{ |
| 190 | 0: "Low received optical power", |
| 191 | 1: "High received optical power", |
| 192 | 2: "SF", |
| 193 | 3: "SD", |
| 194 | 4: "Low transmit optical power", |
| 195 | 5: "High transmit optical power", |
| 196 | 6: "Laser bias current", |
| 197 | }, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 198 | } |
| 199 | } |
| 200 | |
| 201 | // NewAniG (class ID 263) creates the basic |
| 202 | // Managed Entity definition that is used to validate an ME of this type that |
| 203 | // is received from or transmitted to the OMCC. |
| 204 | func NewAniG(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 205 | return NewManagedEntity(*anigBME, params...) |
| 206 | } |