Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * Unless required by applicable law or agreed to in writing, software |
| 9 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | * See the License for the specific language governing permissions and |
| 12 | * limitations under the License. |
| 13 | */ |
| 14 | /* |
| 15 | * NOTE: This file was generated, manual edits will be overwritten! |
| 16 | * |
| 17 | * Generated by 'goCodeGenerator.py': |
| 18 | * https://github.com/cboling/OMCI-parser/README.md |
| 19 | */ |
| 20 | package generated |
| 21 | |
| 22 | import "github.com/deckarep/golang-set" |
| 23 | |
| 24 | const PriorityQueueClassId ClassID = ClassID(277) |
| 25 | |
| 26 | var priorityqueueBME *ManagedEntityDefinition |
| 27 | |
| 28 | // PriorityQueue (class ID #277) |
| 29 | // NOTE 1 – In [ITU-T G.984.4], this is called a priority queue-G. |
| 30 | // |
| 31 | // This ME specifies the priority queue used by a GEM port network CTP in the upstream direction. |
| 32 | // The upstream priority queue ME is also related to a T-CONT ME. By default, this relationship is |
| 33 | // fixed by the ONU hardware architecture, but some ONUs may also permit the relationship to be |
| 34 | // configured through the OMCI, as indicated by the QoS configuration flexibility attribute of the |
| 35 | // ONU2G ME. |
| 36 | // |
| 37 | // In the downstream direction, priority queues are associated with UNIs. Again, the association is |
| 38 | // fixed by default, but some ONUs may permit the association to be configured through the OMCI. |
| 39 | // |
| 40 | // If an ONU as a whole contains priority queues, it instantiates these queues autonomously. |
| 41 | // Priority queues may also be localized to pluggable circuit packs, in which case the ONU creates |
| 42 | // and deletes them in accordance with circuit pack pre-provisioning and the equipped |
| 43 | // configuration. |
| 44 | // |
| 45 | // The OLT can find all the queues by reading the priority queue ME instances. If the OLT tries to |
| 46 | // retrieve a non-existent priority queue, the ONU denies the get action with an error indication. |
| 47 | // |
| 48 | // See also Appendix II. |
| 49 | // |
| 50 | // Priority queues can exist in the ONU core and circuit packs serving both UNI and ANI functions. |
| 51 | // Therefore, they can be indirectly created and destroyed through cardholder provisioning actions. |
| 52 | // |
| 53 | // In the upstream direction, the weight attribute permits the configuring of an optional traffic |
| 54 | // scheduler. Several attributes support back pressure operation, whereby a back-pressure signal is |
| 55 | // sent backwards and causes the attached terminal to temporarily suspend sending data. |
| 56 | // |
| 57 | // In the downstream direction, strict priority discipline among the queues serving a given UNI is |
| 58 | // the default, with priorities established through the related port attribute. If two or more non- |
| 59 | // empty queues have the same priority, capacity is allocated among them in proportion to their |
| 60 | // weights. Note that the details of the downstream model differ from those of the upstream model. |
| 61 | // |
| 62 | // The yellow packet drop thresholds specify the drop probability for a packet that has been marked |
| 63 | // yellow (drop eligible) by a traffic descriptor or by external equipment such as a residential |
| 64 | // gateway (RG). If the current average queue occupancy is less than the minimum threshold, the |
| 65 | // yellow packet drop probability is zero. If the current average queue occupancy is greater than |
| 66 | // or equal to the maximum threshold, the yellow packet drop probability is one. The yellow drop |
| 67 | // probability increases linearly between 0 and max_p as the current average queue occupancy |
| 68 | // increases from the minimum to the maximum threshold. |
| 69 | // |
| 70 | // The same model can be configured for green packets, those regarded as being within the traffic |
| 71 | // contract. |
| 72 | // |
| 73 | // Drop precedence colour marking indicates the method by which a packet is marked as drop eligible |
| 74 | // (yellow). For discard eligibility indicator (DEI) and priority code point (PCP) marking, a drop |
| 75 | // eligible indicator is equivalent to yellow colour; otherwise, the colour is green. For |
| 76 | // differentiated services code point (DSCP) assured forwarding (AF) marking, the lowest drop |
| 77 | // precedence is equivalent to green; otherwise, the colour is yellow. |
| 78 | // |
| 79 | // Relationships |
| 80 | // One or more instances of this ME are associated with the ONU-G ME to model upstream priority |
| 81 | // 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 |
| 82 | // queues. Downstream priority queues may or may not be provided for a virtual Ethernet interface |
| 83 | // point (VEIP). |
| 84 | // |
| 85 | // Attributes |
| 86 | // Managed Entity Id |
| 87 | // Managed entity ID: This attribute uniquely identifies each instance of this ME. The MSB |
| 88 | // represents the direction (1: upstream, 0: downstream). The 15 LSBs represent a queue ID. The |
| 89 | // queue ID is numbered in ascending order by the ONU itself. It is strongly encouraged that the |
| 90 | // queue ID be formulated to simplify finding related queues. One way to do this is to number the |
| 91 | // queues such that the related port attributes are in ascending order (for the downstream and |
| 92 | // upstream queues separately). The range of downstream queue ids is 0 to 0x7FFF and the range of |
| 93 | // upstream queue ids is 0x8000 to 0xFFFF. (R) (mandatory) (2 bytes) |
| 94 | // |
| 95 | // Queue Configuration Option |
| 96 | // Queue configuration option: This attribute identifies the buffer partitioning policy. The value |
| 97 | // 1 means that several queues share one buffer of maximum queue size, while the value 0 means that |
| 98 | // each queue has an individual buffer of maximum queue size. (R) (mandatory) (1 byte) |
| 99 | // |
| 100 | // Maximum Queue Size |
| 101 | // NOTE 2 – In this and the other similar attributes of the priority queue ME, some legacy |
| 102 | // implementations may take the queue scale factor from the GEM block length attribute of the ANI-G |
| 103 | // ME. This option is discouraged in new implementations. |
| 104 | // |
| 105 | // Allocated Queue Size |
| 106 | // Allocated queue size: This attribute identifies the allocated size of this queue, in bytes, |
| 107 | // scaled by the priority queue scale factor attribute of the ONU2G. (R, W) (mandatory) (2 bytes) |
| 108 | // |
| 109 | // Discard_Block Counter Reset Interval |
| 110 | // Discard-block counter reset interval: This attribute represents the interval in milliseconds at |
| 111 | // which the counter resets itself. (R, W) (optional) (2 bytes) |
| 112 | // |
| 113 | // Threshold Value For Discarded Blocks Due To Buffer Overflow |
| 114 | // Threshold value for discarded blocks due to buffer overflow: This attribute specifies the |
| 115 | // threshold for the number of bytes (scaled by the priority queue scale factor attribute of the |
| 116 | // ONU2G) discarded on this queue due to buffer overflow. Its value controls the declaration of the |
| 117 | // block loss alarm. (R, W) (optional) (2 bytes) |
| 118 | // |
| 119 | // Related Port |
| 120 | // If flexible configuration is not supported, the ONU should reject an attempt to set the related |
| 121 | // port with a parameter error result-reason code. |
| 122 | // |
| 123 | // Traffic Scheduler Pointer |
| 124 | // The ONU should reject an attempt to violate these conditions with a parameter error result- |
| 125 | // reason code. |
| 126 | // |
| 127 | // Weight |
| 128 | // Weight: This attribute represents weight for WRR scheduling. At a given priority level, capacity |
| 129 | // is distributed to non-empty queues in proportion to their weights. In the upstream direction, |
| 130 | // this weight is meaningful if several priority queues are associated with a traffic scheduler or |
| 131 | // T-CONT whose policy is WRR. In the downstream direction, this weight is used by a UNI in a WRR |
| 132 | // fashion. Upon ME instantiation, the ONU sets this attribute to 1. (R, W) (mandatory) (1 byte) |
| 133 | // |
| 134 | // Back Pressure Operation |
| 135 | // Back pressure operation: This attribute enables (0) or disables (1) back pressure operation. Its |
| 136 | // default value is 0. (R, W) (mandatory) (2 bytes) |
| 137 | // |
| 138 | // Back Pressure Time |
| 139 | // Back pressure time: This attribute specifies the duration in microseconds of the backpressure |
| 140 | // signal. It can be used as a pause time for an Ethernet UNI. Upon ME instantiation, the ONU sets |
| 141 | // this attribute to 0. (R, W) (mandatory) (4 bytes) |
| 142 | // |
| 143 | // Back Pressure Occur Queue Threshold |
| 144 | // Back pressure occur queue threshold: This attribute identifies the threshold queue occupancy, in |
| 145 | // bytes, scaled by the priority queue scale factor attribute of the ONU2G, to start sending a |
| 146 | // back-pressure signal. (R, W) (mandatory) (2 bytes) |
| 147 | // |
| 148 | // Back Pressure Clear Queue Threshold |
| 149 | // Back pressure clear queue threshold: This attribute identifies the threshold queue occupancy, in |
| 150 | // bytes, scaled by the priority queue scale factor attribute of the ONU2G, to stop sending a back- |
| 151 | // pressure signal. (R, W) (mandatory) (2 bytes) |
| 152 | // |
| 153 | // Packet Drop Queue Thresholds |
| 154 | // Packet drop queue thresholds: This attribute is a composite of four 2 byte values, a minimum and |
| 155 | // a maximum threshold, measured in bytes, scaled by the priority queue scale factor attribute of |
| 156 | // the ONU2-G, for green and yellow packets. The first value is the minimum green threshold, the |
| 157 | // queue occupancy below which all green packets are admitted to the queue. The second value is the |
| 158 | // maximum green threshold, the queue occupancy at or above which all green packets are discarded. |
| 159 | // The third value is the minimum yellow threshold, the queue occupancy below which all yellow |
| 160 | // packets are admitted to the queue. The fourth value is the maximum yellow threshold, the queue |
| 161 | // occupancy at or above which all yellow packets are discarded. The default is that all thresholds |
| 162 | // take the value of the maximum queue size. (R, W) (optional) (8 bytes) |
| 163 | // |
| 164 | // Packet Drop Max_P |
| 165 | // Packet drop max_p: This attribute is a composite of two 1 byte values, the probability of |
| 166 | // dropping a coloured packet when the queue occupancy lies just below the maximum threshold for |
| 167 | // packets of that colour. The first value is the green packet max_p, and the second value is the |
| 168 | // yellow packet max_p. The probability, max_p, is determined by adding one to the unsigned value |
| 169 | // (0..255) of this attribute and dividing the result by 256. The default for each value is 255. |
| 170 | // (R, W) (optional) (2 bytes) |
| 171 | // |
| 172 | // Queue Drop W_Q |
| 173 | // Queue drop w_q: This attribute determines the averaging coefficient, w_q, as described in |
| 174 | // [b-Floyd]. The averaging coefficient, w_q, is equal to 2Queue_drop_w_q. For example, when queue |
| 175 | // drop_w_q has the value 9, the averaging coefficient, w_q, is 1/512 = 0.001 9. The default value |
| 176 | // is 9. (R, W) (optional) (1 byte) |
| 177 | // |
| 178 | // Drop Precedence Colour Marking |
| 179 | // (R, W) (optional) (1 byte) |
| 180 | // |
| 181 | type PriorityQueue struct { |
| 182 | ManagedEntityDefinition |
| 183 | Attributes AttributeValueMap |
| 184 | } |
| 185 | |
| 186 | func init() { |
| 187 | priorityqueueBME = &ManagedEntityDefinition{ |
| 188 | Name: "PriorityQueue", |
| 189 | ClassID: 277, |
| 190 | MessageTypes: mapset.NewSetWith( |
| 191 | Get, |
| 192 | Set, |
| 193 | ), |
| 194 | AllowedAttributeMask: 0XFFFF, |
| 195 | AttributeDefinitions: AttributeDefinitionMap{ |
| 196 | 0: Uint16Field("ManagedEntityId", 0, mapset.NewSetWith(Read), false, false, false, false, 0), |
| 197 | 1: ByteField("QueueConfigurationOption", 0, mapset.NewSetWith(Read), false, false, false, false, 1), |
| 198 | 2: Uint16Field("MaximumQueueSize", 0, mapset.NewSetWith(Read), false, false, false, false, 2), |
| 199 | 3: Uint16Field("AllocatedQueueSize", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 3), |
| 200 | 4: Uint16Field("DiscardBlockCounterResetInterval", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 4), |
| 201 | 5: Uint16Field("ThresholdValueForDiscardedBlocksDueToBufferOverflow", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 5), |
| 202 | 6: Uint32Field("RelatedPort", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 6), |
| 203 | 7: Uint16Field("TrafficSchedulerPointer", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 7), |
| 204 | 8: ByteField("Weight", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 8), |
| 205 | 9: Uint16Field("BackPressureOperation", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 9), |
| 206 | 10: Uint32Field("BackPressureTime", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 10), |
| 207 | 11: Uint16Field("BackPressureOccurQueueThreshold", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 11), |
| 208 | 12: Uint16Field("BackPressureClearQueueThreshold", 0, mapset.NewSetWith(Read, Write), false, false, false, false, 12), |
| 209 | 13: Uint64Field("PacketDropQueueThresholds", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 13), |
| 210 | 14: Uint16Field("PacketDropMaxP", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 14), |
| 211 | 15: ByteField("QueueDropWQ", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 15), |
| 212 | 16: ByteField("DropPrecedenceColourMarking", 0, mapset.NewSetWith(Read, Write), false, false, true, false, 16), |
| 213 | }, |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | // NewPriorityQueue (class ID 277 creates the basic |
| 218 | // Managed Entity definition that is used to validate an ME of this type that |
| 219 | // is received from the wire, about to be sent on the wire. |
| 220 | func NewPriorityQueue(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 221 | return NewManagedEntity(priorityqueueBME, params...) |
| 222 | } |