blob: ad0766c25cc5ef9be4e5ac5db1166619ed3d0c3e [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 */
17/*
18 * 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// GemPortNetworkCtpClassID is the 16-bit ID for the OMCI
29// Managed entity GEM port network CTP
Andrea Campanella10426e22021-10-15 17:58:04 +020030const GemPortNetworkCtpClassID = ClassID(268) // 0x010c
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
32var gemportnetworkctpBME *ManagedEntityDefinition
33
Andrea Campanella10426e22021-10-15 17:58:04 +020034// GemPortNetworkCtp (Class ID: #268 / 0x010c)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070035// This ME represents the termination of a GEM port on an ONU. This ME aggregates connectivity
36// functionality from the network view and alarms from the network element view as well as
37// artefacts from trails.
38//
39// Instances of the GEM port network CTP ME are created and deleted by the OLT. An instance of GEM
40// port network CTP can be deleted only when no GEM IW TP or GEM port network CTP PM history data
41// are associated with it. It is the responsibility of the OLT to make sure that the ONU
42// configuration meets this condition.
43//
44// In ITU-T G.984 systems, when a GEM port network CTP is created, its encryption state is by
45// default not encrypted. If the OLT wishes to configure the GEM port to use encryption, it must
46// send the appropriate PLOAM message. This applies equally to new CTPs and to CTPs that are re-
47// created after an MIB reset.
48//
49// In ITU-T G.987 systems, GEM ports are dynamically encrypted. If it is intended to encrypt the
50// GEM port, the OLT must configure a key ring to be used, and the key must be known to the ONU at
51// run time.
52//
53// Relationships
54// An instance of the GEM port network CTP ME may be associated with an instance of the T-CONT and
55// GEM IW TP MEs.
56//
57// Attributes
58// Managed Entity Id
Andrea Campanella10426e22021-10-15 17:58:04 +020059// This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory)
60// (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070061//
62// Port_Id
Andrea Campanella10426e22021-10-15 17:58:04 +020063// Port-ID: This attribute is the port-ID of the GEM port associated with this CTP. (RWSC)
64// (mandatory) (2-bytes)
65//
Matteo Scandolof9d43412021-01-12 11:11:34 -080066// NOTE 1 - While nothing forbids the existence of several GEM port network CTPs with the same
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070067// port-ID value, downstream traffic is modelled as being delivered to all such GEM port network
68// CTPs. Be aware of potential difficulties associated with defining downstream flows and
69// aggregating PM statistics.
70//
71// T_Cont Pointer
Matteo Scandolof9d43412021-01-12 11:11:34 -080072// T-CONT pointer: This attribute points to a T-CONT instance. (R,-W, setbycreate) (mandatory)
73// (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070074//
75// Direction
Andrea Campanella10426e22021-10-15 17:58:04 +020076// This attribute specifies whether the GEM port is used for UNI-to-ANI (1), ANI-to-UNI (2), or
77// bidirectional (3) connection. (R,-W, setbycreate) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070078//
79// Traffic Management Pointer For Upstream
Andrea Campanella10426e22021-10-15 17:58:04 +020080// If the traffic management option attribute in the ONU-G ME is 0 (priority controlled) or 2
81// (priority and rate controlled), this pointer specifies the priority queue ME serving this GEM
82// port network CTP. If the traffic management option attribute is 1 (rate controlled), this
83// attribute redundantly points to the TCONT serving this GEM port network CTP. (R,-W, setbycreate)
84// (mandatory) (2-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070085//
86// Traffic Descriptor Profile Pointer For Upstream
87// See also Appendix II.
88//
Andrea Campanella10426e22021-10-15 17:58:04 +020089// This attribute points to the instance of the traffic descriptor ME that contains the upstream
90// traffic parameters for this GEM port network CTP. This attribute is used when the traffic
91// management option attribute in the ONU-G ME is 1 (rate controlled), specifying the PIR/PBS to
92// which the upstream traffic is shaped. This attribute is also used when the traffic management
93// option attribute in the ONU-G ME is 2 (priority and rate controlled), specifying the
94// CIR/CBS/PIR/PBS to which the upstream traffic is policed. (R,-W, setbycreate) (optional)
95// (2-bytes)
96//
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070097// Uni Counter
Andrea Campanella10426e22021-10-15 17:58:04 +020098// This attribute reports the number of instances of UNI-G ME associated with this GEM port network
99// CTP. (R) (optional) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700100//
101// Priority Queue Pointer For Down Stream
Andrea Campanella10426e22021-10-15 17:58:04 +0200102// Priority queue pointer for downstream: This attribute points to the instance of the priority
103// queue used for this GEM port network CTP in the downstream direction. It is the responsibility
104// of the OLT to provision the downstream pointer in a way that is consistent with the bridge and
105// mapper connectivity. If the pointer is null, downstream queueing is determined by other
106// mechanisms in the ONU. (R,-W, setbycreate) (mandatory) (2-bytes)
107//
Matteo Scandolof9d43412021-01-12 11:11:34 -0800108// NOTE 2 - If the GEM port network CTP is associated with more than one UNI (downstream
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700109// multicast), the downstream priority queue pointer defines a pattern (e.g., queue number 3 for a
110// given UNI) to be replicated (i.e., to queue number 3) at the other affected UNIs.
111//
112// Encryption State
Andrea Campanella10426e22021-10-15 17:58:04 +0200113// This attribute indicates the current state of the GEM port network CTP's encryption. Legal
114// values are defined to be the same as those of the security mode attribute of the ONU2-G, with
115// the exception that attribute value 0 indicates an unencrypted GEM port. (R) (optional) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700116//
117// Traffic Descriptor Profile Pointer For Downstream
Andrea Campanella10426e22021-10-15 17:58:04 +0200118// This attribute points to the instance of the traffic descriptor ME that contains the downstream
119// traffic parameters for this GEM port network CTP. This attribute is used when the traffic
120// management option attribute in the ONU-G ME is 1 (rate controlled), specifying the PIR/PBS to
121// which the downstream traffic is shaped. This attribute is also used when the traffic management
122// option attribute in the ONU-G ME is 2 (priority and rate controlled), specifying the
123// CIR/CBS/PIR/PBS to which the downstream traffic is policed. (R,-W, setbycreate) (optional)
124// (2-bytes)
125//
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700126// See also Appendix II.
127//
128// Encryption Key Ring
Andrea Campanella10426e22021-10-15 17:58:04 +0200129// This attribute is defined in ITU-T G.987 systems only. It specifies whether the associated GEM
130// port is encrypted, and if so, which key ring it uses. (R, W, setbycreate) (optional) (1 byte)
131//
132// 0 (default) No encryption. The downstream key index is ignored, and upstream traffic is
133// transmitted with key index 0.
134//
135// 1 Unicast payload encryption in both directions. Keys are generated by the ONU and transmitted
136// to the OLT via the PLOAM channel.
137//
138// 2 Broadcast (multicast) encryption. Keys are generated by the OLT and distributed via the OMCI.
139//
140// 3 Unicast encryption, downstream only. Keys are generated by the ONU and transmitted to the OLT
141// via the PLOAM channel.
142//
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700143// Other values are reserved.
144//
145type GemPortNetworkCtp struct {
146 ManagedEntityDefinition
147 Attributes AttributeValueMap
148}
149
Elia Battiston9bfe1102022-02-03 10:38:03 +0100150// Attribute name constants
151
152const GemPortNetworkCtp_PortId = "PortId"
153const GemPortNetworkCtp_TContPointer = "TContPointer"
154const GemPortNetworkCtp_Direction = "Direction"
155const GemPortNetworkCtp_TrafficManagementPointerForUpstream = "TrafficManagementPointerForUpstream"
156const GemPortNetworkCtp_TrafficDescriptorProfilePointerForUpstream = "TrafficDescriptorProfilePointerForUpstream"
157const GemPortNetworkCtp_UniCounter = "UniCounter"
158const GemPortNetworkCtp_PriorityQueuePointerForDownStream = "PriorityQueuePointerForDownStream"
159const GemPortNetworkCtp_EncryptionState = "EncryptionState"
160const GemPortNetworkCtp_TrafficDescriptorProfilePointerForDownstream = "TrafficDescriptorProfilePointerForDownstream"
161const GemPortNetworkCtp_EncryptionKeyRing = "EncryptionKeyRing"
162
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700163func init() {
164 gemportnetworkctpBME = &ManagedEntityDefinition{
165 Name: "GemPortNetworkCtp",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100166 ClassID: GemPortNetworkCtpClassID,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700167 MessageTypes: mapset.NewSetWith(
168 Create,
169 Delete,
170 Get,
171 Set,
172 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800173 AllowedAttributeMask: 0xffc0,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700174 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100175 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
176 1: Uint16Field(GemPortNetworkCtp_PortId, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1),
177 2: Uint16Field(GemPortNetworkCtp_TContPointer, PointerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2),
178 3: ByteField(GemPortNetworkCtp_Direction, EnumerationAttributeType, 0x2000, 3, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 3),
179 4: Uint16Field(GemPortNetworkCtp_TrafficManagementPointerForUpstream, PointerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 4),
180 5: Uint16Field(GemPortNetworkCtp_TrafficDescriptorProfilePointerForUpstream, PointerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 5),
181 6: ByteField(GemPortNetworkCtp_UniCounter, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, true, false, 6),
182 7: Uint16Field(GemPortNetworkCtp_PriorityQueuePointerForDownStream, PointerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 7),
183 8: ByteField(GemPortNetworkCtp_EncryptionState, EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, true, false, 8),
184 9: Uint16Field(GemPortNetworkCtp_TrafficDescriptorProfilePointerForDownstream, PointerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 9),
185 10: ByteField(GemPortNetworkCtp_EncryptionKeyRing, EnumerationAttributeType, 0x0040, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 10),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800186 },
187 Access: CreatedByOlt,
188 Support: UnknownSupport,
189 Alarms: AlarmMap{
190 5: "End-to-end loss of continuity",
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700191 },
192 }
193}
194
Matteo Scandolof9d43412021-01-12 11:11:34 -0800195// NewGemPortNetworkCtp (class ID 268) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700196// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800197// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700198func NewGemPortNetworkCtp(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800199 return NewManagedEntity(*gemportnetworkctpBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700200}