blob: 60eb0072c0edde57f5b5d3daf5159277b75a517e [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 */
Chip Boling34ebcb62021-02-02 12:13:58 -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// Dot1AgMepClassID is the 16-bit ID for the OMCI
29// Managed entity Dot1ag MEP
Chip Boling610117d2021-09-09 11:24:34 -050030const Dot1AgMepClassID = ClassID(302) // 0x012e
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var dot1agmepBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// Dot1AgMep (Class ID: #302 / 0x012e)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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 Boling610117d2021-09-09 11:24:34 -050046// This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory)
47// (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060048//
49// Layer 2 Entity Pointer
Chip Boling610117d2021-09-09 11:24:34 -050050// 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 Boling6e27b352020-02-14 09:10:01 -060052// associated. (R,-W, setbycreate) (mandatory) (2-bytes)
53//
Chip Boling610117d2021-09-09 11:24:34 -050054// 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 Boling6e27b352020-02-14 09:10:01 -060062// Mep Id
Chip Boling610117d2021-09-09 11:24:34 -050063// 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 Boling6e27b352020-02-14 09:10:01 -060066//
67// Mep Control
Chip Boling610117d2021-09-09 11:24:34 -050068// This attribute specifies some of the overall behavioural aspects of the MEP. It is interpreted
69// as follows.
70//
Chip Boling6e27b352020-02-14 09:10:01 -060071// (R,-W, setbycreate) (mandatory) (1-byte)
72//
73// Primary Vlan
Chip Boling610117d2021-09-09 11:24:34 -050074// 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 Boling6e27b352020-02-14 09:10:01 -060078//
79// Administrative State
Chip Boling610117d2021-09-09 11:24:34 -050080// 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 Boling6e27b352020-02-14 09:10:01 -060082//
83// Ccm And Ltm Priority
Chip Boling610117d2021-09-09 11:24:34 -050084// 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 Boling6e27b352020-02-14 09:10:01 -060089//
90// Egress Identifier
Chip Boling610117d2021-09-09 11:24:34 -050091// 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 Boling6e27b352020-02-14 09:10:01 -060095//
96// Peer Mep Ids
Chip Boling610117d2021-09-09 11:24:34 -050097// 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 Boling6e27b352020-02-14 09:10:01 -0600102//
103// Eth Ais Control
Chip Boling610117d2021-09-09 11:24:34 -0500104// 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 Boling6e27b352020-02-14 09:10:01 -0600107// (R,-W, setbycreate) (mandatory if ETH AIS is enabled) (1-byte)
108//
109// Fault Alarm Threshold
Chip Boling610117d2021-09-09 11:24:34 -0500110// 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 Boling6e27b352020-02-14 09:10:01 -0600127// (R,-W, setbycreate) (optional) (1-byte)
128//
129// Alarm Declaration Soak Time
Chip Boling610117d2021-09-09 11:24:34 -0500130// 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 Boling6e27b352020-02-14 09:10:01 -0600133//
134// Alarm Clear Soak Time
Chip Boling610117d2021-09-09 11:24:34 -0500135// 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 Boling6e27b352020-02-14 09:10:01 -0600138//
139type Dot1AgMep struct {
140 ManagedEntityDefinition
141 Attributes AttributeValueMap
142}
143
Chip Boling8cdd6392022-01-27 08:43:37 -0600144// Attribute name constants
145
146const Dot1AgMep_Layer2EntityPointer = "Layer2EntityPointer"
147const Dot1AgMep_Layer2Type = "Layer2Type"
148const Dot1AgMep_MaPointer = "MaPointer"
149const Dot1AgMep_MepId = "MepId"
150const Dot1AgMep_MepControl = "MepControl"
151const Dot1AgMep_PrimaryVlan = "PrimaryVlan"
152const Dot1AgMep_AdministrativeState = "AdministrativeState"
153const Dot1AgMep_CcmAndLtmPriority = "CcmAndLtmPriority"
154const Dot1AgMep_EgressIdentifier = "EgressIdentifier"
155const Dot1AgMep_PeerMepIds = "PeerMepIds"
156const Dot1AgMep_EthAisControl = "EthAisControl"
157const Dot1AgMep_FaultAlarmThreshold = "FaultAlarmThreshold"
158const Dot1AgMep_AlarmDeclarationSoakTime = "AlarmDeclarationSoakTime"
159const Dot1AgMep_AlarmClearSoakTime = "AlarmClearSoakTime"
160
Chip Boling6e27b352020-02-14 09:10:01 -0600161func init() {
162 dot1agmepBME = &ManagedEntityDefinition{
163 Name: "Dot1AgMep",
Chip Boling8cdd6392022-01-27 08:43:37 -0600164 ClassID: Dot1AgMepClassID,
Chip Boling6e27b352020-02-14 09:10:01 -0600165 MessageTypes: mapset.NewSetWith(
166 Create,
167 Delete,
168 Get,
169 Set,
170 ),
171 AllowedAttributeMask: 0xfffc,
172 AttributeDefinitions: AttributeDefinitionMap{
Chip Boling8cdd6392022-01-27 08:43:37 -0600173 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 Boling6e27b352020-02-14 09:10:01 -0600188 },
189 Access: CreatedByOlt,
190 Support: UnknownSupport,
Chip Boling34ebcb62021-02-02 12:13:58 -0600191 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 Boling6e27b352020-02-14 09:10:01 -0600200 }
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.
206func NewDot1AgMep(params ...ParamData) (*ManagedEntity, OmciErrors) {
207 return NewManagedEntity(*dot1agmepBME, params...)
208}