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 | // OnuDynamicPowerManagementControlClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity ONU dynamic power management control |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const OnuDynamicPowerManagementControlClassID = ClassID(336) // 0x0150 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var onudynamicpowermanagementcontrolBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // OnuDynamicPowerManagementControl (Class ID: #336 / 0x0150) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME models the ONU's ability to enter power conservation modes in cooperation with the OLT |
| 36 | // in an ITU-T G.987 system. [ITUT G.987.3] originally specified two alternative modes, doze and |
| 37 | // cyclic sleep. The subsequent revision of [ITUT G.987.3] simplified the specification providing a |
| 38 | // single power conservation mode, watchful sleep. |
| 39 | // |
| 40 | // An ONU that supports power conservation modes automatically creates an instance of this ME. |
| 41 | // |
| 42 | // Relationships |
| 43 | // One instance of this ME is associated with the ONU ME. |
| 44 | // |
| 45 | // Attributes |
| 46 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 47 | // This attribute uniquely identifies each instance of this ME. There is only one instance, number |
| 48 | // 0. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 49 | // |
| 50 | // Power Reduction Management Capability |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 51 | // This attribute declares the ONU's support for managed power conservation modes, as defined in |
| 52 | // [ITUT G.987.3]. It is a bit map in which the bit value 0 indicates no support for the specified |
| 53 | // mode, while the bit value 1 indicates that the ONU does support the specified mode. (R) |
| 54 | // (mandatory) (1-byte) |
| 55 | // |
| 56 | // Codepoints are assigned as follows: |
| 57 | // |
| 58 | // Value Meaning |
| 59 | // |
| 60 | // 0 No support for power reduction |
| 61 | // |
| 62 | // 1 Doze mode supported |
| 63 | // |
| 64 | // 2 Cyclic sleep mode supported |
| 65 | // |
| 66 | // 3 Both doze and cyclic sleep modes supported |
| 67 | // |
| 68 | // 4 Watchful sleep mode supported |
| 69 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 70 | // 5..255 Reserved |
| 71 | // |
| 72 | // Power Reduction Management Mode |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 73 | // This attribute enables one or more of the ONU's managed power conservation modes. It is a bit |
| 74 | // map in which the bit value 0 disables the mode, while the value 1 enables the mode. Bit |
| 75 | // assignments are the same as those of the power reduction management capability attribute. The |
| 76 | // default value of each bit is 0. (R,-W) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 77 | // |
| 78 | // Itransinit |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 79 | // This attribute is the ONU vendor's statement of the complete transceiver initialization time: |
| 80 | // the worst-case time required for the ONU to regain full functionality when leaving the asleep |
| 81 | // state in cyclic sleep mode or low-power state in watchful sleep mode (i.e., turning on both the |
| 82 | // receiver and the transmitter and acquiring synchronization to the downstream flow), measured in |
| 83 | // units of 125-us frames. The value zero indicates that the sleeping ONU can respond to a |
| 84 | // bandwidth grant without delay. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 85 | // |
| 86 | // Itxinit |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 87 | // This attribute is the ONU vendor's statement of the transmitter initialization time: the time |
| 88 | // required for the ONU to regain full functionality when leaving the listen state (i.e., turning |
| 89 | // on the transmitter), measured in units of 125-us frames. The value zero indicates that the |
| 90 | // dozing ONU can respond to a bandwidth grant without delay. If watchful sleep is enabled, the ONU |
| 91 | // ignores this attribute. (R) (mandatory) (2 bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 92 | // |
| 93 | // Maximum Sleep Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 94 | // The Isleep/Ilowpower attribute specifies the maximum time the ONU spends in its asleep, listen, |
| 95 | // or low-power states, as a count of 125-us frames. Local or remote events may truncate the ONU's |
| 96 | // sojourn in these states. The default value of this attribute is 0. (R,-W) (mandatory) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 97 | // |
| 98 | // Maximum Receiver_Off Interval |
| 99 | // Maximum receiver-off interval: The Irxoff attribute specifies the maximum time the OLT can |
| 100 | // afford to wait from the moment it decides to wake up an ONU in the low-power state of the |
| 101 | // watchful sleep mode until the ONU is fully operational, specified as a count of 125-us frames. |
| 102 | // (R,-W) (mandatory) (4-bytes) |
| 103 | // |
| 104 | // Minimum Aware Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 105 | // The Iaware attribute specifies the time the ONU spends in its aware state, as a count of 125-us |
| 106 | // frames, before it re-enters asleep or listen states. Local or remote events may independently |
| 107 | // cause the ONU to enter an active state rather than returning to a sleep state. The default value |
| 108 | // of this attribute is 0. (R,-W) (mandatory) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 109 | // |
| 110 | // Minimum Active Held Interval |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 111 | // The Ihold attribute specifies the minimum time during which the ONU remains in the active held |
| 112 | // state, as a count of 125-us frames. Its initial value is zero. (R, W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 113 | // |
| 114 | // Maximum Sleep Interval Extension |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 115 | // Maximum sleep interval for doze mode specifies the maximum time the ONU spends in its listen |
| 116 | // state, as a count of 125-us frames. Local or remote events may truncate the ONU's sojourn in |
| 117 | // these states. The default value is 0. |
| 118 | // |
| 119 | // Maximum sleep interval for cyclic sleep mode specifies the maximum time the ONU spends in its |
| 120 | // asleep state, as a count of 125-us frames. Local or remote events may truncate the ONU's sojourn |
| 121 | // in these states. The default value is 0. If watchful sleep is enabled, the ONU ignores this |
| 122 | // attribute. |
| 123 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 124 | // (R,-W) (optional) (8-bytes) |
| 125 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 126 | // This attribute designates maximum sleep interval values for doze mode and cyclic sleep mode |
| 127 | // separately. When it supports this attribute, the ONU ignores the value of the maximum sleep |
| 128 | // interval attribute. |
| 129 | // |
| 130 | // Maximum sleep interval for doze mode 4-bytes |
| 131 | // |
| 132 | // Maximum sleep interval for cyclic sleep mode 4-bytes |
| 133 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 134 | // Ethernet Passive Optical Network Epon Capability Extension |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 135 | // Ethernet passive optical network (EPON) capability extension: This attribute declares EPON- |
| 136 | // specific capabilities for the dynamic power management control. |
| 137 | // |
| 138 | // Bits are assigned as follows. |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 139 | // |
| 140 | // Epon Setup Extension |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 141 | // The bits are assigned as follows. |
| 142 | // |
| 143 | // This attribute specifies EPON specific configurations for the dynamic power management control. |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 144 | // |
| 145 | // Missing Consecutive Bursts Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 146 | // The Clobi attribute specifies the maximum number of missing consecutive scheduled bursts from |
| 147 | // the ONU that the OLT is willing to tolerate without raising an alarm. The value of this |
| 148 | // attribute defaults to 4. (R,-W) (mandatory) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 149 | // |
| 150 | type OnuDynamicPowerManagementControl struct { |
| 151 | ManagedEntityDefinition |
| 152 | Attributes AttributeValueMap |
| 153 | } |
| 154 | |
| 155 | func init() { |
| 156 | onudynamicpowermanagementcontrolBME = &ManagedEntityDefinition{ |
| 157 | Name: "OnuDynamicPowerManagementControl", |
| 158 | ClassID: 336, |
| 159 | MessageTypes: mapset.NewSetWith( |
| 160 | Get, |
| 161 | Set, |
| 162 | ), |
| 163 | AllowedAttributeMask: 0xfff0, |
| 164 | AttributeDefinitions: AttributeDefinitionMap{ |
| 165 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 166 | 1: ByteField("PowerReductionManagementCapability", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1), |
| 167 | 2: ByteField("PowerReductionManagementMode", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2), |
| 168 | 3: Uint16Field("Itransinit", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3), |
| 169 | 4: Uint16Field("Itxinit", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4), |
| 170 | 5: Uint32Field("MaximumSleepInterval", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5), |
| 171 | 6: Uint32Field("MaximumReceiverOffInterval", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6), |
| 172 | 7: Uint32Field("MinimumAwareInterval", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7), |
| 173 | 8: Uint16Field("MinimumActiveHeldInterval", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8), |
| 174 | 9: Uint64Field("MaximumSleepIntervalExtension", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, true, false, 9), |
| 175 | 10: ByteField("EthernetPassiveOpticalNetworkEponCapabilityExtension", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10), |
| 176 | 11: ByteField("EponSetupExtension", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, Write), false, true, false, 11), |
| 177 | 12: Uint32Field("MissingConsecutiveBurstsThreshold", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, false, false, 12), |
| 178 | }, |
| 179 | Access: CreatedByOnu, |
| 180 | Support: UnknownSupport, |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | // NewOnuDynamicPowerManagementControl (class ID 336) creates the basic |
| 185 | // Managed Entity definition that is used to validate an ME of this type that |
| 186 | // is received from or transmitted to the OMCC. |
| 187 | func NewOnuDynamicPowerManagementControl(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 188 | return NewManagedEntity(*onudynamicpowermanagementcontrolBME, params...) |
| 189 | } |