blob: 920ba6a05169680975a4dbc4d3b6fac21cef9d37 [file] [log] [blame]
Holger Hildebrandtfa074992020-03-27 15:42:06 +00001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00005 * 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
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +000011 * 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. Bainbridged80007b2021-04-12 12:22:29 +000017/*
Holger Hildebrandtfa074992020-03-27 15:42:06 +000018 * 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
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// TrafficDescriptorClassID is the 16-bit ID for the OMCI
29// Managed entity Traffic descriptor
mpagenko836a1fd2021-11-01 16:12:42 +000030const TrafficDescriptorClassID = ClassID(280) // 0x0118
Holger Hildebrandtfa074992020-03-27 15:42:06 +000031
32var trafficdescriptorBME *ManagedEntityDefinition
33
mpagenko836a1fd2021-11-01 16:12:42 +000034// TrafficDescriptor (Class ID: #280 / 0x0118)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000035// 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
mpagenko836a1fd2021-11-01 16:12:42 +000064// This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory)
65// (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000066//
67// Cir
mpagenko836a1fd2021-11-01 16:12:42 +000068// This attribute specifies the committed information rate, in bytes per second. The default is 0.
69// (R,-W, setbycreate) (optional) (4-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000070//
71// Pir
mpagenko836a1fd2021-11-01 16:12:42 +000072// 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)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000074//
75// Cbs
mpagenko836a1fd2021-11-01 16:12:42 +000076// This attribute specifies the committed burst size, in bytes. The default is 0. (R,-W,
Holger Hildebrandtfa074992020-03-27 15:42:06 +000077// setbycreate) (optional) (4-bytes)
78//
79// Pbs
mpagenko836a1fd2021-11-01 16:12:42 +000080// 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)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000082//
83// Colour Mode
mpagenko836a1fd2021-11-01 16:12:42 +000084// 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//
Holger Hildebrandtfa074992020-03-27 15:42:06 +000092// (R,-W, setbycreate) (optional) (1-byte)
93//
94// Ingress Colour Marking
mpagenko836a1fd2021-11-01 16:12:42 +000095// 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//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000114// (R,-W, setbycreate) (optional) (1-byte)
115//
116// Egress Colour Marking
mpagenko836a1fd2021-11-01 16:12:42 +0000117// 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//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000129// (R,-W, setbycreate) (optional) (1-byte)
130//
mpagenko836a1fd2021-11-01 16:12:42 +0000131// 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//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000141// Meter Type
mpagenko836a1fd2021-11-01 16:12:42 +0000142// 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//
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000151// (R, setbycreate) (optional) (1-byte)
152//
153type TrafficDescriptor struct {
154 ManagedEntityDefinition
155 Attributes AttributeValueMap
156}
157
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000158// Attribute name constants
159
160const TrafficDescriptor_Cir = "Cir"
161const TrafficDescriptor_Pir = "Pir"
162const TrafficDescriptor_Cbs = "Cbs"
163const TrafficDescriptor_Pbs = "Pbs"
164const TrafficDescriptor_ColourMode = "ColourMode"
165const TrafficDescriptor_IngressColourMarking = "IngressColourMarking"
166const TrafficDescriptor_EgressColourMarking = "EgressColourMarking"
167const TrafficDescriptor_MeterType = "MeterType"
168
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000169func init() {
170 trafficdescriptorBME = &ManagedEntityDefinition{
171 Name: "TrafficDescriptor",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000172 ClassID: TrafficDescriptorClassID,
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000173 MessageTypes: mapset.NewSetWith(
174 Create,
175 Delete,
176 Get,
177 Set,
178 ),
179 AllowedAttributeMask: 0xff00,
180 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000181 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
182 1: Uint32Field(TrafficDescriptor_Cir, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 1),
183 2: Uint32Field(TrafficDescriptor_Pir, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 2),
184 3: Uint32Field(TrafficDescriptor_Cbs, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 3),
185 4: Uint32Field(TrafficDescriptor_Pbs, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 4),
186 5: ByteField(TrafficDescriptor_ColourMode, EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 5),
187 6: ByteField(TrafficDescriptor_IngressColourMarking, EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 6),
188 7: ByteField(TrafficDescriptor_EgressColourMarking, EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 7),
189 8: ByteField(TrafficDescriptor_MeterType, EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate), false, true, false, 8),
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000190 },
191 Access: CreatedByOlt,
192 Support: UnknownSupport,
193 }
194}
195
196// NewTrafficDescriptor (class ID 280) creates the basic
197// Managed Entity definition that is used to validate an ME of this type that
198// is received from or transmitted to the OMCC.
199func NewTrafficDescriptor(params ...ParamData) (*ManagedEntity, OmciErrors) {
200 return NewManagedEntity(*trafficdescriptorBME, params...)
201}