/*
 * Copyright (c) 2018 - present.  Boling Consulting Solutions (bcsw.net)
 * Copyright 2020-present Open Networking Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * NOTE: This file was generated, manual edits will be overwritten!
 *
 * Generated by 'goCodeGenerator.py':
 *              https://github.com/cboling/OMCI-parser/README.md
 */

package generated

import "github.com/deckarep/golang-set"

// Vdsl2LineInventoryAndStatusDataPart1ClassID is the 16-bit ID for the OMCI
// Managed entity VDSL2 line inventory and status data part 1
const Vdsl2LineInventoryAndStatusDataPart1ClassID = ClassID(168) // 0x00a8

var vdsl2lineinventoryandstatusdatapart1BME *ManagedEntityDefinition

// Vdsl2LineInventoryAndStatusDataPart1 (Class ID: #168 / 0x00a8)
//	This ME extends the xDSL line configuration MEs. The ME name was chosen because its attributes
//	were initially unique to ITU-T G.993.2 VDSL2. Due to continuing standards development, some
//	attributes - and therefore this ME - have also become applicable to other Recommendations,
//	specifically [ITU-T G.992.3] and [ITU-T G.992.5].
//
//	This ME contains general and downstream attributes.
//
//	Relationships
//		This is one of the status data MEs associated with an xDSL UNI. It is meaningful if the PPTP
//		supports [ITU-T G.992.3], [ITU-T G.992.5] or [ITU-T G.993.2]. The ONU automatically creates or
//		deletes an instance of this ME upon creation and deletion of a PPTP xDSL UNI part 1 that
//		supports these attributes.
//
//	Attributes
//		Managed Entity Id
//			This attribute uniquely identifies each instance of this ME. Through an identical ID, this ME is
//			implicitly linked to an instance of the PPTP xDSL UNI part 1 ME. (R) (mandatory) (2-bytes)
//
//		Vdsl2 Transmission System Capability Xtu C
//			VDSL2 transmission system capability xTUC: This attribute extends the xTU-C transmission system
//			capability attribute of the xDSL line inventory and status data part 1 to include xTU-C VDSL2
//			capabilities. It is defined by bits 57..64 of Table 9.7.12-1. (R) (mandatory) (1-byte)
//
//		Vdsl2 Transmission System
//			This attribute reports the transmission system in use. It extends the xDSL transmission system
//			attribute of the xDSL line inventory and status data part 2 ME with a byte that includes VDSL2
//			capabilities currently in use. It is defined by bits 57..64 of Table 9.7.12-1. (R) (mandatory)
//			(1-byte)
//
//		Vdsl2 Profile
//			This attribute identifies the profile in use. It is a bit map (0 if not allowed, 1 if allowed)
//			with the following definition:
//
//			Bit	Meaning
//
//			1 (LSB)	ITU-T G.993.2 profile 8a
//
//			2	ITU-T G.993.2 profile 8b
//
//			3	ITU-T G.993.2 profile 8c
//
//			4	ITU-T G.993.2 profile 8d
//
//			5	ITU-T G.993.2 profile 12a
//
//			6	ITU-T G.993.2 profile 12b
//
//			7	ITU-T G.993.2 profile 17a
//
//			8	ITU-T G.993.2 profile 30a
//
//			(R) (mandatory) (1-byte)
//
//		Vdsl2 Limit Psd Mask And Bandplan
//			This attribute defines the limit PSD mask and band plan in use. It is a bit map as defined by
//			Table 9.7.6-1. (R) (mandatory) (8-bytes)
//
//		Vdsl2 Us0 Psd Mask
//			This attribute defines the US0 PSD mask in use. It is a bit map as defined by Table 9.7.62. (R)
//			(mandatory) (4-bytes)
//
//		Actsnrmodeds
//			This attribute indicates whether transmitter-referred virtual noise is active on the line in the
//			downstream direction.
//
//			1	Virtual noise inactive
//
//			2	Virtual noise active
//
//			(R) (mandatory) (1-byte)
//
//			The following four attributes have similar definitions. In each case, valid attribute values are
//			1, 2, 4, 8. In ADSL applications, the corresponding value is fixed at 1, and therefore need not
//			be specified. For VDSL2, it is equal to the size of the subcarrier group used to compute these
//			attributes (see clause-11.4.1 of [ITUT G.993.2]).
//
//		Hlingds
//			This attribute contains the number of subcarriers per group used to report HLINpsds. (R)
//			(mandatory) (1-byte)
//
//		Hloggds
//			This attribute contains the number of subcarriers per group used to report HLOGpsds. (R)
//			(mandatory) (1-byte)
//
//		Qlngds
//			This attribute contains the number of subcarriers per group used to report QLNpsds. (R)
//			(mandatory) (1-byte)
//
//		Snrgds
//			This attribute contains the number of subcarriers per group used to report SNRpsds. (R)
//			(mandatory) (1-byte)
//
//		Mrefpsdds Table
//			The downstream medley reference PSD table contains the set of breakpoints exchanged in the
//			MREFPSDds fields of the O-PRM message of [ITU-T G.993.2].
//
//			The format is similar to that specified for the PSD descriptor in [ITUT-G.993.2]. In [ITU-T
//			G.993.2], the first byte gives the size of the table, each entry of which is 3-bytes. In the
//			OMCI definition, the first byte is omitted because the size of the table is known from the
//			response to the get command.
//
//			(R) (mandatory) (3 * N bytes, where N is the number of breakpoints)
//
//		Trellisds
//			0	Trellis not used
//
//			1	Trellis used
//
//			(R) (mandatory for ITU-T G.993.2 VDSL2, optional for others) (1-byte)
//
//			This attribute reports whether trellis coding is in use in the downstream direction.
//
//		Actual Rate Adaptation Mode Downstream
//			The ACT-RA-MODEds attribute indicates the actual active RA mode in the downstream direction.
//
//			1	MANUAL
//
//			2	AT_INIT
//
//			3	DYNAMIC
//
//			4	DYNAMIC with SOS ([ITU-T G.993.2] only)
//
//			(R) (optional) (1-byte)
//
//		Actual Impulse Noise Protection Robust Operations Channel Roc Downstream
//			Actual impulse noise protection robust operations channel (ROC) downstream: The ACTINP-ROC-ds
//			attribute reports the actual INP of the ROC in the downstream direction expressed in multiples
//			of T4k. The INP of this attribute is equal to the integer value multiplied by 0.1 symbols. Valid
//			values and usage are given in clause 7.5.1.34.1 of [ITUT-G.997.1]. (R) (optional) (1-byte)
//
//		Snr Margin Roc Downstream
//			The SNRM-ROC-ds attribute reports the actual signal-to-noise margin of the ROC in the downstream
//			direction. Its value ranges from 0 (-64.0-dB) to 1270 (+63.0-dB). The special value 0xFFFF
//			indicates that the attribute is out of range. (R) (optional) (2-bytes)
//
type Vdsl2LineInventoryAndStatusDataPart1 struct {
	ManagedEntityDefinition
	Attributes AttributeValueMap
}

