blob: 80598bb7824e408d5308fc2038857f92db390abb [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
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 */
20package generated
21
22import "github.com/deckarep/golang-set"
23
24const TrafficDescriptorClassId ClassID = ClassID(280)
25
26var trafficdescriptorBME *ManagedEntityDefinition
27
28// TrafficDescriptor (class ID #280)
29// The traffic descriptor is a profile that allows for traffic management. A priority controlled
30// ONU can point from a MAC bridge port configuration data ME to a traffic descriptor in order to
31// implement traffic management (marking, policing). A rate controlled ONU can point to a traffic
32// descriptor from either a MAC bridge port configuration data ME or a GEM port network CTP to
33// implement traffic management (marking, shaping).
34//
35// Packets are determined to be green, yellow or red as a function of the ingress packet rate and
36// the settings in this ME. The colour indicates drop precedence (eligibility), subsequently used
37// by the priority queue ME to drop packets conditionally during congestion conditions. Packet
38// colour is also used by the optional mode 1 DBA status reporting function described in [ITUT
39// G.984.3]. Red packets are dropped immediately. Yellow packets are marked as drop eligible, and
40// green packets are marked as not drop eligible, according to the egress colour marking attribute.
41//
42// The algorithm used to determine the colour marking is specified by the meter type attribute. If
43// [bIETF RFC 4115] is used, then:
44//
45// CIR4115 = CIR
46//
47// EIR4115 = PIR – CIR (EIR: excess information rate)
48//
49// CBS4115 = CBS
50//
51// EBS4115 = PBS – CBS.
52//
53// Relationships
54// This ME is associated with a GEM port network CTP or a MAC bridge port configuration data ME.
55//
56// Attributes
57// Managed Entity Id
58// Managed entity ID: This attribute uniquely identifies each instance of this ME. (R, setbycreate)
59// (mandatory) (2 bytes)
60//
61// Cir
62// CIR: This attribute specifies the committed information rate, in bytes per second. The default
63// is 0. (R, W, setbycreate) (optional) (4 bytes)
64//
65// Pir
66// PIR: This attribute specifies the peak information rate, in bytes per second. The default value
67// 0 accepts the ONU's factory policy. (R, W, setbycreate) (optional) (4 bytes)
68//
69// Cbs
70// CBS: This attribute specifies the committed burst size, in bytes. The default is 0. (R, W,
71// setbycreate) (optional) (4 bytes)
72//
73// Pbs
74// PBS: This attribute specifies the peak burst size, in bytes. The default value 0 accepts the
75// ONU's factory policy. (R, W, setbycreate) (optional) (4 bytes)
76//
77// Colour Mode
78// (R, W, setbycreate) (optional) (1 byte)
79//
80// Ingress Colour Marking
81// (R, W, setbycreate) (optional) (1 byte)
82//
83// Egress Colour Marking
84// (R, W, setbycreate) (optional) (1 byte)
85//
86// Meter Type
87// (R, setbycreate) (optional) (1 byte)
88//
89type TrafficDescriptor struct {
90 ManagedEntityDefinition
91 Attributes AttributeValueMap
92}
93
94func init() {
95 trafficdescriptorBME = &ManagedEntityDefinition{
96 Name: "TrafficDescriptor",
97 ClassID: 280,
98 MessageTypes: mapset.NewSetWith(
99 Create,
100 Delete,
101 Get,
102 Set,
103 ),
104 AllowedAttributeMask: 0XFF00,
105 AttributeDefinitions: AttributeDefinitionMap{
106 0: Uint16Field("ManagedEntityId", 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, false, 0),
107 1: Uint32Field("Cir", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 1),
108 2: Uint32Field("Pir", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 2),
109 3: Uint32Field("Cbs", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 3),
110 4: Uint32Field("Pbs", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 4),
111 5: ByteField("ColourMode", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 5),
112 6: ByteField("IngressColourMarking", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 6),
113 7: ByteField("EgressColourMarking", 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, true, false, 7),
114 8: ByteField("MeterType", 0, mapset.NewSetWith(Read, SetByCreate), false, false, true, false, 8),
115 },
116 }
117}
118
119// NewTrafficDescriptor (class ID 280 creates the basic
120// Managed Entity definition that is used to validate an ME of this type that
121// is received from the wire, about to be sent on the wire.
122func NewTrafficDescriptor(params ...ParamData) (*ManagedEntity, OmciErrors) {
123 return NewManagedEntity(trafficdescriptorBME, params...)
124}