blob: e791ace49fb11b1010478ed65b667cd07ee9ed8d [file] [log] [blame]
Matteo Scandolof9d43412021-01-12 11:11:34 -08001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
4
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
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
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 */
Girish Gowdra161d27a2021-05-05 12:01:44 -070017/*
Matteo Scandolof9d43412021-01-12 11:11:34 -080018 * 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
Andrea Campanella10426e22021-10-15 17:58:04 +020030const OnuPowerSheddingClassID = ClassID(133) // 0x0085
Matteo Scandolof9d43412021-01-12 11:11:34 -080031
32var onupowersheddingBME *ManagedEntityDefinition
33
Andrea Campanella10426e22021-10-15 17:58:04 +020034// OnuPowerShedding (Class ID: #133 / 0x0085)
Matteo Scandolof9d43412021-01-12 11:11:34 -080035// 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
Andrea Campanella10426e22021-10-15 17:58:04 +020056// This attribute uniquely identifies each instance of this ME. There is only one instance, number
57// 0. (R) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080058//
59// Restore Power Timer Reset Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020060// 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.
Matteo Scandolof9d43412021-01-12 11:11:34 -080069//
70// Data Class Shedding Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020071// (R,-W) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080072//
73// Voice Class Shedding Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020074// 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)
Matteo Scandolof9d43412021-01-12 11:11:34 -080076//
77// Video Overlay Class Shedding Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020078// (R,-W) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080079//
80// Video Return Class Shedding Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020081// (R,-W) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080082//
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
Andrea Campanella10426e22021-10-15 17:58:04 +020087// (R,-W) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080088//
89// Ces Class Shedding Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020090// (R,-W) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080091//
92// Frame Class Shedding Interval
Andrea Campanella10426e22021-10-15 17:58:04 +020093// (R,-W) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080094//
95// Sdh_Sonet Class Shedding Interval
96// Sdh-sonet class shedding interval: (R,-W) (mandatory) (2-bytes)
97//
98// Shedding Status
Andrea Campanella10426e22021-10-15 17:58:04 +020099// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -0800122// 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
130func 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.
161func NewOnuPowerShedding(params ...ParamData) (*ManagedEntity, OmciErrors) {
162 return NewManagedEntity(*onupowersheddingBME, params...)
163}