blob: 000de15d1e328a72eb4a08e2676f0c31a1591cf9 [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Matteo Scandolof9d43412021-01-12 11:11:34 -08003 * Copyright 2020-present Open Networking Foundation
4
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07005 * 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
Matteo Scandolof9d43412021-01-12 11:11:34 -08008
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07009 * http://www.apache.org/licenses/LICENSE-2.0
Matteo Scandolof9d43412021-01-12 11:11:34 -080010
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070011 * 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 */
Matteo Scandolof9d43412021-01-12 11:11:34 -080017 /*
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070018 * 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 */
Matteo Scandolof9d43412021-01-12 11:11:34 -080023
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070024package generated
25
26import "github.com/deckarep/golang-set"
27
Matteo Scandolof9d43412021-01-12 11:11:34 -080028// TrafficSchedulerClassID is the 16-bit ID for the OMCI
29// Managed entity Traffic scheduler
30const TrafficSchedulerClassID ClassID = ClassID(278)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
32var trafficschedulerBME *ManagedEntityDefinition
33
34// TrafficScheduler (class ID #278)
Matteo Scandolof9d43412021-01-12 11:11:34 -080035// NOTE 1 - In [ITU-T G.984.4], this ME is called a traffic scheduler-G.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070036//
37// An instance of this ME represents a logical object that can control upstream GEM packets. A
38// traffic scheduler can accommodate GEM packets after a priority queue or other traffic scheduler
39// and transfer them towards the next traffic scheduler or T-CONT. Because T-CONTs and traffic
40// schedulers are created autonomously by the ONU, the ONU vendor predetermines the most complex
41// traffic handling model it is prepared to support; the OLT may use less than the ONU's full
42// capabilities, but cannot ask for more. See Appendix II for more details.
43//
44// After the ONU creates instances of the T-CONT ME, it then autonomously creates instances of the
45// traffic scheduler ME.
46//
47// Relationships
48// The traffic scheduler ME may be related to a T-CONT or other traffic schedulers through pointer
49// attributes.
50//
51// Attributes
52// Managed Entity Id
Matteo Scandolof9d43412021-01-12 11:11:34 -080053// Managed entity ID: This attribute uniquely identifies each instance of this ME. This 2-byte
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070054// number indicates the physical capability that realizes the traffic scheduler. The first byte is
55// the slot ID of the circuit pack with which this traffic scheduler is associated. For a traffic
56// scheduler that is not associated with a circuit pack, the first byte is 0xFF. The second byte is
57// the traffic scheduler id, assigned by the ONU itself. Traffic schedulers are numbered in
58// ascending order with the range 0..0xFF in each circuit pack or in the ONU core. (R) (mandatory)
Matteo Scandolof9d43412021-01-12 11:11:34 -080059// (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070060//
61// T_Cont Pointer
Matteo Scandolof9d43412021-01-12 11:11:34 -080062// NOTE 2 - This attribute is read-only unless otherwise specified by the QoS configuration
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070063// flexibility attribute of the ONU2-G ME. If flexible configuration is not supported, the ONU
64// should reject an attempt to set the TCONT pointer attribute with a parameter error result-reason
65// code.
66//
67// Traffic Scheduler Pointer
68// Traffic scheduler pointer: This attribute points to another traffic scheduler ME instance that
69// may serve this traffic scheduler. This pointer is used when this traffic scheduler is connected
Matteo Scandolof9d43412021-01-12 11:11:34 -080070// to another traffic scheduler; it is null (0) otherwise. (R) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070071//
72// Policy
Matteo Scandolof9d43412021-01-12 11:11:34 -080073// NOTE 3 - This attribute is read-only unless otherwise specified by the QoS configuration
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070074// flexibility attribute of the ONU2-G ME. If flexible configuration is not supported, the ONU
75// should reject an attempt to set the policy attribute with a parameter error result-reason code.
76//
77// Priority_Weight
Matteo Scandolof9d43412021-01-12 11:11:34 -080078// Upon ME instantiation, the ONU sets this attribute to 0. (R,-W) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070079//
80type TrafficScheduler struct {
81 ManagedEntityDefinition
82 Attributes AttributeValueMap
83}
84
85func init() {
86 trafficschedulerBME = &ManagedEntityDefinition{
87 Name: "TrafficScheduler",
88 ClassID: 278,
89 MessageTypes: mapset.NewSetWith(
90 Get,
91 Set,
92 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -080093 AllowedAttributeMask: 0xf000,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070094 AttributeDefinitions: AttributeDefinitionMap{
Matteo Scandolof9d43412021-01-12 11:11:34 -080095 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
96 1: Uint16Field("TContPointer", PointerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
97 2: Uint16Field("TrafficSchedulerPointer", PointerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
98 3: ByteField("Policy", EnumerationAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
99 4: ByteField("PriorityWeight", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700100 },
Matteo Scandolof9d43412021-01-12 11:11:34 -0800101 Access: CreatedByOnu,
102 Support: UnknownSupport,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700103 }
104}
105
Matteo Scandolof9d43412021-01-12 11:11:34 -0800106// NewTrafficScheduler (class ID 278) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700107// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800108// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700109func NewTrafficScheduler(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800110 return NewManagedEntity(*trafficschedulerBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700111}