blob: 1a23f08f05e2fd71364835574e2055eb6cb7d2ca [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
4
Chip Boling6e27b352020-02-14 09:10:01 -06005 * 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 Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
Chip Boling6e27b352020-02-14 09:10:01 -060011 * 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 */
Andrea Campanella7167ebb2020-02-24 09:56:38 +010017 /*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * 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
30const TrafficDescriptorClassID ClassID = ClassID(280)
31
32var trafficdescriptorBME *ManagedEntityDefinition
33
34// TrafficDescriptor (class ID #280)
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
64// Managed entity ID: This attribute uniquely identifies each instance of this ME. (R, setbycreate)
65// (mandatory) (2-bytes)
66//
67// Cir
68// CIR: This attribute specifies the committed information rate, in bytes per second. The default
69// is 0. (R,-W, setbycreate) (optional) (4-bytes)
70//
71// Pir
72// PIR: This attribute specifies the peak information rate, in bytes per second. The default value
73// 0 accepts the ONU's factory policy. (R,-W, setbycreate) (optional) (4-bytes)
74//
75// Cbs
76// CBS: This attribute specifies the committed burst size, in bytes. The default is 0. (R,-W,
77// setbycreate) (optional) (4-bytes)
78//
79// Pbs
80// PBS: This attribute specifies the peak burst size, in bytes. The default value 0 accepts the
81// ONU's factory policy. (R,-W, setbycreate) (optional) (4-bytes)
82//
83// Colour Mode
84// (R,-W, setbycreate) (optional) (1-byte)
85//
86// Ingress Colour Marking
87// (R,-W, setbycreate) (optional) (1-byte)
88//
89// Egress Colour Marking
90// (R,-W, setbycreate) (optional) (1-byte)
91//
92// Meter Type
93// (R, setbycreate) (optional) (1-byte)
94//
95type TrafficDescriptor struct {
96 ManagedEntityDefinition
97 Attributes AttributeValueMap
98}
99
100func init() {
101 trafficdescriptorBME = &ManagedEntityDefinition{
102 Name: "TrafficDescriptor",
103 ClassID: 280,
104 MessageTypes: mapset.NewSetWith(
105 Create,
106 Delete,
107 Get,
108 Set,
109 ),
110 AllowedAttributeMask: 0xff00,
111 AttributeDefinitions: AttributeDefinitionMap{
112 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
113 1: Uint32Field("Cir", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 1),
114 2: Uint32Field("Pir", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 2),
115 3: Uint32Field("Cbs", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 3),
116 4: Uint32Field("Pbs", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 4),
117 5: ByteField("ColourMode", EnumerationAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 5),
118 6: ByteField("IngressColourMarking", EnumerationAttributeType, 0x0400, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 6),
119 7: ByteField("EgressColourMarking", EnumerationAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 7),
120 8: ByteField("MeterType", EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate), false, true, false, 8),
121 },
122 Access: CreatedByOlt,
123 Support: UnknownSupport,
124 }
125}
126
127// NewTrafficDescriptor (class ID 280) creates the basic
128// Managed Entity definition that is used to validate an ME of this type that
129// is received from or transmitted to the OMCC.
130func NewTrafficDescriptor(params ...ParamData) (*ManagedEntity, OmciErrors) {
131 return NewManagedEntity(*trafficdescriptorBME, params...)
132}