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 | */ |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [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 | // Dot1AgMepClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Dot1ag MEP |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const Dot1AgMepClassID = ClassID(302) // 0x012e |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var dot1agmepBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // Dot1AgMep (Class ID: #302 / 0x012e) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME models an MEP as defined primarily in [IEEE 802.1ag] and secondarily in [ITUT Y.1731]. |
| 36 | // It is created and deleted by the OLT. An MEP exists at one of eight possible maintenance levels, |
| 37 | // and resides at the boundary of a MD. It inherits a name, and optionally a set of associated |
| 38 | // VLANs, from its associated MA. |
| 39 | // |
| 40 | // Relationships |
| 41 | // One or more MEPs may be associated with a MAC bridge port or an IEEE 802.1p mapper in the |
| 42 | // absence of a MAC bridge. An MEP is also associated with zero or more VLANs and an MA. |
| 43 | // |
| 44 | // Attributes |
| 45 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 46 | // This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory) |
| 47 | // (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 48 | // |
| 49 | // Layer 2 Entity Pointer |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 50 | // Depending on the value of the layer 2 type attribute, this pointer specifies the MAC bridge port |
| 51 | // configuration data ME or the IEEE 802.1p mapper service profile ME with which this MEP is |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 52 | // associated. (R,-W, setbycreate) (mandatory) (2-bytes) |
| 53 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 54 | // Layer 2 Type |
| 55 | // This attribute specifies whether the MA is associated with a MAC bridge port (value 0) or an |
| 56 | // IEEE 802.1p mapper (value 1). (R,-W, setbycreate) (mandatory) (1-byte) |
| 57 | // |
| 58 | // Ma Pointer |
| 59 | // This pointer specifies the maintenance association with which this MEP is associated. (R,-W, |
| 60 | // setbycreate) (mandatory) (2-bytes) |
| 61 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 62 | // Mep Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 63 | // This attribute specifies the MEP's own identity in the MA. For a given MA, the MEP ID must be |
| 64 | // unique throughout the network defined by the MD. The MEP ID is defined in the range 1..8191. The |
| 65 | // value 0 indicates that no MEP ID is (yet) configured. (R,-W, setbycreate) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 66 | // |
| 67 | // Mep Control |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 68 | // This attribute specifies some of the overall behavioural aspects of the MEP. It is interpreted |
| 69 | // as follows. |
| 70 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 71 | // (R,-W, setbycreate) (mandatory) (1-byte) |
| 72 | // |
| 73 | // Primary Vlan |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 74 | // This attribute is a 12-bit VLAN ID. The value 0 indicates that the MEP inherits its primary VLAN |
| 75 | // from its parent MA. CFM messages, except forwarded LTMs, are tagged with the primary VLAN ID. If |
| 76 | // explicitly specified, the value of this attribute must be one of the VLANs associated with the |
| 77 | // parent MA. (R,-W, setbycreate) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 78 | // |
| 79 | // Administrative State |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 80 | // This attribute locks (1) and unlocks (0) the functions performed by this ME. Administrative |
| 81 | // state is further described in clause A.1.6. (R,-W, setbycreate) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 82 | // |
| 83 | // Ccm And Ltm Priority |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 84 | // Ranging from 0..7, this attribute permits CCM and LTM frames to be explicitly prioritized, which |
| 85 | // may be needed if flows are separated, e.g., by 802.1p priority. The priority specified in this |
| 86 | // attribute is also used in linktrace reply (LTR) frames originated by this MEP. The value 0xFF |
| 87 | // selects the IEEE 802.1ag default, whereby CCM and LTM frames are transmitted with the highest |
| 88 | // Ethernet priority available. (R,-W, setbycreate) (mandatory) (1-byte) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 89 | // |
| 90 | // Egress Identifier |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 91 | // This attribute comprises 8-bytes to be included in LTMs. They allow received LTRs to be directed |
| 92 | // to the correct originator. The attribute includes the originator MAC address and a locally |
| 93 | // defined identifier. If this field is 0, the ONU uses the MEP's MAC address, with 0 as the |
| 94 | // locally defined identifier. (R,-W, setbycreate) (mandatory) (8-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 95 | // |
| 96 | // Peer Mep Ids |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 97 | // This attribute lists the expected peer MEPs for CCMs, 2-bytes per MEP ID. [IEEE 802.1ag] allows |
| 98 | // for multipoint networks, and therefore a list of peer MEPs. This attribute allows for up to 12 |
| 99 | // peers for a given MEP, though GPON applications are expected to need only a single peer. Missing |
| 100 | // or unexpected messages trigger alarm declaration after a soak interval. Unused peer MEP slots |
| 101 | // should be set to 0. (R,-W) (mandatory) (24-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 102 | // |
| 103 | // Eth Ais Control |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 104 | // This attribute controls the generation of Ethernet alarm indication signal (AIS) frames when |
| 105 | // they are enabled through the MEP control attribute. It is interpreted as follows: |
| 106 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 107 | // (R,-W, setbycreate) (mandatory if ETH AIS is enabled) (1-byte) |
| 108 | // |
| 109 | // Fault Alarm Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 110 | // This attribute specifies the lowest priority alarm that is allowed to generate a fault alarm. |
| 111 | // The value 0 specifies that the ONU uses its internal default. It is defined as follows. |
| 112 | // |
| 113 | // 1 All defects generate alarms after suitable soaking, including AIS and RDICCM. |
| 114 | // |
| 115 | // 2 Alarm generated only by one of: MACstatus, RemoteCCM, ErrorCCM, XconCCM. This value is |
| 116 | // recommended as the default in [IEEE 802.1ag]. |
| 117 | // |
| 118 | // 3 Alarm generated only by one of: RemoteCCM, ErrorCCM, XconCCM. |
| 119 | // |
| 120 | // 4 Alarm generated only by one of: ErrorCCM, XconCCM. |
| 121 | // |
| 122 | // 5 Alarm generated only by: XconCCM. |
| 123 | // |
| 124 | // 6 No alarms are to be reported. This setting may be useful during configuration of services |
| 125 | // across the network when spurious alarms could otherwise be generated. |
| 126 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 127 | // (R,-W, setbycreate) (optional) (1-byte) |
| 128 | // |
| 129 | // Alarm Declaration Soak Time |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 130 | // This attribute defines the defect soak time that must elapse before the MEP declares an alarm. |
| 131 | // It is expressed in 10-ms units with a range of 250 to 1000, i.e., 2.5-s to 10-s. The default is |
| 132 | // recommended to be 2.5 seconds. (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 133 | // |
| 134 | // Alarm Clear Soak Time |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 135 | // This attribute defines the defect-free soak time that must elapse before the MEP clears an |
| 136 | // alarm. It is expressed in intervals of 10-ms with a range of 250 to 1-000, i.e., 2.5-s to 10-s. |
| 137 | // The default is recommended to be 10-s. (R,-W) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 138 | // |
| 139 | type Dot1AgMep struct { |
| 140 | ManagedEntityDefinition |
| 141 | Attributes AttributeValueMap |
| 142 | } |
| 143 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 144 | // Attribute name constants |
| 145 | |
| 146 | const Dot1AgMep_Layer2EntityPointer = "Layer2EntityPointer" |
| 147 | const Dot1AgMep_Layer2Type = "Layer2Type" |
| 148 | const Dot1AgMep_MaPointer = "MaPointer" |
| 149 | const Dot1AgMep_MepId = "MepId" |
| 150 | const Dot1AgMep_MepControl = "MepControl" |
| 151 | const Dot1AgMep_PrimaryVlan = "PrimaryVlan" |
| 152 | const Dot1AgMep_AdministrativeState = "AdministrativeState" |
| 153 | const Dot1AgMep_CcmAndLtmPriority = "CcmAndLtmPriority" |
| 154 | const Dot1AgMep_EgressIdentifier = "EgressIdentifier" |
| 155 | const Dot1AgMep_PeerMepIds = "PeerMepIds" |
| 156 | const Dot1AgMep_EthAisControl = "EthAisControl" |
| 157 | const Dot1AgMep_FaultAlarmThreshold = "FaultAlarmThreshold" |
| 158 | const Dot1AgMep_AlarmDeclarationSoakTime = "AlarmDeclarationSoakTime" |
| 159 | const Dot1AgMep_AlarmClearSoakTime = "AlarmClearSoakTime" |
| 160 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 161 | func init() { |
| 162 | dot1agmepBME = &ManagedEntityDefinition{ |
| 163 | Name: "Dot1AgMep", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 164 | ClassID: Dot1AgMepClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 165 | MessageTypes: mapset.NewSetWith( |
| 166 | Create, |
| 167 | Delete, |
| 168 | Get, |
| 169 | Set, |
| 170 | ), |
| 171 | AllowedAttributeMask: 0xfffc, |
| 172 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame] | 173 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 174 | 1: Uint16Field(Dot1AgMep_Layer2EntityPointer, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1), |
| 175 | 2: ByteField(Dot1AgMep_Layer2Type, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2), |
| 176 | 3: Uint16Field(Dot1AgMep_MaPointer, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 3), |
| 177 | 4: Uint16Field(Dot1AgMep_MepId, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 4), |
| 178 | 5: ByteField(Dot1AgMep_MepControl, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 5), |
| 179 | 6: Uint16Field(Dot1AgMep_PrimaryVlan, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 6), |
| 180 | 7: ByteField(Dot1AgMep_AdministrativeState, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 7), |
| 181 | 8: ByteField(Dot1AgMep_CcmAndLtmPriority, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 8), |
| 182 | 9: Uint64Field(Dot1AgMep_EgressIdentifier, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 9), |
| 183 | 10: MultiByteField(Dot1AgMep_PeerMepIds, OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read, Write), false, false, false, 10), |
| 184 | 11: ByteField(Dot1AgMep_EthAisControl, UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 11), |
| 185 | 12: ByteField(Dot1AgMep_FaultAlarmThreshold, UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 12), |
| 186 | 13: Uint16Field(Dot1AgMep_AlarmDeclarationSoakTime, UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read, Write), false, false, false, 13), |
| 187 | 14: Uint16Field(Dot1AgMep_AlarmClearSoakTime, UnsignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read, Write), false, false, false, 14), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 188 | }, |
| 189 | Access: CreatedByOlt, |
| 190 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 191 | Alarms: AlarmMap{ |
| 192 | 0: "RDI CCM", |
| 193 | 1: "MAC status", |
| 194 | 2: "Remote CCM", |
| 195 | 3: "Error CCM", |
| 196 | 4: "Xcon CCM", |
| 197 | 5: "Unexpected period", |
| 198 | 6: "AIS", |
| 199 | }, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 200 | } |
| 201 | } |
| 202 | |
| 203 | // NewDot1AgMep (class ID 302) creates the basic |
| 204 | // Managed Entity definition that is used to validate an ME of this type that |
| 205 | // is received from or transmitted to the OMCC. |
| 206 | func NewDot1AgMep(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 207 | return NewManagedEntity(*dot1agmepBME, params...) |
| 208 | } |