Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 4 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 5 | * 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 Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 8 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 10 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 11 | * 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. Bainbridge | adf422d | 2021-04-09 16:06:41 +0000 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // Dot1AgMaintenanceAssociationClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Dot1ag maintenance association |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const Dot1AgMaintenanceAssociationClassID = ClassID(300) // 0x012c |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var dot1agmaintenanceassociationBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // Dot1AgMaintenanceAssociation (Class ID: #300 / 0x012c) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // 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 Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 49 | // This attribute uniquely identifies an instance of this ME. The values 0 and 0xFFFF are reserved. |
| 50 | // (R, setbycreate) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 51 | // |
| 52 | // Md Pointer |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 53 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 56 | // |
| 57 | // Short Ma Name Format |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 58 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 61 | // |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 62 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 81 | // |
| 82 | // Continuity Check Message Ccm Interval |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 83 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 93 | // 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 Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 97 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 107 | // Associated Vlans |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 108 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 115 | // |
| 116 | // Mhf Creation |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 117 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 119 | // |
Chip Boling | 8fddd11 | 2021-08-11 09:58:20 -0500 | [diff] [blame] | 120 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 131 | // (R,-W, setbycreate) (mandatory) (1-byte) |
| 132 | // |
| 133 | type Dot1AgMaintenanceAssociation struct { |
| 134 | ManagedEntityDefinition |
| 135 | Attributes AttributeValueMap |
| 136 | } |
| 137 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 138 | // Attribute name constants |
| 139 | |
| 140 | const Dot1AgMaintenanceAssociation_MdPointer = "MdPointer" |
| 141 | const Dot1AgMaintenanceAssociation_ShortMaNameFormat = "ShortMaNameFormat" |
| 142 | const Dot1AgMaintenanceAssociation_ShortMaName1 = "ShortMaName1" |
| 143 | const Dot1AgMaintenanceAssociation_ShortMaName2 = "ShortMaName2" |
| 144 | const Dot1AgMaintenanceAssociation_ContinuityCheckMessageCcmInterval = "ContinuityCheckMessageCcmInterval" |
| 145 | const Dot1AgMaintenanceAssociation_AssociatedVlans = "AssociatedVlans" |
| 146 | const Dot1AgMaintenanceAssociation_MhfCreation = "MhfCreation" |
| 147 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 148 | func init() { |
| 149 | dot1agmaintenanceassociationBME = &ManagedEntityDefinition{ |
| 150 | Name: "Dot1AgMaintenanceAssociation", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 151 | ClassID: Dot1AgMaintenanceAssociationClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 152 | MessageTypes: mapset.NewSetWith( |
| 153 | Create, |
| 154 | Delete, |
| 155 | Get, |
| 156 | Set, |
| 157 | ), |
| 158 | AllowedAttributeMask: 0xfe00, |
| 159 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 160 | 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 168 | }, |
| 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. |
| 177 | func NewDot1AgMaintenanceAssociation(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 178 | return NewManagedEntity(*dot1agmaintenanceassociationBME, params...) |
| 179 | } |