blob: 80f4e305db24e25f9ea8b52aae692f217ba98257 [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 */
David K. Bainbridgeadf422d2021-04-09 16:06:41 +000017/*
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// AttributeMeClassID is the 16-bit ID for the OMCI
29// Managed entity Attribute ME
30const AttributeMeClassID ClassID = ClassID(289)
31
32var attributemeBME *ManagedEntityDefinition
33
34// AttributeMe (class ID #289)
35// This ME describes a particular attribute type that is supported by the ONU. This ME is not
36// included in an MIB upload.
37//
38// Relationships
39// One or more attribute entities are related to each ME entity. More than one ME entity can refer
40// to a given attribute entity.
41//
42// Attributes
43// Managed Entity Id
44// Managed entity ID: This attribute uniquely identifies each instance of this ME. This number is
45// the same as the one that appears in the attributes table in the ME. Only one instance of each
46// unique attribute need be created. The ONU can assign attribute numbering as it pleases, out of
47// the pool of 64K IDs; however, it is suggested that the numbering follow a rational scheme to aid
48// human readability. (R) (mandatory) (2-bytes)
49//
50// Name
51// Name: This attribute contains a 25-byte mnemonic tag for the attribute. Strings shorter than
52// 25-bytes are padded with null characters. (R) (mandatory) (25-bytes)
53//
54// Size
55// Size: This attribute contains the size of the attribute, in bytes. The value 0 indicates that
56// the attribute can have a variable/unknown size. (R) (mandatory) (2-bytes)
57//
58// Access
59// (R) (mandatory) (1-byte)
60//
61// Format
62// (R) (mandatory) (1-byte)
63//
64// Lower Limit
65// Lower limit: This attribute provides the lowest value for the attribute. Valid for numeric types
66// (pointer, signed integer, unsigned integer) only. For attributes smaller than 4-bytes, the
67// desired numeric value is expressed in 4-byte representation (for example, the 2s complement
68// 1-byte integer 0xFE is expressed as 0xFFFF-FFFE; the unsigned 1-byte integer 0xFE is expressed
69// as 0x0000-00FE). (R) (mandatory) (4-bytes)
70//
71// Upper Limit
72// Upper limit: This attribute provides the highest value for the attribute. It has the same
73// validity and format as the lower limit attribute. (R) (mandatory) (4-bytes)
74//
75// Bit Field
76// Bit field: This attribute is a mask of the supported bits in a bit field attribute, valid for
77// bit field type only. A 1 in any position signifies that its code point is supported, while 0
78// indicates that it is not supported. For bit fields smaller than 4-bytes, the attribute is
79// aligned at the least significant end of the mask. (R) (mandatory) (4-bytes)
80//
81// Code Points Table
82// Code points table: This attribute lists the code points supported by an enumerated attribute.
83// (R) (mandatory) (2 * Q bytes, where Q is the number of entries in the table.)
84//
85// Support
86// (R) (mandatory) (1-byte)
87//
88type AttributeMe struct {
89 ManagedEntityDefinition
90 Attributes AttributeValueMap
91}
92
93func init() {
94 attributemeBME = &ManagedEntityDefinition{
95 Name: "AttributeMe",
96 ClassID: 289,
97 MessageTypes: mapset.NewSetWith(
98 Get,
99 GetNext,
100 ),
101 AllowedAttributeMask: 0xff80,
102 AttributeDefinitions: AttributeDefinitionMap{
103 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
104 1: MultiByteField("Name", OctetsAttributeType, 0x8000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 1),
105 2: Uint16Field("Size", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
106 3: ByteField("Access", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3),
107 4: ByteField("Format", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
108 5: Uint32Field("LowerLimit", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
109 6: Uint32Field("UpperLimit", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
110 7: Uint32Field("BitField", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
111 8: TableField("CodePointsTable", TableAttributeType, 0x0100, TableInfo{nil, 2}, mapset.NewSetWith(Read), false, false, false, 8),
112 9: ByteField("Support", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, false, false, 9),
113 },
114 Access: CreatedByOnu,
115 Support: UnknownSupport,
116 }
117}
118
119// NewAttributeMe (class ID 289) creates the basic
120// Managed Entity definition that is used to validate an ME of this type that
121// is received from or transmitted to the OMCC.
122func NewAttributeMe(params ...ParamData) (*ManagedEntity, OmciErrors) {
123 return NewManagedEntity(*attributemeBME, params...)
124}