blob: 457aa8dfdd151181576970d62235abdeb527389e [file] [log] [blame]
Andrea Campanella10426e22021-10-15 17:58:04 +02001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
Andrea Campanella10426e22021-10-15 17:58:04 +02005 * 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 *
Andrea Campanella10426e22021-10-15 17:58:04 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
Andrea Campanella10426e22021-10-15 17:58:04 +020011 * 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 */
23
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// Dot1AgDefaultMdLevelClassID is the 16-bit ID for the OMCI
29// Managed entity Dot1ag default MD level
30const Dot1AgDefaultMdLevelClassID = ClassID(301) // 0x012d
31
32var dot1agdefaultmdlevelBME *ManagedEntityDefinition
33
34// Dot1AgDefaultMdLevel (Class ID: #301 / 0x012d)
35// The collection of the functionality called a maintenance half-function (MHF) is not explicitly
36// modelled as a ME by either [IEEE 802.1ag] or the OMCI. The ONU automatically creates MHFs
37// according to parameters specified in a dot1ag MD or a dot1ag MA ME; the dot1ag default MD level
38// ME catches the corner cases not covered by other MEs, specifically VLANs not included by any
39// defined MA.
40//
41// The dot1ag default MD level comprises a configurable table, each entry of which specifies
42// default MHF functionality for some set of VLANs. Once a set of VLANs is defined, operations to
43// different table entries or to dot1ag MAs that conflict with the set membership should be denied.
44// In addition, catch-all attributes are defined to specify MHF functionality when there is no
45// match to either a table entry or an MA.
46//
47// Relationships
48// An ONU that supports [IEEE 802.1ag] automatically creates one instance of this ME for each MAC
49// bridge or IEEE 802.1p mapper, depending on the ONU's provisioning model. It should not create an
50// instance for an IEEE 802.1p mapper that is associated with a MAC bridge.
51//
52// Attributes
53// Managed Entity Id
54// This attribute uniquely identifies an instance of this ME. Through an identical ID, this ME is
55// implicitly linked to an instance of the MAC bridge service profile ME or an IEEE 802.1p mapper
56// ME. It is expected that an ONU will implement CFM on bridges or on IEEE-802.1p mappers, but not
57// both, depending on its provisioning model. For precision, the reference is disambiguated by the
58// value of the layer 2 type pointer attribute. (R) (mandatory) (2-bytes)
59//
60// Layer 2 Type
61// This attribute specifies whether the dot1ag default MD level ME is associated with a MAC bridge
62// service profile (value 0) or an IEEE 802.1p mapper (value-1). (R) (mandatory) (1-byte)
63//
64// Catchall Level
65// This attribute ranges from 0..7 and specifies the MD level of MHFs created when no specific
66// match is found. (R,-W) (mandatory) (1-byte)
67//
68// Catchall Mhf Creation
69// This attribute determines whether, when no more specific match is found, the bridge creates an
70// MHF or not. This attribute is an enumeration with the following values:
71//
72// 1 None. The bridge does not create any MHFs. This is the default value.
73//
74// 2 Default. The bridge can create MHFs on this VID on any port through which the VID can pass.
75//
76// 3 Explicit. The bridge can create MHFs on this VID on any port through which the VID can pass,
77// but only if an MEP exists at some lower maintenance level.
78//
79// (R,-W) (mandatory) (1-byte)
80//
81// Catchall Sender Id Permission
82// This attribute determines the contents of the sender ID TLV included in CFM messages transmitted
83// by MPs when no more specific match is found. This attribute is identical to that defined in the
84// description of the dot1ag MD ME (i.e., excluding code point 5, defer). (R,-W) (mandatory)
85// (1-byte)
86//
87// Default Md Level Table
88// Each entry is a vector of fields, indexed by primary VLAN ID.
89//
90// Primary VLAN ID (2-bytes)
91//
92// Table control: This field controls the meaning of a set operation. The 1-byte size of this field
93// is included in get/get-next operations, but its value is undefined under get-next and should be
94// ignored by the OLT. (1-byte)
95//
96// 1 Add record to table; overwrite existing record, if any.
97//
98// 2 Delete record from table.
99//
100// 3 Clear all entries from table. This action may affect service and should be used judiciously.
101//
102// Other values are reserved.
103//
104// Status: This Boolean field indicates whether this table entry is in effect (true) or whether
105// (false) it has been overridden by the existence of an MA for the same VID and MD level as this
106// table's entry, and on which an up MEP is defined. This attribute is read-only. Space should be
107// allocated for it during set operations, but the value is not used. (1-byte)
108//
109// Level: This field ranges from 0..7 and specifies the MD level of MHFs under the control of this
110// instance of the dot1ag default MD level. The additional value 0xFF instructs the bridge to use
111// the value in the catch-all level attribute. (1-byte)
112//
113// MHF creation: This attribute determines whether the bridge creates an MHF or not, under
114// circumstances defined in clause 22.2.3 of [IEEE 802.1ag]. This attribute is an enumeration with
115// the following values. (1-byte)
116//
117// 1 None. No MHFs are created on this bridge for this MA.
118//
119// 2 Default. The bridge can create MHFs on this VID on any port through which the VID can pass.
120//
121// 3 Explicit. The bridge can create MHFs on this VID on any port through which the VID can pass,
122// but only if an MEP exists at some lower maintenance level.
123//
124// 4 Defer. This value causes the ONU to use the setting of the catch-all MHF creation attribute.
125// This is recommended to be the default value.
126//
127// Sender ID permission: This attribute determines the contents of the sender ID TLV included in
128// CFM messages transmitted by MPs controlled by this MA. (1-byte)
129//
130// 1 None: the sender ID TLV is not to be sent, default.
131//
132// 2 Chassis: the chassis ID length, chassis ID subtype, and chassis ID fields of the sender ID TLV
133// are to be sent, but not the management address fields.
134//
135// 3 Manage: the management address fields of the sender ID TLV are to be sent, but the chassis ID
136// length is to be transmitted with a 0 value, and the chassis ID subtype, and chassis ID fields
137// are not to be sent.
138//
139// 4 ChassisManage: all chassis ID and management address fields are to be sent.
140//
141// 5 Defer: the contents of the sender ID TLV is determined by the catch-all sender ID permission
142// attribute.
143//
144// Associated VLANs list: This field comprises a list of up to 11 additional VLAN IDs associated
145// with the primary VLAN, 2-bytes each. Unused placeholders, possibly including the entire field,
146// are set to 0. (22-bytes)
147//
148// (R,-W) (mandatory) (29-bytes * N entries)
149//
150type Dot1AgDefaultMdLevel struct {
151 ManagedEntityDefinition
152 Attributes AttributeValueMap
153}
154
Elia Battiston9bfe1102022-02-03 10:38:03 +0100155// Attribute name constants
156
157const Dot1AgDefaultMdLevel_Layer2Type = "Layer2Type"
158const Dot1AgDefaultMdLevel_CatchallLevel = "CatchallLevel"
159const Dot1AgDefaultMdLevel_CatchallMhfCreation = "CatchallMhfCreation"
160const Dot1AgDefaultMdLevel_CatchallSenderIdPermission = "CatchallSenderIdPermission"
161const Dot1AgDefaultMdLevel_DefaultMdLevelTable = "DefaultMdLevelTable"
162
Andrea Campanella10426e22021-10-15 17:58:04 +0200163func init() {
164 dot1agdefaultmdlevelBME = &ManagedEntityDefinition{
165 Name: "Dot1AgDefaultMdLevel",
Elia Battiston9bfe1102022-02-03 10:38:03 +0100166 ClassID: Dot1AgDefaultMdLevelClassID,
Andrea Campanella10426e22021-10-15 17:58:04 +0200167 MessageTypes: mapset.NewSetWith(
168 Get,
169 GetNext,
170 Set,
171 SetTable,
172 ),
173 AllowedAttributeMask: 0xf800,
174 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100175 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
176 1: ByteField(Dot1AgDefaultMdLevel_Layer2Type, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1),
177 2: ByteField(Dot1AgDefaultMdLevel_CatchallLevel, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
178 3: ByteField(Dot1AgDefaultMdLevel_CatchallMhfCreation, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
179 4: ByteField(Dot1AgDefaultMdLevel_CatchallSenderIdPermission, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
180 5: TableField(Dot1AgDefaultMdLevel_DefaultMdLevelTable, TableAttributeType, 0x0800, TableInfo{nil, 29}, mapset.NewSetWith(Read, Write), false, false, false, 5),
Andrea Campanella10426e22021-10-15 17:58:04 +0200181 },
182 Access: CreatedByOnu,
183 Support: UnknownSupport,
184 }
185}
186
187// NewDot1AgDefaultMdLevel (class ID 301) creates the basic
188// Managed Entity definition that is used to validate an ME of this type that
189// is received from or transmitted to the OMCC.
190func NewDot1AgDefaultMdLevel(params ...ParamData) (*ManagedEntity, OmciErrors) {
191 return NewManagedEntity(*dot1agdefaultmdlevelBME, params...)
192}