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