blob: 5df9566a9638ad9c05978d6ff3e184da5b800362 [file] [log] [blame]
Holger Hildebrandtfa074992020-03-27 15:42:06 +00001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00005 * 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
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +000011 * 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. Bainbridged80007b2021-04-12 12:22:29 +000017/*
Holger Hildebrandtfa074992020-03-27 15:42:06 +000018 * 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// OnuPowerSheddingClassID is the 16-bit ID for the OMCI
29// Managed entity ONU power shedding
mpagenko836a1fd2021-11-01 16:12:42 +000030const OnuPowerSheddingClassID = ClassID(133) // 0x0085
Holger Hildebrandtfa074992020-03-27 15:42:06 +000031
32var onupowersheddingBME *ManagedEntityDefinition
33
mpagenko836a1fd2021-11-01 16:12:42 +000034// OnuPowerShedding (Class ID: #133 / 0x0085)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000035// 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
mpagenko836a1fd2021-11-01 16:12:42 +000056// This attribute uniquely identifies each instance of this ME. There is only one instance, number
57// 0. (R) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000058//
59// Restore Power Timer Reset Interval
mpagenko836a1fd2021-11-01 16:12:42 +000060// 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.
Holger Hildebrandtfa074992020-03-27 15:42:06 +000069//
70// Data Class Shedding Interval
mpagenko836a1fd2021-11-01 16:12:42 +000071// (R,-W) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000072//
73// Voice Class Shedding Interval
mpagenko836a1fd2021-11-01 16:12:42 +000074// 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)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000076//
77// Video Overlay Class Shedding Interval
mpagenko836a1fd2021-11-01 16:12:42 +000078// (R,-W) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000079//
80// Video Return Class Shedding Interval
mpagenko836a1fd2021-11-01 16:12:42 +000081// (R,-W) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000082//
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
mpagenko836a1fd2021-11-01 16:12:42 +000087// (R,-W) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000088//
89// Ces Class Shedding Interval
mpagenko836a1fd2021-11-01 16:12:42 +000090// (R,-W) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000091//
92// Frame Class Shedding Interval
mpagenko836a1fd2021-11-01 16:12:42 +000093// (R,-W) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000094//
95// Sdh_Sonet Class Shedding Interval
96// Sdh-sonet class shedding interval: (R,-W) (mandatory) (2-bytes)
97//
98// Shedding Status
mpagenko836a1fd2021-11-01 16:12:42 +000099// 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//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000122// 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//
125type OnuPowerShedding struct {
126 ManagedEntityDefinition
127 Attributes AttributeValueMap
128}
129
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000130// Attribute name constants
131
132const OnuPowerShedding_RestorePowerTimerResetInterval = "RestorePowerTimerResetInterval"
133const OnuPowerShedding_DataClassSheddingInterval = "DataClassSheddingInterval"
134const OnuPowerShedding_VoiceClassSheddingInterval = "VoiceClassSheddingInterval"
135const OnuPowerShedding_VideoOverlayClassSheddingInterval = "VideoOverlayClassSheddingInterval"
136const OnuPowerShedding_VideoReturnClassSheddingInterval = "VideoReturnClassSheddingInterval"
137const OnuPowerShedding_DigitalSubscriberLineClassSheddingInterval = "DigitalSubscriberLineClassSheddingInterval"
138const OnuPowerShedding_AtmClassSheddingInterval = "AtmClassSheddingInterval"
139const OnuPowerShedding_CesClassSheddingInterval = "CesClassSheddingInterval"
140const OnuPowerShedding_FrameClassSheddingInterval = "FrameClassSheddingInterval"
141const OnuPowerShedding_SdhSonetClassSheddingInterval = "SdhSonetClassSheddingInterval"
142const OnuPowerShedding_SheddingStatus = "SheddingStatus"
143
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000144func init() {
145 onupowersheddingBME = &ManagedEntityDefinition{
146 Name: "OnuPowerShedding",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000147 ClassID: OnuPowerSheddingClassID,
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000148 MessageTypes: mapset.NewSetWith(
149 Get,
150 Set,
151 ),
152 AllowedAttributeMask: 0xffe0,
153 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000154 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
155 1: Uint16Field(OnuPowerShedding_RestorePowerTimerResetInterval, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
156 2: Uint16Field(OnuPowerShedding_DataClassSheddingInterval, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
157 3: Uint16Field(OnuPowerShedding_VoiceClassSheddingInterval, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
158 4: Uint16Field(OnuPowerShedding_VideoOverlayClassSheddingInterval, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
159 5: Uint16Field(OnuPowerShedding_VideoReturnClassSheddingInterval, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
160 6: Uint16Field(OnuPowerShedding_DigitalSubscriberLineClassSheddingInterval, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
161 7: Uint16Field(OnuPowerShedding_AtmClassSheddingInterval, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
162 8: Uint16Field(OnuPowerShedding_CesClassSheddingInterval, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
163 9: Uint16Field(OnuPowerShedding_FrameClassSheddingInterval, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, false, false, 9),
164 10: Uint16Field(OnuPowerShedding_SdhSonetClassSheddingInterval, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read, Write), false, false, false, 10),
165 11: Uint16Field(OnuPowerShedding_SheddingStatus, UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), true, true, false, 11),
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000166 },
167 Access: CreatedByOnu,
168 Support: UnknownSupport,
169 }
170}
171
172// NewOnuPowerShedding (class ID 133) creates the basic
173// Managed Entity definition that is used to validate an ME of this type that
174// is received from or transmitted to the OMCC.
175func NewOnuPowerShedding(params ...ParamData) (*ManagedEntity, OmciErrors) {
176 return NewManagedEntity(*onupowersheddingBME, params...)
177}