// Attribute name constants

const Vdsl2LineInventoryAndStatusDataPart1_Vdsl2TransmissionSystemCapabilityXtuC = "Vdsl2TransmissionSystemCapabilityXtuC"
const Vdsl2LineInventoryAndStatusDataPart1_Vdsl2TransmissionSystem = "Vdsl2TransmissionSystem"
const Vdsl2LineInventoryAndStatusDataPart1_Vdsl2Profile = "Vdsl2Profile"
const Vdsl2LineInventoryAndStatusDataPart1_Vdsl2LimitPsdMaskAndBandplan = "Vdsl2LimitPsdMaskAndBandplan"
const Vdsl2LineInventoryAndStatusDataPart1_Vdsl2Us0PsdMask = "Vdsl2Us0PsdMask"
const Vdsl2LineInventoryAndStatusDataPart1_Actsnrmodeds = "Actsnrmodeds"
const Vdsl2LineInventoryAndStatusDataPart1_Hlingds = "Hlingds"
const Vdsl2LineInventoryAndStatusDataPart1_Hloggds = "Hloggds"
const Vdsl2LineInventoryAndStatusDataPart1_Qlngds = "Qlngds"
const Vdsl2LineInventoryAndStatusDataPart1_Snrgds = "Snrgds"
const Vdsl2LineInventoryAndStatusDataPart1_MrefpsddsTable = "MrefpsddsTable"
const Vdsl2LineInventoryAndStatusDataPart1_Trellisds = "Trellisds"
const Vdsl2LineInventoryAndStatusDataPart1_ActualRateAdaptationModeDownstream = "ActualRateAdaptationModeDownstream"
const Vdsl2LineInventoryAndStatusDataPart1_ActualImpulseNoiseProtectionRobustOperationsChannelRocDownstream = "ActualImpulseNoiseProtectionRobustOperationsChannelRocDownstream"
const Vdsl2LineInventoryAndStatusDataPart1_SnrMarginRocDownstream = "SnrMarginRocDownstream"

