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 | */ |
David K. Bainbridge | adf422d | 2021-04-09 16:06:41 +0000 | [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 | // TrafficDescriptorClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Traffic descriptor |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const TrafficDescriptorClassID = ClassID(280) // 0x0118 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var trafficdescriptorBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // TrafficDescriptor (Class ID: #280 / 0x0118) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // The traffic descriptor is a profile that allows for traffic management. A priority controlled |
| 36 | // ONU can point from a MAC bridge port configuration data ME to a traffic descriptor in order to |
| 37 | // implement traffic management (marking, policing). A rate controlled ONU can point to a traffic |
| 38 | // descriptor from either a MAC bridge port configuration data ME or a GEM port network CTP to |
| 39 | // implement traffic management (marking, shaping). |
| 40 | // |
| 41 | // Packets are determined to be green, yellow or red as a function of the ingress packet rate and |
| 42 | // the settings in this ME. The colour indicates drop precedence (eligibility), subsequently used |
| 43 | // by the priority queue ME to drop packets conditionally during congestion conditions. Packet |
| 44 | // colour is also used by the optional mode 1 DBA status reporting function described in [ITUT |
| 45 | // G.984.3]. Red packets are dropped immediately. Yellow packets are marked as drop eligible, and |
| 46 | // green packets are marked as not drop eligible, according to the egress colour marking attribute. |
| 47 | // |
| 48 | // The algorithm used to determine the colour marking is specified by the meter type attribute. If |
| 49 | // [bIETF RFC 4115] is used, then: |
| 50 | // |
| 51 | // CIR4115-=-CIR |
| 52 | // |
| 53 | // EIR4115-=-PIR - CIR (EIR: excess information rate) |
| 54 | // |
| 55 | // CBS4115-=-CBS |
| 56 | // |
| 57 | // EBS4115-=-PBS - CBS. |
| 58 | // |
| 59 | // Relationships |
| 60 | // This ME is associated with a GEM port network CTP or a MAC bridge port configuration data ME. |
| 61 | // |
| 62 | // Attributes |
| 63 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 64 | // This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory) |
| 65 | // (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 66 | // |
| 67 | // Cir |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 68 | // This attribute specifies the committed information rate, in bytes per second. The default is 0. |
| 69 | // (R,-W, setbycreate) (optional) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 70 | // |
| 71 | // Pir |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 72 | // This attribute specifies the peak information rate, in bytes per second. The default value 0 |
| 73 | // accepts the ONU's factory policy. (R,-W, setbycreate) (optional) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 74 | // |
| 75 | // Cbs |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 76 | // This attribute specifies the committed burst size, in bytes. The default is 0. (R,-W, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 77 | // setbycreate) (optional) (4-bytes) |
| 78 | // |
| 79 | // Pbs |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 80 | // This attribute specifies the peak burst size, in bytes. The default value 0 accepts the ONU's |
| 81 | // factory policy. (R,-W, setbycreate) (optional) (4-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 82 | // |
| 83 | // Colour Mode |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 84 | // This attribute specifies whether the colour marking algorithm considers pre-existing marking on |
| 85 | // ingress packets (colour-aware) or ignores it (colour-blind). In colour-aware mode, packets can |
| 86 | // only be demoted (from green to yellow or red, or from yellow to red). The default value is 0. |
| 87 | // |
| 88 | // 0 Colour-blind |
| 89 | // |
| 90 | // 1 Colour-aware |
| 91 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 92 | // (R,-W, setbycreate) (optional) (1-byte) |
| 93 | // |
| 94 | // Ingress Colour Marking |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 95 | // This attribute is meaningful in colour-aware mode. It identifies how pre-existing drop |
| 96 | // precedence is marked on ingress packets. For DEI and PCP marking, a drop eligible indicator is |
| 97 | // equivalent to yellow; otherwise, the colour is green. For DSCP AF marking, the lowest drop |
| 98 | // precedence is equivalent to green; otherwise, the colour is yellow. The default value is 0. |
| 99 | // |
| 100 | // 0 No marking (ignore ingress marking) |
| 101 | // |
| 102 | // 2 DEI [IEEE 802.1ad] |
| 103 | // |
| 104 | // 3 PCP 8P0D [IEEE 802.1ad] |
| 105 | // |
| 106 | // 4 PCP 7P1D [IEEE 802.1ad] |
| 107 | // |
| 108 | // 5 PCP 6P2D [IEEE 802.1ad] |
| 109 | // |
| 110 | // 6 PCP 5P3D [IEEE 802.1ad] |
| 111 | // |
| 112 | // 7 DSCP AF class [IETF RFC 2597] |
| 113 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 114 | // (R,-W, setbycreate) (optional) (1-byte) |
| 115 | // |
| 116 | // Egress Colour Marking |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 117 | // 2 DEI [IEEE 802.1ad] |
| 118 | // |
| 119 | // 3 PCP 8P0D [IEEE 802.1ad] |
| 120 | // |
| 121 | // 4 PCP 7P1D [IEEE 802.1ad] |
| 122 | // |
| 123 | // 5 PCP 6P2D [IEEE 802.1ad] |
| 124 | // |
| 125 | // 6 PCP 5P3D [IEEE 802.1ad] |
| 126 | // |
| 127 | // 7 DSCP AF class [IETF RFC 2597] |
| 128 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 129 | // (R,-W, setbycreate) (optional) (1-byte) |
| 130 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 131 | // This attribute specifies how drop precedence is to be marked by the ONU on egress packets. If |
| 132 | // set to internal marking only, the externally visible packet contents are not modified, but the |
| 133 | // packet is identified in a vendor-specific local way that indicates its colour to the priority |
| 134 | // queue ME. It is possible for the egress marking to differ from the ingress marking; for example, |
| 135 | // ingress PCP marking could be translated to DEI egress marking. The default value is 0. |
| 136 | // |
| 137 | // 0 No marking |
| 138 | // |
| 139 | // 1 Internal marking only |
| 140 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 141 | // Meter Type |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 142 | // This attribute specifies the algorithm used to determine the colour of the packet. The default |
| 143 | // value is 0. |
| 144 | // |
| 145 | // 0 Not specified |
| 146 | // |
| 147 | // 1 [b-IETF RFC 4115] |
| 148 | // |
| 149 | // 2 [b-IETF RFC 2698] |
| 150 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 151 | // (R, setbycreate) (optional) (1-byte) |
| 152 | // |
| 153 | type TrafficDescriptor struct { |
| 154 | ManagedEntityDefinition |
| 155 | Attributes AttributeValueMap |
| 156 | } |
| 157 | |
| 158 | func init() { |
| 159 | trafficdescriptorBME = &ManagedEntityDefinition{ |
| 160 | Name: "TrafficDescriptor", |
| 161 | ClassID: 280, |
| 162 | MessageTypes: mapset.NewSetWith( |
| 163 | Create, |
| 164 | Delete, |
| 165 | Get, |
| 166 | Set, |
| 167 | ), |
| 168 | AllowedAttributeMask: 0xff00, |
| 169 | AttributeDefinitions: AttributeDefinitionMap{ |
| 170 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 171 | 1: Uint32Field("Cir", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 1), |
| 172 | 2: Uint32Field("Pir", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 2), |
| 173 | 3: Uint32Field("Cbs", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 3), |
| 174 | 4: Uint32Field("Pbs", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 4), |
| 175 | 5: ByteField("ColourMode", EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 5), |
| 176 | 6: ByteField("IngressColourMarking", EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 6), |
| 177 | 7: ByteField("EgressColourMarking", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 7), |
| 178 | 8: ByteField("MeterType", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate), false, true, false, 8), |
| 179 | }, |
| 180 | Access: CreatedByOlt, |
| 181 | Support: UnknownSupport, |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | // NewTrafficDescriptor (class ID 280) creates the basic |
| 186 | // Managed Entity definition that is used to validate an ME of this type that |
| 187 | // is received from or transmitted to the OMCC. |
| 188 | func NewTrafficDescriptor(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 189 | return NewManagedEntity(*trafficdescriptorBME, params...) |
| 190 | } |