blob: 10c0da5a0f9ebe659ed002a7902cb792a216f3f7 [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// TrafficSchedulerClassID is the 16-bit ID for the OMCI
26// Managed entity Traffic scheduler
27const TrafficSchedulerClassID ClassID = ClassID(278)
28
29var trafficschedulerBME *ManagedEntityDefinition
30
31// TrafficScheduler (class ID #278)
32// NOTE 1 - In [ITU-T G.984.4], this ME is called a traffic scheduler-G.
33//
34// An instance of this ME represents a logical object that can control upstream GEM packets. A
35// traffic scheduler can accommodate GEM packets after a priority queue or other traffic scheduler
36// and transfer them towards the next traffic scheduler or T-CONT. Because T-CONTs and traffic
37// schedulers are created autonomously by the ONU, the ONU vendor predetermines the most complex
38// traffic handling model it is prepared to support; the OLT may use less than the ONU's full
39// capabilities, but cannot ask for more. See Appendix II for more details.
40//
41// After the ONU creates instances of the T-CONT ME, it then autonomously creates instances of the
42// traffic scheduler ME.
43//
44// Relationships
45// The traffic scheduler ME may be related to a T-CONT or other traffic schedulers through pointer
46// attributes.
47//
48// Attributes
49// Managed Entity Id
50// Managed entity ID: This attribute uniquely identifies each instance of this ME. This 2-byte
51// number indicates the physical capability that realizes the traffic scheduler. The first byte is
52// the slot ID of the circuit pack with which this traffic scheduler is associated. For a traffic
53// scheduler that is not associated with a circuit pack, the first byte is 0xFF. The second byte is
54// the traffic scheduler id, assigned by the ONU itself. Traffic schedulers are numbered in
55// ascending order with the range 0..0xFF in each circuit pack or in the ONU core. (R) (mandatory)
56// (2-bytes)
57//
58// T_Cont Pointer
59// NOTE 2 - This attribute is read-only unless otherwise specified by the QoS configuration
60// flexibility attribute of the ONU2-G ME. If flexible configuration is not supported, the ONU
61// should reject an attempt to set the TCONT pointer attribute with a parameter error result-reason
62// code.
63//
64// Traffic Scheduler Pointer
65// Traffic scheduler pointer: This attribute points to another traffic scheduler ME instance that
66// may serve this traffic scheduler. This pointer is used when this traffic scheduler is connected
67// to another traffic scheduler; it is null (0) otherwise. (R) (mandatory) (2-bytes)
68//
69// Policy
70// NOTE 3 - This attribute is read-only unless otherwise specified by the QoS configuration
71// flexibility attribute of the ONU2-G ME. If flexible configuration is not supported, the ONU
72// should reject an attempt to set the policy attribute with a parameter error result-reason code.
73//
74// Priority_Weight
75// Upon ME instantiation, the ONU sets this attribute to 0. (R,-W) (mandatory) (1-byte)
76//
77type TrafficScheduler struct {
78 ManagedEntityDefinition
79 Attributes AttributeValueMap
80}
81
82func init() {
83 trafficschedulerBME = &ManagedEntityDefinition{
84 Name: "TrafficScheduler",
85 ClassID: 278,
86 MessageTypes: mapset.NewSetWith(
87 Get,
88 Set,
89 ),
90 AllowedAttributeMask: 0xf000,
91 AttributeDefinitions: AttributeDefinitionMap{
92 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
93 1: Uint16Field("TContPointer", PointerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
94 2: Uint16Field("TrafficSchedulerPointer", PointerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
95 3: ByteField("Policy", EnumerationAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
96 4: ByteField("PriorityWeight", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
97 },
98 Access: CreatedByOnu,
99 Support: UnknownSupport,
100 }
101}
102
103// NewTrafficScheduler (class ID 278) creates the basic
104// Managed Entity definition that is used to validate an ME of this type that
105// is received from or transmitted to the OMCC.
106func NewTrafficScheduler(params ...ParamData) (*ManagedEntity, OmciErrors) {
107 return NewManagedEntity(*trafficschedulerBME, params...)
108}