func init() {
	vdsl2lineinventoryandstatusdatapart1BME = &ManagedEntityDefinition{
		Name:    "Vdsl2LineInventoryAndStatusDataPart1",
		ClassID: Vdsl2LineInventoryAndStatusDataPart1ClassID,
		MessageTypes: mapset.NewSetWith(
			Get,
			GetNext,
		),
		AllowedAttributeMask: 0xfffe,
		AttributeDefinitions: AttributeDefinitionMap{
			0:  Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
			1:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Vdsl2TransmissionSystemCapabilityXtuC, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, false, false, 1),
			2:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Vdsl2TransmissionSystem, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
			3:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Vdsl2Profile, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3),
			4:  Uint64Field(Vdsl2LineInventoryAndStatusDataPart1_Vdsl2LimitPsdMaskAndBandplan, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
			5:  Uint32Field(Vdsl2LineInventoryAndStatusDataPart1_Vdsl2Us0PsdMask, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
			6:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Actsnrmodeds, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
			7:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Hlingds, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
			8:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Hloggds, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, false, false, 8),
			9:  ByteField(Vdsl2LineInventoryAndStatusDataPart1_Qlngds, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, false, false, 9),
			10: ByteField(Vdsl2LineInventoryAndStatusDataPart1_Snrgds, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, false, false, 10),
			11: TableField(Vdsl2LineInventoryAndStatusDataPart1_MrefpsddsTable, TableAttributeType, 0x0020, TableInfo{nil, 3}, mapset.NewSetWith(Read), false, false, false, 11),
			12: ByteField(Vdsl2LineInventoryAndStatusDataPart1_Trellisds, UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read), false, false, false, 12),
			13: ByteField(Vdsl2LineInventoryAndStatusDataPart1_ActualRateAdaptationModeDownstream, UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read), false, true, false, 13),
			14: ByteField(Vdsl2LineInventoryAndStatusDataPart1_ActualImpulseNoiseProtectionRobustOperationsChannelRocDownstream, UnsignedIntegerAttributeType, 0x0004, 0, mapset.NewSetWith(Read), false, true, false, 14),
			15: Uint16Field(Vdsl2LineInventoryAndStatusDataPart1_SnrMarginRocDownstream, UnsignedIntegerAttributeType, 0x0002, 0, mapset.NewSetWith(Read), false, true, false, 15),
		},
		Access:  CreatedByOnu,
		Support: UnknownSupport,
	}
}

// NewVdsl2LineInventoryAndStatusDataPart1 (class ID 168) creates the basic
// Managed Entity definition that is used to validate an ME of this type that
// is received from or transmitted to the OMCC.
func NewVdsl2LineInventoryAndStatusDataPart1(params ...ParamData) (*ManagedEntity, OmciErrors) {
	return NewManagedEntity(*vdsl2lineinventoryandstatusdatapart1BME, params...)
}
