blob: 9122a6c7f28179ec885d441cc38722e229047e33 [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
Chip Boling8cdd6392022-01-27 08:43:37 -06004 *
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
Chip Boling8cdd6392022-01-27 08:43:37 -06008 *
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Chip Boling8cdd6392022-01-27 08:43:37 -060010 *
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 */
David K. Bainbridgeadf422d2021-04-09 16:06:41 +000017/*
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// Dot1AgMaintenanceAssociationClassID is the 16-bit ID for the OMCI
29// Managed entity Dot1ag maintenance association
Chip Boling610117d2021-09-09 11:24:34 -050030const Dot1AgMaintenanceAssociationClassID = ClassID(300) // 0x012c
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var dot1agmaintenanceassociationBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// Dot1AgMaintenanceAssociation (Class ID: #300 / 0x012c)
Chip Boling6e27b352020-02-14 09:10:01 -060035// This ME models an [IEEE 802.1ag] service defined on a bridge port. An MA is a set of endpoints
36// on opposite sides of a network, all existing at a defined maintenance level. One of the
37// endpoints resides on the local ONU; the others are understood to be configured in a consistent
38// way on external equipment. [ITUT Y.1731] refers to the MA as a maintenance entity group (MEG).
39//
40// An MA is created and deleted by the OLT.
41//
42// Relationships
43// Any number of MAs may be associated with a given MD, or may stand on their own without an MD.
44// One or more MAs may be associated with a MAC bridge or an IEEE 802.1p mapper. An MA exists at
45// one of eight possible maintenance levels.
46//
47// Attributes
48// Managed Entity Id
Chip Boling8fddd112021-08-11 09:58:20 -050049// This attribute uniquely identifies an instance of this ME. The values 0 and 0xFFFF are reserved.
50// (R, setbycreate) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060051//
52// Md Pointer
Chip Boling8fddd112021-08-11 09:58:20 -050053// This pointer specifies the dot1ag maintenance domain with which this MA is associated. A null
54// pointer specifies that the MA is not associated with an MD. (R,-W, setbycreate) (mandatory)
55// (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060056//
57// Short Ma Name Format
Chip Boling8fddd112021-08-11 09:58:20 -050058// This attribute specifies one of several possible formats for the short MA name attribute. Value
59// 1, the primary VLAN ID, is recommended to be the default. (R,-W, setbycreate) (mandatory)
60// (1-byte)
Chip Boling6e27b352020-02-14 09:10:01 -060061//
Chip Boling8fddd112021-08-11 09:58:20 -050062// Short MA Name 1
63// These two attributes may be regarded as an octet string whose value is the left-justified MA
64// name. Because the MA name may or may not be a printable character string, an octet string is the
65// appropriate representation. If the short MA name format specifies a character string, the string
66// is null-terminated; otherwise, its length is determined by the short MA name format. Note that
67// binary comparisons of the short MA name are made in other CFM state machines, so blanks,
68// alphabetic case, etc., are significant. Also, note that the MD name and the MA short name must
69// be packed (with additional bytes) into 48-byte CFM message headers. (R,-W) (mandatory) (25-bytes
70// * 2 attributes)
71//
72// Short MA Name 2
73// These two attributes may be regarded as an octet string whose value is the left-justified MA
74// name. Because the MA name may or may not be a printable character string, an octet string is the
75// appropriate representation. If the short MA name format specifies a character string, the string
76// is null-terminated; otherwise, its length is determined by the short MA name format. Note that
77// binary comparisons of the short MA name are made in other CFM state machines, so blanks,
78// alphabetic case, etc., are significant. Also, note that the MD name and the MA short name must
79// be packed (with additional bytes) into 48-byte CFM message headers. (R,-W) (mandatory) (25-bytes
80// * 2 attributes)
Chip Boling6e27b352020-02-14 09:10:01 -060081//
82// Continuity Check Message Ccm Interval
Chip Boling8fddd112021-08-11 09:58:20 -050083// 3: 100 ms
84//
85// 4: 1 s
86//
87// 5: 10 s
88//
89// 6: 1 min
90//
91// 7: 10 min
92//
Chip Boling6e27b352020-02-14 09:10:01 -060093// Short intervals should be used judiciously, as they can interfere with the network's ability to
94// handle subscriber traffic. The recommended value is 1-s. (R,-W, setbycreate) (mandatory)
95// (1-byte)
96//
Chip Boling8fddd112021-08-11 09:58:20 -050097// Continuity check message (CCM) interval: If CCMs are enabled on an MEP, the CCM interval
98// attribute specifies the rate at which they are generated. The MEP also expects to receive CCMs
99// from each of the other MEPs in its CC database at this rate.
100//
101// 0: CCM transmission disabled
102//
103// 1: 3.33 ms
104//
105// 2: 10 ms
106//
Chip Boling6e27b352020-02-14 09:10:01 -0600107// Associated Vlans
Chip Boling8fddd112021-08-11 09:58:20 -0500108// This attribute is a list of up to 12 VLAN IDs with which this MA is associated. Once a set of
109// VLANs is defined, the ONU should deny operations to other dot1ag MAs or dot1ag default MD level
110// entries that conflict with the set membership. The all-zeros value indicates that this MA is not
111// associated with any VLANs. Assuming that the attribute is not 0, the first entry is understood
112// to be the primary VLAN. Except forwarded linktrace messages (LTMs), CFM messages emitted by MPs
113// in this MA are tagged with the primary VLAN ID. (R,-W) (mandatory) (2-bytes/entry *
114// 12-entries-=-24-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -0600115//
116// Mhf Creation
Chip Boling8fddd112021-08-11 09:58:20 -0500117// This attribute determines whether the bridge creates an MHF, under circumstances defined in
118// clause 22.2.3 of [IEEE 802.1ag]. This attribute is an enumeration with the following values:
Chip Boling6e27b352020-02-14 09:10:01 -0600119//
Chip Boling8fddd112021-08-11 09:58:20 -0500120// 1 None. No MHFs are created on this bridge for this MA.
121//
122// 2 Default (IEEE 802.1ag term). The bridge can create MHFs on this VID on any port through which
123// the VID can pass.
124//
125// 3 Explicit. The bridge can create MHFs on this VID on any port through which the VID can pass,
126// but only if an MEP exists at some lower maintenance level.
127//
128// 4 Defer. This value causes the ONU to use the setting of the parent MD. This is recommended to
129// be the default value.
130//
Chip Boling6e27b352020-02-14 09:10:01 -0600131// (R,-W, setbycreate) (mandatory) (1-byte)
132//
133type Dot1AgMaintenanceAssociation struct {
134 ManagedEntityDefinition
135 Attributes AttributeValueMap
136}
137
Chip Boling8cdd6392022-01-27 08:43:37 -0600138// Attribute name constants
139
140const Dot1AgMaintenanceAssociation_MdPointer = "MdPointer"
141const Dot1AgMaintenanceAssociation_ShortMaNameFormat = "ShortMaNameFormat"
142const Dot1AgMaintenanceAssociation_ShortMaName1 = "ShortMaName1"
143const Dot1AgMaintenanceAssociation_ShortMaName2 = "ShortMaName2"
144const Dot1AgMaintenanceAssociation_ContinuityCheckMessageCcmInterval = "ContinuityCheckMessageCcmInterval"
145const Dot1AgMaintenanceAssociation_AssociatedVlans = "AssociatedVlans"
146const Dot1AgMaintenanceAssociation_MhfCreation = "MhfCreation"
147
Chip Boling6e27b352020-02-14 09:10:01 -0600148func init() {
149 dot1agmaintenanceassociationBME = &ManagedEntityDefinition{
150 Name: "Dot1AgMaintenanceAssociation",
Chip Boling8cdd6392022-01-27 08:43:37 -0600151 ClassID: Dot1AgMaintenanceAssociationClassID,
Chip Boling6e27b352020-02-14 09:10:01 -0600152 MessageTypes: mapset.NewSetWith(
153 Create,
154 Delete,
155 Get,
156 Set,
157 ),
158 AllowedAttributeMask: 0xfe00,
159 AttributeDefinitions: AttributeDefinitionMap{
Chip Boling8cdd6392022-01-27 08:43:37 -0600160 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
161 1: Uint16Field(Dot1AgMaintenanceAssociation_MdPointer, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1),
162 2: ByteField(Dot1AgMaintenanceAssociation_ShortMaNameFormat, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2),
163 3: MultiByteField(Dot1AgMaintenanceAssociation_ShortMaName1, OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 3),
164 4: MultiByteField(Dot1AgMaintenanceAssociation_ShortMaName2, OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 4),
165 5: ByteField(Dot1AgMaintenanceAssociation_ContinuityCheckMessageCcmInterval, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 5),
166 6: Uint16Field(Dot1AgMaintenanceAssociation_AssociatedVlans, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
167 7: ByteField(Dot1AgMaintenanceAssociation_MhfCreation, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 7),
Chip Boling6e27b352020-02-14 09:10:01 -0600168 },
169 Access: CreatedByOlt,
170 Support: UnknownSupport,
171 }
172}
173
174// NewDot1AgMaintenanceAssociation (class ID 300) creates the basic
175// Managed Entity definition that is used to validate an ME of this type that
176// is received from or transmitted to the OMCC.
177func NewDot1AgMaintenanceAssociation(params ...ParamData) (*ManagedEntity, OmciErrors) {
178 return NewManagedEntity(*dot1agmaintenanceassociationBME, params...)
179}