blob: b3c6df4c22193583d0624e4c5560a75c704b6d37 [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
4
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
Andrea Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
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 */
Andrea Campanella7167ebb2020-02-24 09:56:38 +010017 /*
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
30const Dot1AgMepClassID ClassID = ClassID(302)
31
32var dot1agmepBME *ManagedEntityDefinition
33
34// Dot1AgMep (class ID #302)
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// Managed entity ID: This attribute uniquely identifies each instance of this ME. (R, setbycreate)
47// (mandatory) (2-bytes)
48//
49// Layer 2 Entity Pointer
50// Layer 2 entity pointer: Depending on the value of the layer 2 type attribute, this pointer
51// specifies the MAC bridge port configuration data ME or the IEEE 802.1p mapper service profile ME
52// with which this MEP is associated. (R,-W, setbycreate) (mandatory) (2-bytes)
53//
54// Layer 2 Type
55// Layer 2 type: This attribute specifies whether the MA is associated with a MAC bridge port
56// (value 0) or an IEEE 802.1p mapper (value 1). (R,-W, setbycreate) (mandatory) (1-byte)
57//
58// Ma Pointer
59// MA pointer: This pointer specifies the maintenance association with which this MEP is
60// associated. (R,-W, setbycreate) (mandatory) (2-bytes)
61//
62// Mep Id
63// MEP ID: This attribute specifies the MEP's own identity in the MA. For a given MA, the MEP ID
64// must be unique throughout the network defined by the MD. The MEP ID is defined in the range
65// 1..8191. The value 0 indicates that no MEP ID is (yet) configured. (R,-W, setbycreate)
66// (mandatory) (2-bytes)
67//
68// Mep Control
69// (R,-W, setbycreate) (mandatory) (1-byte)
70//
71// Primary Vlan
72// Primary VLAN: This attribute is a 12-bit VLAN ID. The value 0 indicates that the MEP inherits
73// its primary VLAN from its parent MA. CFM messages, except forwarded LTMs, are tagged with the
74// primary VLAN ID. If explicitly specified, the value of this attribute must be one of the VLANs
75// associated with the parent MA. (R,-W, setbycreate) (mandatory) (2-bytes)
76//
77// Administrative State
78// Administrative state: This attribute locks (1) and unlocks (0) the functions performed by this
79// ME. Administrative state is further described in clause A.1.6. (R,-W, setbycreate) (mandatory)
80// (1-byte)
81//
82// Ccm And Ltm Priority
83// CCM and LTM priority: Ranging from 0..7, this attribute permits CCM and LTM frames to be
84// explicitly prioritized, which may be needed if flows are separated, e.g., by 802.1p priority.
85// The priority specified in this attribute is also used in linktrace reply (LTR) frames originated
86// by this MEP. The value 0xFF selects the IEEE 802.1ag default, whereby CCM and LTM frames are
87// transmitted with the highest Ethernet priority available. (R,-W, setbycreate) (mandatory)
88// (1-byte)
89//
90// Egress Identifier
91// Egress identifier: This attribute comprises 8-bytes to be included in LTMs. They allow received
92// LTRs to be directed to the correct originator. The attribute includes the originator MAC address
93// and a locally defined identifier. If this field is 0, the ONU uses the MEP's MAC address, with 0
94// as the locally defined identifier. (R,-W, setbycreate) (mandatory) (8-bytes)
95//
96// Peer Mep Ids
97// Peer MEP IDs: This attribute lists the expected peer MEPs for CCMs, 2-bytes per MEP ID. [IEEE
98// 802.1ag] allows for multipoint networks, and therefore a list of peer MEPs. This attribute
99// allows for up to 12 peers for a given MEP, though GPON applications are expected to need only a
100// single peer. Missing or unexpected messages trigger alarm declaration after a soak interval.
101// Unused peer MEP slots should be set to 0. (R,-W) (mandatory) (24-bytes)
102//
103// Eth Ais Control
104// (R,-W, setbycreate) (mandatory if ETH AIS is enabled) (1-byte)
105//
106// Fault Alarm Threshold
107// (R,-W, setbycreate) (optional) (1-byte)
108//
109// Alarm Declaration Soak Time
110// Alarm declaration soak time: This attribute defines the defect soak time that must elapse before
111// the MEP declares an alarm. It is expressed in 10-ms units with a range of 250 to 1000, i.e.,
112// 2.5-s to 10-s. The default is recommended to be 2.5 seconds. (R,-W) (mandatory) (2-bytes)
113//
114// Alarm Clear Soak Time
115// Alarm clear soak time: This attribute defines the defect-free soak time that must elapse before
116// the MEP clears an alarm. It is expressed in intervals of 10-ms with a range of 250 to 1-000,
117// i.e., 2.5-s to 10-s. The default is recommended to be 10-s. (R,-W) (mandatory) (2-bytes)
118//
119type Dot1AgMep struct {
120 ManagedEntityDefinition
121 Attributes AttributeValueMap
122}
123
124func init() {
125 dot1agmepBME = &ManagedEntityDefinition{
126 Name: "Dot1AgMep",
127 ClassID: 302,
128 MessageTypes: mapset.NewSetWith(
129 Create,
130 Delete,
131 Get,
132 Set,
133 ),
134 AllowedAttributeMask: 0xfffc,
135 AttributeDefinitions: AttributeDefinitionMap{
136 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
137 1: Uint16Field("Layer2EntityPointer", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1),
138 2: ByteField("Layer2Type", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2),
139 3: Uint16Field("MaPointer", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 3),
140 4: Uint16Field("MepId", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 4),
141 5: ByteField("MepControl", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 5),
142 6: Uint16Field("PrimaryVlan", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 6),
143 7: ByteField("AdministrativeState", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 7),
144 8: ByteField("CcmAndLtmPriority", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 8),
145 9: Uint64Field("EgressIdentifier", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 9),
146 10: MultiByteField("PeerMepIds", OctetsAttributeType, 0x0040, 24, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"), mapset.NewSetWith(Read, Write), false, false, false, 10),
147 11: ByteField("EthAisControl", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 11),
148 12: ByteField("FaultAlarmThreshold", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 12),
149 13: Uint16Field("AlarmDeclarationSoakTime", UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read, Write), false, false, false, 13),
150 14: Uint16Field("AlarmClearSoakTime", UnsignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read, Write), false, false, false, 14),
151 },
152 Access: CreatedByOlt,
153 Support: UnknownSupport,
154 }
155}
156
157// NewDot1AgMep (class ID 302) creates the basic
158// Managed Entity definition that is used to validate an ME of this type that
159// is received from or transmitted to the OMCC.
160func NewDot1AgMep(params ...ParamData) (*ManagedEntity, OmciErrors) {
161 return NewManagedEntity(*dot1agmepBME, params...)
162}