blob: 0d1e13e74af0ffa192b60f5975df6ff4c4b5b7cc [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
4
Chip Boling6e27b352020-02-14 09:10:01 -06005 * 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
Andrea Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
Chip Boling6e27b352020-02-14 09:10:01 -060011 * 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 */
Chip Boling2d51f052021-02-09 09:04:15 -060017/*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * 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
Chip Boling610117d2021-09-09 11:24:34 -050030const Dot1AgDefaultMdLevelClassID = ClassID(301) // 0x012d
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var dot1agdefaultmdlevelBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// Dot1AgDefaultMdLevel (Class ID: #301 / 0x012d)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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
Chip Boling610117d2021-09-09 11:24:34 -050054// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060059//
60// Layer 2 Type
Chip Boling610117d2021-09-09 11:24:34 -050061// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060063//
64// Catchall Level
Chip Boling610117d2021-09-09 11:24:34 -050065// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060067//
68// Catchall Mhf Creation
Chip Boling610117d2021-09-09 11:24:34 -050069// 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//
Chip Boling6e27b352020-02-14 09:10:01 -060079// (R,-W) (mandatory) (1-byte)
80//
81// Catchall Sender Id Permission
Chip Boling610117d2021-09-09 11:24:34 -050082// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060086//
87// Default Md Level Table
Chip Boling610117d2021-09-09 11:24:34 -050088// 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//
Chip Boling6e27b352020-02-14 09:10:01 -0600148// (R,-W) (mandatory) (29-bytes * N entries)
149//
150type Dot1AgDefaultMdLevel struct {
151 ManagedEntityDefinition
152 Attributes AttributeValueMap
153}
154
155func init() {
156 dot1agdefaultmdlevelBME = &ManagedEntityDefinition{
157 Name: "Dot1AgDefaultMdLevel",
158 ClassID: 301,
159 MessageTypes: mapset.NewSetWith(
160 Get,
161 GetNext,
162 Set,
Chip Boling2d51f052021-02-09 09:04:15 -0600163 SetTable,
Chip Boling6e27b352020-02-14 09:10:01 -0600164 ),
165 AllowedAttributeMask: 0xf800,
166 AttributeDefinitions: AttributeDefinitionMap{
167 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
168 1: ByteField("Layer2Type", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1),
169 2: ByteField("CatchallLevel", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
170 3: ByteField("CatchallMhfCreation", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
171 4: ByteField("CatchallSenderIdPermission", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
172 5: TableField("DefaultMdLevelTable", TableAttributeType, 0x0800, TableInfo{nil, 29}, mapset.NewSetWith(Read, Write), false, false, false, 5),
173 },
174 Access: CreatedByOnu,
175 Support: UnknownSupport,
176 }
177}
178
179// NewDot1AgDefaultMdLevel (class ID 301) creates the basic
180// Managed Entity definition that is used to validate an ME of this type that
181// is received from or transmitted to the OMCC.
182func NewDot1AgDefaultMdLevel(params ...ParamData) (*ManagedEntity, OmciErrors) {
183 return NewManagedEntity(*dot1agdefaultmdlevelBME, params...)
184}