Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
| 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 |
| 8 | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 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 | */ |
| 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 | |
| 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 |
| 30 | const Dot1AgMepClassID = ClassID(302) // 0x012e |
| 31 | |
| 32 | var dot1agmepBME *ManagedEntityDefinition |
| 33 | |
| 34 | // Dot1AgMep (Class ID: #302 / 0x012e) |
| 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 |
| 46 | // This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory) |
| 47 | // (2-bytes) |
| 48 | // |
| 49 | // Layer 2 Entity Pointer |
| 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 |
| 52 | // associated. (R,-W, setbycreate) (mandatory) (2-bytes) |
| 53 | // |
| 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 | // |
| 62 | // Mep Id |
| 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) |
| 66 | // |
| 67 | // Mep Control |
| 68 | // This attribute specifies some of the overall behavioural aspects of the MEP. It is interpreted |
| 69 | // as follows. |
| 70 | // |
| 71 | // (R,-W, setbycreate) (mandatory) (1-byte) |
| 72 | // |
| 73 | // Primary Vlan |
| 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) |
| 78 | // |
| 79 | // Administrative State |
| 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) |
| 82 | // |
| 83 | // Ccm And Ltm Priority |
| 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) |
| 89 | // |
| 90 | // Egress Identifier |
| 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) |
| 95 | // |
| 96 | // Peer Mep Ids |
| 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) |
| 102 | // |
| 103 | // Eth Ais Control |
| 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 | // |
| 107 | // (R,-W, setbycreate) (mandatory if ETH AIS is enabled) (1-byte) |
| 108 | // |
| 109 | // Fault Alarm Threshold |
| 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 | // |
| 127 | // (R,-W, setbycreate) (optional) (1-byte) |
| 128 | // |
| 129 | // Alarm Declaration Soak Time |
| 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) |
| 133 | // |
| 134 | // Alarm Clear Soak Time |
| 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) |
| 138 | // |
| 139 | type Dot1AgMep struct { |
| 140 | ManagedEntityDefinition |
| 141 | Attributes AttributeValueMap |
| 142 | } |
| 143 | |
| 144 | func init() { |
| 145 | dot1agmepBME = &ManagedEntityDefinition{ |
| 146 | Name: "Dot1AgMep", |
| 147 | ClassID: 302, |
| 148 | MessageTypes: mapset.NewSetWith( |
| 149 | Create, |
| 150 | Delete, |
| 151 | Get, |
| 152 | Set, |
| 153 | ), |
| 154 | AllowedAttributeMask: 0xfffc, |
| 155 | AttributeDefinitions: AttributeDefinitionMap{ |
| 156 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 157 | 1: Uint16Field("Layer2EntityPointer", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1), |
| 158 | 2: ByteField("Layer2Type", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2), |
| 159 | 3: Uint16Field("MaPointer", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 3), |
| 160 | 4: Uint16Field("MepId", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 4), |
| 161 | 5: ByteField("MepControl", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 5), |
| 162 | 6: Uint16Field("PrimaryVlan", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 6), |
| 163 | 7: ByteField("AdministrativeState", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 7), |
| 164 | 8: ByteField("CcmAndLtmPriority", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 8), |
| 165 | 9: Uint64Field("EgressIdentifier", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 9), |
| 166 | 10: MultiByteField("PeerMepIds", OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read, Write), false, false, false, 10), |
| 167 | 11: ByteField("EthAisControl", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 11), |
| 168 | 12: ByteField("FaultAlarmThreshold", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 12), |
| 169 | 13: Uint16Field("AlarmDeclarationSoakTime", UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read, Write), false, false, false, 13), |
| 170 | 14: Uint16Field("AlarmClearSoakTime", UnsignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read, Write), false, false, false, 14), |
| 171 | }, |
| 172 | Access: CreatedByOlt, |
| 173 | Support: UnknownSupport, |
| 174 | Alarms: AlarmMap{ |
| 175 | 0: "RDI CCM", |
| 176 | 1: "MAC status", |
| 177 | 2: "Remote CCM", |
| 178 | 3: "Error CCM", |
| 179 | 4: "Xcon CCM", |
| 180 | 5: "Unexpected period", |
| 181 | 6: "AIS", |
| 182 | }, |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | // NewDot1AgMep (class ID 302) creates the basic |
| 187 | // Managed Entity definition that is used to validate an ME of this type that |
| 188 | // is received from or transmitted to the OMCC. |
| 189 | func NewDot1AgMep(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 190 | return NewManagedEntity(*dot1agmepBME, params...) |
| 191 | } |