blob: 200e67b77b12b0a83a1e72ceb3ac856578ee787e [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14/*
15 * NOTE: This file was generated, manual edits will be overwritten!
16 *
17 * Generated by 'goCodeGenerator.py':
18 * https://github.com/cboling/OMCI-parser/README.md
19 */
20
21package generated
22
23import "github.com/deckarep/golang-set"
24
25// AttributeMeClassID is the 16-bit ID for the OMCI
26// Managed entity Attribute ME
27const AttributeMeClassID ClassID = ClassID(289)
28
29var attributemeBME *ManagedEntityDefinition
30
31// AttributeMe (class ID #289)
32// This ME describes a particular attribute type that is supported by the ONU. This ME is not
33// included in an MIB upload.
34//
35// Relationships
36// One or more attribute entities are related to each ME entity. More than one ME entity can refer
37// to a given attribute entity.
38//
39// Attributes
40// Managed Entity Id
41// Managed entity ID: This attribute uniquely identifies each instance of this ME. This number is
42// the same as the one that appears in the attributes table in the ME. Only one instance of each
43// unique attribute need be created. The ONU can assign attribute numbering as it pleases, out of
44// the pool of 64K IDs; however, it is suggested that the numbering follow a rational scheme to aid
45// human readability. (R) (mandatory) (2-bytes)
46//
47// Name
48// Name: This attribute contains a 25-byte mnemonic tag for the attribute. Strings shorter than
49// 25-bytes are padded with null characters. (R) (mandatory) (25-bytes)
50//
51// Size
52// Size: This attribute contains the size of the attribute, in bytes. The value 0 indicates that
53// the attribute can have a variable/unknown size. (R) (mandatory) (2-bytes)
54//
55// Access
56// (R) (mandatory) (1-byte)
57//
58// Format
59// (R) (mandatory) (1-byte)
60//
61// Lower Limit
62// Lower limit: This attribute provides the lowest value for the attribute. Valid for numeric types
63// (pointer, signed integer, unsigned integer) only. For attributes smaller than 4-bytes, the
64// desired numeric value is expressed in 4-byte representation (for example, the 2s complement
65// 1-byte integer 0xFE is expressed as 0xFFFF-FFFE; the unsigned 1-byte integer 0xFE is expressed
66// as 0x0000-00FE). (R) (mandatory) (4-bytes)
67//
68// Upper Limit
69// Upper limit: This attribute provides the highest value for the attribute. It has the same
70// validity and format as the lower limit attribute. (R) (mandatory) (4-bytes)
71//
72// Bit Field
73// Bit field: This attribute is a mask of the supported bits in a bit field attribute, valid for
74// bit field type only. A 1 in any position signifies that its code point is supported, while 0
75// indicates that it is not supported. For bit fields smaller than 4-bytes, the attribute is
76// aligned at the least significant end of the mask. (R) (mandatory) (4-bytes)
77//
78// Code Points Table
79// Code points table: This attribute lists the code points supported by an enumerated attribute.
80// (R) (mandatory) (2 * Q bytes, where Q is the number of entries in the table.)
81//
82// Support
83// (R) (mandatory) (1-byte)
84//
85type AttributeMe struct {
86 ManagedEntityDefinition
87 Attributes AttributeValueMap
88}
89
90func init() {
91 attributemeBME = &ManagedEntityDefinition{
92 Name: "AttributeMe",
93 ClassID: 289,
94 MessageTypes: mapset.NewSetWith(
95 Get,
96 GetNext,
97 ),
98 AllowedAttributeMask: 0xff80,
99 AttributeDefinitions: AttributeDefinitionMap{
100 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
101 1: MultiByteField("Name", OctetsAttributeType, 0x8000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 1),
102 2: Uint16Field("Size", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
103 3: ByteField("Access", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3),
104 4: ByteField("Format", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
105 5: Uint32Field("LowerLimit", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
106 6: Uint32Field("UpperLimit", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
107 7: Uint32Field("BitField", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
108 8: TableField("CodePointsTable", TableAttributeType, 0x0100, TableInfo{nil, 2}, mapset.NewSetWith(Read), false, false, false, 8),
109 9: ByteField("Support", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, false, false, 9),
110 },
111 Access: CreatedByOnu,
112 Support: UnknownSupport,
113 }
114}
115
116// NewAttributeMe (class ID 289) creates the basic
117// Managed Entity definition that is used to validate an ME of this type that
118// is received from or transmitted to the OMCC.
119func NewAttributeMe(params ...ParamData) (*ManagedEntity, OmciErrors) {
120 return NewManagedEntity(*attributemeBME, params...)
121}