blob: 4022649a1f18c6302fa5b9689d20cf8ce9e80609 [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Matteo Scandolof9d43412021-01-12 11:11:34 -08003 * Copyright 2020-present Open Networking Foundation
4
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07005 * 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
Matteo Scandolof9d43412021-01-12 11:11:34 -08008
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07009 * http://www.apache.org/licenses/LICENSE-2.0
Matteo Scandolof9d43412021-01-12 11:11:34 -080010
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070011 * 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 */
Matteo Scandolof9d43412021-01-12 11:11:34 -080023
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070024package generated
25
26import "github.com/deckarep/golang-set"
27
Matteo Scandolof9d43412021-01-12 11:11:34 -080028// PriorityQueueClassID is the 16-bit ID for the OMCI
29// Managed entity Priority queue
30const PriorityQueueClassID ClassID = ClassID(277)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
32var priorityqueueBME *ManagedEntityDefinition
33
34// PriorityQueue (class ID #277)
Matteo Scandolof9d43412021-01-12 11:11:34 -080035// NOTE 1 - In [ITU-T G.984.4], this is called a priority queue-G.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070036//
37// This ME specifies the priority queue used by a GEM port network CTP in the upstream direction.
38// The upstream priority queue ME is also related to a T-CONT ME. By default, this relationship is
39// fixed by the ONU hardware architecture, but some ONUs may also permit the relationship to be
40// configured through the OMCI, as indicated by the QoS configuration flexibility attribute of the
41// ONU2G ME.
42//
43// In the downstream direction, priority queues are associated with UNIs. Again, the association is
44// fixed by default, but some ONUs may permit the association to be configured through the OMCI.
45//
46// If an ONU as a whole contains priority queues, it instantiates these queues autonomously.
47// Priority queues may also be localized to pluggable circuit packs, in which case the ONU creates
48// and deletes them in accordance with circuit pack pre-provisioning and the equipped
49// configuration.
50//
51// The OLT can find all the queues by reading the priority queue ME instances. If the OLT tries to
52// retrieve a non-existent priority queue, the ONU denies the get action with an error indication.
53//
54// See also Appendix II.
55//
56// Priority queues can exist in the ONU core and circuit packs serving both UNI and ANI functions.
57// Therefore, they can be indirectly created and destroyed through cardholder provisioning actions.
58//
59// In the upstream direction, the weight attribute permits the configuring of an optional traffic
60// scheduler. Several attributes support back pressure operation, whereby a back-pressure signal is
61// sent backwards and causes the attached terminal to temporarily suspend sending data.
62//
63// In the downstream direction, strict priority discipline among the queues serving a given UNI is
64// the default, with priorities established through the related port attribute. If two or more non-
65// empty queues have the same priority, capacity is allocated among them in proportion to their
66// weights. Note that the details of the downstream model differ from those of the upstream model.
67//
68// The yellow packet drop thresholds specify the drop probability for a packet that has been marked
69// yellow (drop eligible) by a traffic descriptor or by external equipment such as a residential
70// gateway (RG). If the current average queue occupancy is less than the minimum threshold, the
71// yellow packet drop probability is zero. If the current average queue occupancy is greater than
72// or equal to the maximum threshold, the yellow packet drop probability is one. The yellow drop
73// probability increases linearly between 0 and max_p as the current average queue occupancy
74// increases from the minimum to the maximum threshold.
75//
76// The same model can be configured for green packets, those regarded as being within the traffic
77// contract.
78//
79// Drop precedence colour marking indicates the method by which a packet is marked as drop eligible
80// (yellow). For discard eligibility indicator (DEI) and priority code point (PCP) marking, a drop
81// eligible indicator is equivalent to yellow colour; otherwise, the colour is green. For
82// differentiated services code point (DSCP) assured forwarding (AF) marking, the lowest drop
83// precedence is equivalent to green; otherwise, the colour is yellow.
84//
85// Relationships
86// One or more instances of this ME are associated with the ONU-G ME to model upstream priority
87// queues if the traffic management option attribute in the ONU-G ME is 0 or 2.//// One or more instances of this ME are associated with a PPTP UNI ME as downstream priority
88// queues. Downstream priority queues may or may not be provided for a virtual Ethernet interface
89// point (VEIP).
90//
91// Attributes
92// Managed Entity Id
93// Managed entity ID: This attribute uniquely identifies each instance of this ME. The MSB
Matteo Scandolof9d43412021-01-12 11:11:34 -080094// represents the direction (1: upstream, 0:-downstream). The 15 LSBs represent a queue ID. The
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070095// queue ID is numbered in ascending order by the ONU itself. It is strongly encouraged that the
96// queue ID be formulated to simplify finding related queues. One way to do this is to number the
97// queues such that the related port attributes are in ascending order (for the downstream and
98// upstream queues separately). The range of downstream queue ids is 0 to 0x7FFF and the range of
Matteo Scandolof9d43412021-01-12 11:11:34 -080099// upstream queue ids is 0x8000 to 0xFFFF. (R) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700100//
101// Queue Configuration Option
102// Queue configuration option: This attribute identifies the buffer partitioning policy. The value
103// 1 means that several queues share one buffer of maximum queue size, while the value 0 means that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800104// each queue has an individual buffer of maximum queue size. (R) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700105//
106// Maximum Queue Size
Matteo Scandolof9d43412021-01-12 11:11:34 -0800107// NOTE 2 - In this and the other similar attributes of the priority queue ME, some legacy
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700108// implementations may take the queue scale factor from the GEM block length attribute of the ANI-G
109// ME. This option is discouraged in new implementations.
110//
111// Allocated Queue Size
112// Allocated queue size: This attribute identifies the allocated size of this queue, in bytes,
113// scaled by the priority queue scale factor attribute of the ONU2G. (R, W) (mandatory) (2 bytes)
114//
115// Discard_Block Counter Reset Interval
116// Discard-block counter reset interval: This attribute represents the interval in milliseconds at
Matteo Scandolof9d43412021-01-12 11:11:34 -0800117// which the counter resets itself. (R,-W) (optional) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700118//
119// Threshold Value For Discarded Blocks Due To Buffer Overflow
120// Threshold value for discarded blocks due to buffer overflow: This attribute specifies the
121// threshold for the number of bytes (scaled by the priority queue scale factor attribute of the
122// ONU2G) discarded on this queue due to buffer overflow. Its value controls the declaration of the
Matteo Scandolof9d43412021-01-12 11:11:34 -0800123// block loss alarm. (R, W) (optional) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700124//
125// Related Port
126// If flexible configuration is not supported, the ONU should reject an attempt to set the related
127// port with a parameter error result-reason code.
128//
129// Traffic Scheduler Pointer
130// The ONU should reject an attempt to violate these conditions with a parameter error result-
131// reason code.
132//
133// Weight
134// Weight: This attribute represents weight for WRR scheduling. At a given priority level, capacity
135// is distributed to non-empty queues in proportion to their weights. In the upstream direction,
136// this weight is meaningful if several priority queues are associated with a traffic scheduler or
137// T-CONT whose policy is WRR. In the downstream direction, this weight is used by a UNI in a WRR
Matteo Scandolof9d43412021-01-12 11:11:34 -0800138// fashion. Upon ME instantiation, the ONU sets this attribute to 1. (R,-W) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700139//
140// Back Pressure Operation
141// Back pressure operation: This attribute enables (0) or disables (1) back pressure operation. Its
Matteo Scandolof9d43412021-01-12 11:11:34 -0800142// default value is 0. (R,-W) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700143//
144// Back Pressure Time
145// Back pressure time: This attribute specifies the duration in microseconds of the backpressure
146// signal. It can be used as a pause time for an Ethernet UNI. Upon ME instantiation, the ONU sets
Matteo Scandolof9d43412021-01-12 11:11:34 -0800147// this attribute to 0. (R,-W) (mandatory) (4-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700148//
149// Back Pressure Occur Queue Threshold
150// Back pressure occur queue threshold: This attribute identifies the threshold queue occupancy, in
151// bytes, scaled by the priority queue scale factor attribute of the ONU2G, to start sending a
Matteo Scandolof9d43412021-01-12 11:11:34 -0800152// back-pressure signal. (R, W) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700153//
154// Back Pressure Clear Queue Threshold
155// Back pressure clear queue threshold: This attribute identifies the threshold queue occupancy, in
156// bytes, scaled by the priority queue scale factor attribute of the ONU2G, to stop sending a back-
Matteo Scandolof9d43412021-01-12 11:11:34 -0800157// pressure signal. (R, W) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700158//
159// Packet Drop Queue Thresholds
Matteo Scandolof9d43412021-01-12 11:11:34 -0800160// Packet drop queue thresholds: This attribute is a composite of four 2-byte values, a minimum and
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700161// a maximum threshold, measured in bytes, scaled by the priority queue scale factor attribute of
162// the ONU2-G, for green and yellow packets. The first value is the minimum green threshold, the
163// queue occupancy below which all green packets are admitted to the queue. The second value is the
164// maximum green threshold, the queue occupancy at or above which all green packets are discarded.
165// The third value is the minimum yellow threshold, the queue occupancy below which all yellow
166// packets are admitted to the queue. The fourth value is the maximum yellow threshold, the queue
167// occupancy at or above which all yellow packets are discarded. The default is that all thresholds
Matteo Scandolof9d43412021-01-12 11:11:34 -0800168// take the value of the maximum queue size. (R,-W) (optional) (8-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700169//
170// Packet Drop Max_P
Matteo Scandolof9d43412021-01-12 11:11:34 -0800171// Packet drop max_p: This attribute is a composite of two 1-byte values, the probability of
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700172// dropping a coloured packet when the queue occupancy lies just below the maximum threshold for
173// packets of that colour. The first value is the green packet max_p, and the second value is the
174// yellow packet max_p. The probability, max_p, is determined by adding one to the unsigned value
175// (0..255) of this attribute and dividing the result by 256. The default for each value is 255.
Matteo Scandolof9d43412021-01-12 11:11:34 -0800176// (R,-W) (optional) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700177//
178// Queue Drop W_Q
179// Queue drop w_q: This attribute determines the averaging coefficient, w_q, as described in
180// [b-Floyd]. The averaging coefficient, w_q, is equal to 2Queue_drop_w_q. For example, when queue
Matteo Scandolof9d43412021-01-12 11:11:34 -0800181// drop_w_q has the value 9, the averaging coefficient, w_q, is 1/512-= 0.001-9. The default value
182// is 9. (R,-W) (optional) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700183//
184// Drop Precedence Colour Marking
Matteo Scandolof9d43412021-01-12 11:11:34 -0800185// (R,-W) (optional) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700186//
187type PriorityQueue struct {
188 ManagedEntityDefinition
189 Attributes AttributeValueMap
190}
191
192func init() {
193 priorityqueueBME = &ManagedEntityDefinition{
194 Name: "PriorityQueue",
195 ClassID: 277,
196 MessageTypes: mapset.NewSetWith(
197 Get,
198 Set,
199 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800200 AllowedAttributeMask: 0xffff,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700201 AttributeDefinitions: AttributeDefinitionMap{
Matteo Scandolof9d43412021-01-12 11:11:34 -0800202 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
203 1: ByteField("QueueConfigurationOption", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1),
204 2: Uint16Field("MaximumQueueSize", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
205 3: Uint16Field("AllocatedQueueSize", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
206 4: Uint16Field("DiscardBlockCounterResetInterval", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, true, false, 4),
207 5: Uint16Field("ThresholdValueForDiscardedBlocksDueToBufferOverflow", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, true, false, 5),
208 6: Uint32Field("RelatedPort", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
209 7: Uint16Field("TrafficSchedulerPointer", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
210 8: ByteField("Weight", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
211 9: Uint16Field("BackPressureOperation", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, false, false, 9),
212 10: Uint32Field("BackPressureTime", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read, Write), false, false, false, 10),
213 11: Uint16Field("BackPressureOccurQueueThreshold", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, Write), false, false, false, 11),
214 12: Uint16Field("BackPressureClearQueueThreshold", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, false, false, 12),
215 13: Uint64Field("PacketDropQueueThresholds", UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read, Write), false, true, false, 13),
216 14: Uint16Field("PacketDropMaxP", UnsignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read, Write), false, true, false, 14),
217 15: ByteField("QueueDropWQ", UnsignedIntegerAttributeType, 0x0002, 0, mapset.NewSetWith(Read, Write), false, true, false, 15),
218 16: ByteField("DropPrecedenceColourMarking", UnsignedIntegerAttributeType, 0x0001, 0, mapset.NewSetWith(Read, Write), false, true, false, 16),
219 },
220 Access: CreatedByOnu,
221 Support: UnknownSupport,
222 Alarms: AlarmMap{
223 0: "Block loss",
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700224 },
225 }
226}
227
Matteo Scandolof9d43412021-01-12 11:11:34 -0800228// NewPriorityQueue (class ID 277) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700229// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800230// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700231func NewPriorityQueue(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800232 return NewManagedEntity(*priorityqueueBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700233}