blob: 106d04242aff1af09e838005504f6c0a46983862 [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
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
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
Elia Battiston9bfe1102022-02-03 10:38:03 +01008 *
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
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 */
Girish Gowdra161d27a2021-05-05 12:01:44 -070017/*
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// TContClassID is the 16-bit ID for the OMCI
29// Managed entity T-CONT
Andrea Campanella10426e22021-10-15 17:58:04 +020030const TContClassID = ClassID(262) // 0x0106
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
32var tcontBME *ManagedEntityDefinition
33
Andrea Campanella10426e22021-10-15 17:58:04 +020034// TCont (Class ID: #262 / 0x0106)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070035// An instance of the traffic container ME T-CONT represents a logical connection group associated
36// with a G-PON PLOAM layer alloc-ID. A T-CONT can accommodate GEM packets in priority queues or
37// traffic schedulers that exist in the GEM layer.
38//
39// The ONU autonomously creates instances of this ME. The OLT can discover the number of TCONT
40// instances via the ANI-G ME. When the ONU's MIB is reset or created for the first time, all
41// supported T-CONTs are created. The OLT provisions alloc-IDs to the ONU via the PLOAM channel.
42// Via the OMCI, the OLT must then set the alloc-ID attributes in the T-CONTs that it wants to
43// activate for user traffic, to create the appropriate association with the allocation ID in the
44// PLOAM channel. There should be a one-to-one relationship between allocation IDs and T-CONT MEs;
45// the connection of multiple T-CONTs to a single allocation ID is undefined.
46//
47// The allocation ID that matches the ONU-ID itself is defined to be the default alloc-ID. This
48// allocID is used to carry the OMCC. The default alloc-ID can also be used to carry user traffic,
49// and hence can be assigned to one of the T-CONT MEs. However, this OMCI relationship only
50// pertains to user traffic, and the OMCC relationship is unaffected. It can also be true that the
51// OMCC is not contained in any T-CONT ME construct; rather, that the OMCC remains outside of the
52// OMCI, and that the OMCI is not used to manage the OMCC in any way. Multiplexing of the OMCC and
53// user data in GPON systems is discussed in clause B.2.4.
54//
55// Relationships
56// One or more instances of this ME are associated with an instance of a circuit pack that supports
57// a PON interface function, or with the ONU-G itself.
58//
59// Attributes
60// Managed Entity Id
Andrea Campanella10426e22021-10-15 17:58:04 +020061// This attribute uniquely identifies each instance of this ME. This 2-byte number indicates the
62// physical capability that realizes the TCONT. It may be represented as 0xSSBB, where SS indicates
63// the slot ID that contains this T-CONT (0 for the ONU as a whole), and BB is the TCONT ID,
64// numbered by the ONU itself. T-CONTs are numbered in ascending order, with the range 0..255 in
65// each slot. (R) (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070066//
67// Alloc_Id
68// Alloc-ID: This attribute links the T-CONT with the alloc-ID assigned by the OLT in the
69// assign_alloc-ID PLOAM message. The respective TC layer specification should be referenced for
70// the legal values for that system. Prior to the setting of this attribute by the OLT, this
71// attribute has an unambiguously unusable initial value, namely the value 0x00FF or 0xFFFF for
Matteo Scandolof9d43412021-01-12 11:11:34 -080072// ITU-T G.984 systems, and the value 0xFFFF for all other ITU-T GTC based PON systems. (R,-W)
73// (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070074//
75// Deprecated
Andrea Campanella10426e22021-10-15 17:58:04 +020076// The ONU should set this attribute to the value 1, and the OLT should ignore it. (R) (mandatory)
77// (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070078//
79// Policy
Andrea Campanella10426e22021-10-15 17:58:04 +020080// This attribute indicates the T-CONT's traffic scheduling policy. Valid values:
81//
82// 0 Null
83//
84// 1 Strict priority
85//
86// 2 WRR - Weighted round robin
87//
88// (R, W) (mandatory) (1 byte)
89//
Matteo Scandolof9d43412021-01-12 11:11:34 -080090// NOTE - This attribute is read-only, unless otherwise specified by the QoS configuration
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070091// flexibility attribute of the ONU2-G ME. If flexible configuration is not supported, the ONU
92// should reject an attempt to set it with a parameter error result-reason code.
93//
94type TCont struct {
95 ManagedEntityDefinition
96 Attributes AttributeValueMap
97}
98
Elia Battiston9bfe1102022-02-03 10:38:03 +010099// Attribute name constants
100
101const TCont_AllocId = "AllocId"
102const TCont_Deprecated = "Deprecated"
103const TCont_Policy = "Policy"
104
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700105func init() {
106 tcontBME = &ManagedEntityDefinition{
107 Name: "TCont",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100108 ClassID: TContClassID,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700109 MessageTypes: mapset.NewSetWith(
110 Get,
111 Set,
112 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800113 AllowedAttributeMask: 0xe000,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700114 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100115 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
116 1: Uint16Field(TCont_AllocId, UnsignedIntegerAttributeType, 0x8000, 65535, mapset.NewSetWith(Read, Write), false, false, false, 1),
117 2: ByteField(TCont_Deprecated, UnsignedIntegerAttributeType, 0x4000, 1, mapset.NewSetWith(Read), false, false, true, 2),
118 3: ByteField(TCont_Policy, EnumerationAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700119 },
Matteo Scandolof9d43412021-01-12 11:11:34 -0800120 Access: CreatedByOnu,
121 Support: UnknownSupport,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700122 }
123}
124
Matteo Scandolof9d43412021-01-12 11:11:34 -0800125// NewTCont (class ID 262) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700126// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800127// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700128func NewTCont(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800129 return NewManagedEntity(*tcontBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700130}