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 | // OnuPowerSheddingClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity ONU power shedding |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const OnuPowerSheddingClassID = ClassID(133) // 0x0085 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var onupowersheddingBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // OnuPowerShedding (Class ID: #133 / 0x0085) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME models the ONU's ability to shed services when the ONU goes into battery operation mode |
| 36 | // after AC power failure. Shedding classes are defined in the following table, which may span |
| 37 | // multiple circuit pack types. This feature works in conjunction with the power shed override |
| 38 | // attribute of the circuit pack ME, which can selectively prevent power shedding of priority |
| 39 | // ports. |
| 40 | // |
| 41 | // An ONU that supports power shedding automatically creates an instance of this ME. |
| 42 | // |
| 43 | // The following table defines the binding of shedding class and PPTP type. The coding is taken |
| 44 | // from Table 9.1.5-1. In the case of hybrid circuit pack types, multiple shedding classes may |
| 45 | // affect a circuit pack if the hardware is capable of partial power shedding. |
| 46 | // |
| 47 | // An ONU may choose to model its ports with the port-mapping package of clause 9.1.8, rather than |
| 48 | // with real or virtual circuit packs. In this case, power shedding pertains to individual PPTPs |
| 49 | // (listed in column 2 of the table). |
| 50 | // |
| 51 | // Relationships |
| 52 | // One instance of this ME is associated with the ONU ME. |
| 53 | // |
| 54 | // Attributes |
| 55 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 56 | // This attribute uniquely identifies each instance of this ME. There is only one instance, number |
| 57 | // 0. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 58 | // |
| 59 | // Restore Power Timer Reset Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 60 | // The time delay, in seconds, before resetting the power-shedding timers after full power |
| 61 | // restoration. Upon ME instantiation, the ONU sets this attribute to 0. (R,-W) (mandatory) |
| 62 | // (2-bytes) |
| 63 | // |
| 64 | // For each class of service (CoS), an interval attribute is defined below. The value 0 disables |
| 65 | // power shedding, while the value 1 enables immediate power shedding, i.e., as soon as AC power |
| 66 | // fails. Other values specify the time, in seconds, to keep the service active after AC failure |
| 67 | // before shutting them down and shedding power. Upon ME instantiation, the ONU sets each of the |
| 68 | // interval attributes to 0. |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 69 | // |
| 70 | // Data Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 71 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 72 | // |
| 73 | // Voice Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 74 | // This attribute only pertains to voice services that terminate on the ONU and are under the |
| 75 | // management control of the OMCI. (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 76 | // |
| 77 | // Video Overlay Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 78 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 79 | // |
| 80 | // Video Return Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 81 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 82 | // |
| 83 | // Digital Subscriber Line Class Shedding Interval |
| 84 | // Digital subscriber line (DSL) class shedding interval: (R,-W) (mandatory) (2-bytes) |
| 85 | // |
| 86 | // Atm Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 87 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 88 | // |
| 89 | // Ces Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 90 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 91 | // |
| 92 | // Frame Class Shedding Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 93 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 94 | // |
| 95 | // Sdh_Sonet Class Shedding Interval |
| 96 | // Sdh-sonet class shedding interval: (R,-W) (mandatory) (2-bytes) |
| 97 | // |
| 98 | // Shedding Status |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 99 | // Binary indication of power-shedding status for each shedding class. If this 2 byte field is |
| 100 | // depicted 0b ABCD EFGH IJKL MNOP, its bits are assigned as follows- |
| 101 | // |
| 102 | // A Data class |
| 103 | // |
| 104 | // B Voice class |
| 105 | // |
| 106 | // C Video overlay class |
| 107 | // |
| 108 | // D Video return class |
| 109 | // |
| 110 | // E DSL class |
| 111 | // |
| 112 | // F ATM class |
| 113 | // |
| 114 | // G CES class |
| 115 | // |
| 116 | // H Frame class |
| 117 | // |
| 118 | // I Sdh-sonet class |
| 119 | // |
| 120 | // J..P Reserved and set to 0 |
| 121 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 122 | // The ONU sets each bit to 1 when power shedding is active, and clears it to 0 when the service is |
| 123 | // restored. (R) (optional) (2-bytes) |
| 124 | // |
| 125 | type OnuPowerShedding struct { |
| 126 | ManagedEntityDefinition |
| 127 | Attributes AttributeValueMap |
| 128 | } |
| 129 | |
| 130 | func init() { |
| 131 | onupowersheddingBME = &ManagedEntityDefinition{ |
| 132 | Name: "OnuPowerShedding", |
| 133 | ClassID: 133, |
| 134 | MessageTypes: mapset.NewSetWith( |
| 135 | Get, |
| 136 | Set, |
| 137 | ), |
| 138 | AllowedAttributeMask: 0xffe0, |
| 139 | AttributeDefinitions: AttributeDefinitionMap{ |
| 140 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 141 | 1: Uint16Field("RestorePowerTimerResetInterval", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1), |
| 142 | 2: Uint16Field("DataClassSheddingInterval", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2), |
| 143 | 3: Uint16Field("VoiceClassSheddingInterval", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3), |
| 144 | 4: Uint16Field("VideoOverlayClassSheddingInterval", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4), |
| 145 | 5: Uint16Field("VideoReturnClassSheddingInterval", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5), |
| 146 | 6: Uint16Field("DigitalSubscriberLineClassSheddingInterval", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6), |
| 147 | 7: Uint16Field("AtmClassSheddingInterval", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7), |
| 148 | 8: Uint16Field("CesClassSheddingInterval", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8), |
| 149 | 9: Uint16Field("FrameClassSheddingInterval", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, false, false, 9), |
| 150 | 10: Uint16Field("SdhSonetClassSheddingInterval", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read, Write), false, false, false, 10), |
| 151 | 11: Uint16Field("SheddingStatus", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), true, true, false, 11), |
| 152 | }, |
| 153 | Access: CreatedByOnu, |
| 154 | Support: UnknownSupport, |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | // NewOnuPowerShedding (class ID 133) creates the basic |
| 159 | // Managed Entity definition that is used to validate an ME of this type that |
| 160 | // is received from or transmitted to the OMCC. |
| 161 | func NewOnuPowerShedding(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 162 | return NewManagedEntity(*onupowersheddingBME, params...) |
| 163 | } |