blob: 920ba6a05169680975a4dbc4d3b6fac21cef9d37 [file] [log] [blame]
Matteo Scandolof9d43412021-01-12 11:11:34 -08001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
Matteo Scandolof9d43412021-01-12 11:11:34 -08005 * 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
Elia Battiston9bfe1102022-02-03 10:38:03 +01008 *
Matteo Scandolof9d43412021-01-12 11:11:34 -08009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
Matteo Scandolof9d43412021-01-12 11:11:34 -080011 * 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 */
Girish Gowdra161d27a2021-05-05 12:01:44 -070017/*
Matteo Scandolof9d43412021-01-12 11:11:34 -080018 * 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
Andrea Campanella10426e22021-10-15 17:58:04 +020030const TrafficDescriptorClassID = ClassID(280) // 0x0118
Matteo Scandolof9d43412021-01-12 11:11:34 -080031
32var trafficdescriptorBME *ManagedEntityDefinition
33
Andrea Campanella10426e22021-10-15 17:58:04 +020034// TrafficDescriptor (Class ID: #280 / 0x0118)
Matteo Scandolof9d43412021-01-12 11:11:34 -080035// 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
Andrea Campanella10426e22021-10-15 17:58:04 +020064// This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory)
65// (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080066//
67// Cir
Andrea Campanella10426e22021-10-15 17:58:04 +020068// This attribute specifies the committed information rate, in bytes per second. The default is 0.
69// (R,-W, setbycreate) (optional) (4-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080070//
71// Pir
Andrea Campanella10426e22021-10-15 17:58:04 +020072// 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)
Matteo Scandolof9d43412021-01-12 11:11:34 -080074//
75// Cbs
Andrea Campanella10426e22021-10-15 17:58:04 +020076// This attribute specifies the committed burst size, in bytes. The default is 0. (R,-W,
Matteo Scandolof9d43412021-01-12 11:11:34 -080077// setbycreate) (optional) (4-bytes)
78//
79// Pbs
Andrea Campanella10426e22021-10-15 17:58:04 +020080// 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)
Matteo Scandolof9d43412021-01-12 11:11:34 -080082//
83// Colour Mode
Andrea Campanella10426e22021-10-15 17:58:04 +020084// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -080092// (R,-W, setbycreate) (optional) (1-byte)
93//
94// Ingress Colour Marking
Andrea Campanella10426e22021-10-15 17:58:04 +020095// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -0800114// (R,-W, setbycreate) (optional) (1-byte)
115//
116// Egress Colour Marking
Andrea Campanella10426e22021-10-15 17:58:04 +0200117// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -0800129// (R,-W, setbycreate) (optional) (1-byte)
130//
Andrea Campanella10426e22021-10-15 17:58:04 +0200131// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -0800141// Meter Type
Andrea Campanella10426e22021-10-15 17:58:04 +0200142// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -0800151// (R, setbycreate) (optional) (1-byte)
152//
153type TrafficDescriptor struct {
154 ManagedEntityDefinition
155 Attributes AttributeValueMap
156}
157
Elia Battiston9bfe1102022-02-03 10:38:03 +0100158// 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
Matteo Scandolof9d43412021-01-12 11:11:34 -0800169func init() {
170 trafficdescriptorBME = &ManagedEntityDefinition{
171 Name: "TrafficDescriptor",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100172 ClassID: TrafficDescriptorClassID,
Matteo Scandolof9d43412021-01-12 11:11:34 -0800173 MessageTypes: mapset.NewSetWith(
174 Create,
175 Delete,
176 Get,
177 Set,
178 ),
179 AllowedAttributeMask: 0xff00,
180 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100181 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),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800190 },
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}