blob: e791ace49fb11b1010478ed65b667cd07ee9ed8d [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
4
Chip Boling6e27b352020-02-14 09:10:01 -06005 * 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 Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
Chip Boling6e27b352020-02-14 09:10:01 -060011 * 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. Bainbridgeadf422d2021-04-09 16:06:41 +000017/*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * 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
Chip Boling610117d2021-09-09 11:24:34 -050030const OnuPowerSheddingClassID = ClassID(133) // 0x0085
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var onupowersheddingBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// OnuPowerShedding (Class ID: #133 / 0x0085)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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 Boling610117d2021-09-09 11:24:34 -050056// This attribute uniquely identifies each instance of this ME. There is only one instance, number
57// 0. (R) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060058//
59// Restore Power Timer Reset Interval
Chip Boling610117d2021-09-09 11:24:34 -050060// 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 Boling6e27b352020-02-14 09:10:01 -060069//
70// Data Class Shedding Interval
Chip Boling610117d2021-09-09 11:24:34 -050071// (R,-W) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060072//
73// Voice Class Shedding Interval
Chip Boling610117d2021-09-09 11:24:34 -050074// 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 Boling6e27b352020-02-14 09:10:01 -060076//
77// Video Overlay Class Shedding Interval
Chip Boling610117d2021-09-09 11:24:34 -050078// (R,-W) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060079//
80// Video Return Class Shedding Interval
Chip Boling610117d2021-09-09 11:24:34 -050081// (R,-W) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060082//
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 Boling610117d2021-09-09 11:24:34 -050087// (R,-W) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060088//
89// Ces Class Shedding Interval
Chip Boling610117d2021-09-09 11:24:34 -050090// (R,-W) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060091//
92// Frame Class Shedding Interval
Chip Boling610117d2021-09-09 11:24:34 -050093// (R,-W) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060094//
95// Sdh_Sonet Class Shedding Interval
96// Sdh-sonet class shedding interval: (R,-W) (mandatory) (2-bytes)
97//
98// Shedding Status
Chip Boling610117d2021-09-09 11:24:34 -050099// 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 Boling6e27b352020-02-14 09:10:01 -0600122// 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}