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