Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 8 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 10 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 | */ |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // PriorityQueueClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Priority queue |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const PriorityQueueClassID = ClassID(277) // 0x0115 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var priorityqueueBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // PriorityQueue (Class ID: #277 / 0x0115) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // NOTE 1 - In [ITU-T G.984.4], this is called a priority queue-G. |
| 36 | // |
| 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 |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 93 | // This attribute uniquely identifies each instance of this ME. The MSB represents the direction |
| 94 | // (1: upstream, 0:-downstream). The 15 LSBs represent a queue ID. The queue ID is numbered in |
| 95 | // ascending order by the ONU itself. It is strongly encouraged that the queue ID be formulated to |
| 96 | // simplify finding related queues. One way to do this is to number the queues such that the |
| 97 | // related port attributes are in ascending order (for the downstream and upstream queues |
| 98 | // separately). The range of downstream queue ids is 0 to 0x7FFF and the range of upstream queue |
| 99 | // ids is 0x8000 to 0xFFFF. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 100 | // |
| 101 | // Queue Configuration Option |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 102 | // This attribute identifies the buffer partitioning policy. The value 1 means that several queues |
| 103 | // share one buffer of maximum queue size, while the value 0 means that each queue has an |
| 104 | // individual buffer of maximum queue size. (R) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 105 | // |
| 106 | // Maximum Queue Size |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 107 | // This attribute specifies the maximum size of the queue, in bytes, scaled by the priority queue |
| 108 | // scale factor attribute of the ONU2G. (R) (mandatory) (2 bytes) |
| 109 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 110 | // NOTE 2 - In this and the other similar attributes of the priority queue ME, some legacy |
| 111 | // implementations may take the queue scale factor from the GEM block length attribute of the ANI-G |
| 112 | // ME. This option is discouraged in new implementations. |
| 113 | // |
| 114 | // Allocated Queue Size |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 115 | // This attribute identifies the allocated size of this queue, in bytes, scaled by the priority |
| 116 | // queue scale factor attribute of the ONU2G. (R, W) (mandatory) (2 bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 117 | // |
| 118 | // Discard_Block Counter Reset Interval |
| 119 | // Discard-block counter reset interval: This attribute represents the interval in milliseconds at |
| 120 | // which the counter resets itself. (R,-W) (optional) (2-bytes) |
| 121 | // |
| 122 | // Threshold Value For Discarded Blocks Due To Buffer Overflow |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 123 | // This attribute specifies the threshold for the number of bytes (scaled by the priority queue |
| 124 | // scale factor attribute of the ONU2G) discarded on this queue due to buffer overflow. Its value |
| 125 | // controls the declaration of the block loss alarm. (R, W) (optional) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 126 | // |
| 127 | // Related Port |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 128 | // This attribute represents the slot, port/T-CONT and priority information associated with the |
| 129 | // instance of priority queue ME. This attribute comprises 4-bytes. |
| 130 | // |
| 131 | // In the upstream direction, the first 2-bytes are the ME ID of the associated T-CONT, the first |
| 132 | // byte of which is a slot number, the second byte a T-CONT number. In the downstream direction, |
| 133 | // the first byte is the slot number and the second byte is the port number of the queue's |
| 134 | // destination port. |
| 135 | // |
| 136 | // The last 2-bytes represent the priority of this queue. The range of priority is 0 to 0x0FFF. The |
| 137 | // value 0 indicates the highest priority and 0x0FFF indicates the lowest priority. The priority |
| 138 | // field is meaningful if multiple priority queues are associated with a T-CONT or traffic |
| 139 | // scheduler whose scheduling discipline is strict priority. |
| 140 | // |
| 141 | // (R, W) (mandatory) (4 bytes) |
| 142 | // |
| 143 | // NOTE 3 - If flexible port configuration is supported, the related port attribute is meaningful |
| 144 | // only if the traffic scheduler pointer attribute value is null. Otherwise, the related port |
| 145 | // attribute is ignored. |
| 146 | // |
| 147 | // NOTE 4 - The related port attribute is read-only, unless otherwise specified by the QoS |
| 148 | // configuration flexibility attribute of the ONU2-G ME. If port flexibility is supported, the |
| 149 | // second byte, the port or T-CONT number, may be changed. If priority flexibility is supported, |
| 150 | // the third and fourth bytes may be changed. The OMCI set command must contain 4-bytes to match |
| 151 | // the attribute size, but the ONU must ignore all bytes that are not specified to be flexible. |
| 152 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 153 | // If flexible configuration is not supported, the ONU should reject an attempt to set the related |
| 154 | // port with a parameter error result-reason code. |
| 155 | // |
| 156 | // Traffic Scheduler Pointer |
| 157 | // The ONU should reject an attempt to violate these conditions with a parameter error result- |
| 158 | // reason code. |
| 159 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 160 | // This attribute points to the traffic scheduler ME instance that is associated with this priority |
| 161 | // queue. This pointer is used when this priority queue is connected with a traffic scheduler. The |
| 162 | // default value is a null pointer (0). (R, W) (mandatory) (2 bytes) |
| 163 | // |
| 164 | // NOTE 5 - When the QoS configuration flexibility attribute of the ONU2-G ME allows flexible |
| 165 | // assignment of the traffic scheduler, the OLT may configure the traffic scheduler pointer to |
| 166 | // refer to any traffic scheduler in the same slot. |
| 167 | // |
| 168 | // If traffic scheduler flexibility is not permitted by the QoS configuration flexibility |
| 169 | // attribute, the OLT may use the traffic scheduler pointer attribute only by pointing to another |
| 170 | // traffic scheduler ME that is associated with the same T-CONT as the priority queue itself. |
| 171 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 172 | // Weight |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 173 | // This attribute represents weight for WRR scheduling. At a given priority level, capacity is |
| 174 | // distributed to non-empty queues in proportion to their weights. In the upstream direction, this |
| 175 | // weight is meaningful if several priority queues are associated with a traffic scheduler or |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 176 | // T-CONT whose policy is WRR. In the downstream direction, this weight is used by a UNI in a WRR |
| 177 | // fashion. Upon ME instantiation, the ONU sets this attribute to 1. (R,-W) (mandatory) (1-byte) |
| 178 | // |
| 179 | // Back Pressure Operation |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 180 | // This attribute enables (0) or disables (1) back pressure operation. Its default value is 0. |
| 181 | // (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 182 | // |
| 183 | // Back Pressure Time |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 184 | // This attribute specifies the duration in microseconds of the backpressure signal. It can be used |
| 185 | // as a pause time for an Ethernet UNI. Upon ME instantiation, the ONU sets this attribute to 0. |
| 186 | // (R,-W) (mandatory) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 187 | // |
| 188 | // Back Pressure Occur Queue Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 189 | // This attribute identifies the threshold queue occupancy, in bytes, scaled by the priority queue |
| 190 | // scale factor attribute of the ONU2G, to start sending a back-pressure signal. (R, W) (mandatory) |
| 191 | // (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 192 | // |
| 193 | // Back Pressure Clear Queue Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 194 | // This attribute identifies the threshold queue occupancy, in bytes, scaled by the priority queue |
| 195 | // scale factor attribute of the ONU2G, to stop sending a back-pressure signal. (R, W) (mandatory) |
| 196 | // (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 197 | // |
| 198 | // Packet Drop Queue Thresholds |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 199 | // This attribute is a composite of four 2-byte values, a minimum and a maximum threshold, measured |
| 200 | // in bytes, scaled by the priority queue scale factor attribute of the ONU2-G, for green and |
| 201 | // yellow packets. The first value is the minimum green threshold, the queue occupancy below which |
| 202 | // all green packets are admitted to the queue. The second value is the maximum green threshold, |
| 203 | // the queue occupancy at or above which all green packets are discarded. The third value is the |
| 204 | // minimum yellow threshold, the queue occupancy below which all yellow packets are admitted to the |
| 205 | // queue. The fourth value is the maximum yellow threshold, the queue occupancy at or above which |
| 206 | // all yellow packets are discarded. The default is that all thresholds take the value of the |
| 207 | // maximum queue size. (R,-W) (optional) (8-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 208 | // |
| 209 | // Packet Drop Max_P |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 210 | // This attribute is a composite of two 1-byte values, the probability of dropping a coloured |
| 211 | // packet when the queue occupancy lies just below the maximum threshold for packets of that |
| 212 | // colour. The first value is the green packet max_p, and the second value is the yellow packet |
| 213 | // max_p. The probability, max_p, is determined by adding one to the unsigned value (0..255) of |
| 214 | // this attribute and dividing the result by 256. The default for each value is 255. (R,-W) |
| 215 | // (optional) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 216 | // |
| 217 | // Queue Drop W_Q |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 218 | // This attribute determines the averaging coefficient, w_q, as described in [b-Floyd]. The |
| 219 | // averaging coefficient, w_q, is equal to 2Queue_drop_w_q. For example, when queue drop_w_q has |
| 220 | // the value 9, the averaging coefficient, w_q, is 1/512-= 0.001-9. The default value is 9. (R,-W) |
| 221 | // (optional) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 222 | // |
| 223 | // Drop Precedence Colour Marking |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 224 | // 6 PCP 5P3D [IEEE 802.1ad] |
| 225 | // |
| 226 | // 7 DSCP AF class [IETF RFC 2597] |
| 227 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 228 | // (R,-W) (optional) (1-byte) |
| 229 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 230 | // This attribute specifies how drop precedence is marked on ingress packets to the priority queue. |
| 231 | // The default value is 0. |
| 232 | // |
| 233 | // 0 No marking (treat all packets as green) |
| 234 | // |
| 235 | // 1 Internal marking (from traffic descriptor ME) |
| 236 | // |
| 237 | // 2 DEI [IEEE 802.1ad] |
| 238 | // |
| 239 | // 3 PCP 8P0D [IEEE 802.1ad] |
| 240 | // |
| 241 | // 4 PCP 7P1D [IEEE 802.1ad] |
| 242 | // |
| 243 | // 5 PCP 6P2D [IEEE 802.1ad] |
| 244 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 245 | type PriorityQueue struct { |
| 246 | ManagedEntityDefinition |
| 247 | Attributes AttributeValueMap |
| 248 | } |
| 249 | |
| 250 | func init() { |
| 251 | priorityqueueBME = &ManagedEntityDefinition{ |
| 252 | Name: "PriorityQueue", |
| 253 | ClassID: 277, |
| 254 | MessageTypes: mapset.NewSetWith( |
| 255 | Get, |
| 256 | Set, |
| 257 | ), |
| 258 | AllowedAttributeMask: 0xffff, |
| 259 | AttributeDefinitions: AttributeDefinitionMap{ |
| 260 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 261 | 1: ByteField("QueueConfigurationOption", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1), |
| 262 | 2: Uint16Field("MaximumQueueSize", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2), |
| 263 | 3: Uint16Field("AllocatedQueueSize", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3), |
| 264 | 4: Uint16Field("DiscardBlockCounterResetInterval", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, true, false, 4), |
| 265 | 5: Uint16Field("ThresholdValueForDiscardedBlocksDueToBufferOverflow", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, true, false, 5), |
| 266 | 6: Uint32Field("RelatedPort", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6), |
| 267 | 7: Uint16Field("TrafficSchedulerPointer", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7), |
| 268 | 8: ByteField("Weight", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8), |
| 269 | 9: Uint16Field("BackPressureOperation", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, false, false, 9), |
| 270 | 10: Uint32Field("BackPressureTime", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read, Write), false, false, false, 10), |
| 271 | 11: Uint16Field("BackPressureOccurQueueThreshold", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, Write), false, false, false, 11), |
| 272 | 12: Uint16Field("BackPressureClearQueueThreshold", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, Write), false, false, false, 12), |
| 273 | 13: Uint64Field("PacketDropQueueThresholds", UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read, Write), false, true, false, 13), |
| 274 | 14: Uint16Field("PacketDropMaxP", UnsignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read, Write), false, true, false, 14), |
| 275 | 15: ByteField("QueueDropWQ", UnsignedIntegerAttributeType, 0x0002, 0, mapset.NewSetWith(Read, Write), false, true, false, 15), |
| 276 | 16: ByteField("DropPrecedenceColourMarking", UnsignedIntegerAttributeType, 0x0001, 0, mapset.NewSetWith(Read, Write), false, true, false, 16), |
| 277 | }, |
| 278 | Access: CreatedByOnu, |
| 279 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 280 | Alarms: AlarmMap{ |
| 281 | 0: "Block loss", |
| 282 | }, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 283 | } |
| 284 | } |
| 285 | |
| 286 | // NewPriorityQueue (class ID 277) creates the basic |
| 287 | // Managed Entity definition that is used to validate an ME of this type that |
| 288 | // is received from or transmitted to the OMCC. |
| 289 | func NewPriorityQueue(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 290 | return NewManagedEntity(*priorityqueueBME, params...) |
| 291 | } |