blob: 3a22c362a023e7fb30150f528927f46cb7f34200 [file] [log] [blame]
Andrea Campanella10426e22021-10-15 17:58:04 +02001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
Andrea Campanella10426e22021-10-15 17:58:04 +02005 * 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
Elia Battiston9bfe1102022-02-03 10:38:03 +01008 *
Andrea Campanella10426e22021-10-15 17:58:04 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
Andrea Campanella10426e22021-10-15 17:58:04 +020011 * 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 */
17/*
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
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// OnuDynamicPowerManagementControlClassID is the 16-bit ID for the OMCI
29// Managed entity ONU dynamic power management control
30const OnuDynamicPowerManagementControlClassID = ClassID(336) // 0x0150
31
32var onudynamicpowermanagementcontrolBME *ManagedEntityDefinition
33
34// OnuDynamicPowerManagementControl (Class ID: #336 / 0x0150)
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
47// This attribute uniquely identifies each instance of this ME. There is only one instance, number
48// 0. (R) (mandatory) (2-bytes)
49//
50// Power Reduction Management Capability
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//
70// 5..255 Reserved
71//
72// Power Reduction Management Mode
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)
77//
78// Itransinit
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)
85//
86// Itxinit
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)
92//
93// Maximum Sleep Interval
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)
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
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)
109//
110// Minimum Active Held Interval
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)
113//
114// Maximum Sleep Interval Extension
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//
124// (R,-W) (optional) (8-bytes)
125//
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//
134// Ethernet Passive Optical Network Epon Capability Extension
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.
139//
140// Epon Setup Extension
141// The bits are assigned as follows.
142//
143// This attribute specifies EPON specific configurations for the dynamic power management control.
144//
145// Missing Consecutive Bursts Threshold
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)
149//
150type OnuDynamicPowerManagementControl struct {
151 ManagedEntityDefinition
152 Attributes AttributeValueMap
153}
154
Elia Battiston9bfe1102022-02-03 10:38:03 +0100155// Attribute name constants
156
157const OnuDynamicPowerManagementControl_PowerReductionManagementCapability = "PowerReductionManagementCapability"
158const OnuDynamicPowerManagementControl_PowerReductionManagementMode = "PowerReductionManagementMode"
159const OnuDynamicPowerManagementControl_Itransinit = "Itransinit"
160const OnuDynamicPowerManagementControl_Itxinit = "Itxinit"
161const OnuDynamicPowerManagementControl_MaximumSleepInterval = "MaximumSleepInterval"
162const OnuDynamicPowerManagementControl_MaximumReceiverOffInterval = "MaximumReceiverOffInterval"
163const OnuDynamicPowerManagementControl_MinimumAwareInterval = "MinimumAwareInterval"
164const OnuDynamicPowerManagementControl_MinimumActiveHeldInterval = "MinimumActiveHeldInterval"
165const OnuDynamicPowerManagementControl_MaximumSleepIntervalExtension = "MaximumSleepIntervalExtension"
166const OnuDynamicPowerManagementControl_EthernetPassiveOpticalNetworkEponCapabilityExtension = "EthernetPassiveOpticalNetworkEponCapabilityExtension"
167const OnuDynamicPowerManagementControl_EponSetupExtension = "EponSetupExtension"
168const OnuDynamicPowerManagementControl_MissingConsecutiveBurstsThreshold = "MissingConsecutiveBurstsThreshold"
169
Andrea Campanella10426e22021-10-15 17:58:04 +0200170func init() {
171 onudynamicpowermanagementcontrolBME = &ManagedEntityDefinition{
172 Name: "OnuDynamicPowerManagementControl",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100173 ClassID: OnuDynamicPowerManagementControlClassID,
Andrea Campanella10426e22021-10-15 17:58:04 +0200174 MessageTypes: mapset.NewSetWith(
175 Get,
176 Set,
177 ),
178 AllowedAttributeMask: 0xfff0,
179 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100180 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
181 1: ByteField(OnuDynamicPowerManagementControl_PowerReductionManagementCapability, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1),
182 2: ByteField(OnuDynamicPowerManagementControl_PowerReductionManagementMode, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
183 3: Uint16Field(OnuDynamicPowerManagementControl_Itransinit, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3),
184 4: Uint16Field(OnuDynamicPowerManagementControl_Itxinit, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
185 5: Uint32Field(OnuDynamicPowerManagementControl_MaximumSleepInterval, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
186 6: Uint32Field(OnuDynamicPowerManagementControl_MaximumReceiverOffInterval, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
187 7: Uint32Field(OnuDynamicPowerManagementControl_MinimumAwareInterval, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
188 8: Uint16Field(OnuDynamicPowerManagementControl_MinimumActiveHeldInterval, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
189 9: Uint64Field(OnuDynamicPowerManagementControl_MaximumSleepIntervalExtension, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, true, false, 9),
190 10: ByteField(OnuDynamicPowerManagementControl_EthernetPassiveOpticalNetworkEponCapabilityExtension, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
191 11: ByteField(OnuDynamicPowerManagementControl_EponSetupExtension, UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, Write), false, true, false, 11),
192 12: Uint32Field(OnuDynamicPowerManagementControl_MissingConsecutiveBurstsThreshold, UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, false, false, 12),
Andrea Campanella10426e22021-10-15 17:58:04 +0200193 },
194 Access: CreatedByOnu,
195 Support: UnknownSupport,
196 }
197}
198
199// NewOnuDynamicPowerManagementControl (class ID 336) creates the basic
200// Managed Entity definition that is used to validate an ME of this type that
201// is received from or transmitted to the OMCC.
202func NewOnuDynamicPowerManagementControl(params ...ParamData) (*ManagedEntity, OmciErrors) {
203 return NewManagedEntity(*onudynamicpowermanagementcontrolBME, params...)
204}