blob: 1eb2debe04da261f155801ad6e78d9304a646f09 [file] [log] [blame]
mpagenko836a1fd2021-11-01 16:12:42 +00001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
mpagenko836a1fd2021-11-01 16:12:42 +00005 * 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
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
mpagenko836a1fd2021-11-01 16:12:42 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
mpagenko836a1fd2021-11-01 16:12:42 +000011 * 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 */
17/*
18 * 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(289) // 0x0121
31
32var attributemeBME *ManagedEntityDefinition
33
34// AttributeMe (Class ID: #289 / 0x0121)
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// This attribute uniquely identifies each instance of this ME. This number is the same as the one
45// that appears in the attributes table in the ME. Only one instance of each unique attribute need
46// be created. The ONU can assign attribute numbering as it pleases, out of the pool of 64K IDs;
47// however, it is suggested that the numbering follow a rational scheme to aid human readability.
48// (R) (mandatory) (2-bytes)
49//
50// Name
51// This attribute contains a 25-byte mnemonic tag for the attribute. Strings shorter than 25-bytes
52// are padded with null characters. (R) (mandatory) (25-bytes)
53//
54// Size
55// This attribute contains the size of the attribute, in bytes. The value 0 indicates that the
56// attribute can have a variable/unknown size. (R) (mandatory) (2-bytes)
57//
58// Access
59// This attribute represents the OMCI access characteristics of the attribute. The following code
60// points are defined.
61//
62// 1 Read
63//
64// 2 Write
65//
66// 3 Read, write
67//
68// 5 Read, setbycreate
69//
70// 6 Write, setbycreate
71//
72// 7 Read, write, setbycreate
73//
74// (R) (mandatory) (1-byte)
75//
76// Format
77// This attribute represents the format of the attribute. The following code points are defined.
78//
79// 1 Pointer
80//
81// 2 Bit field
82//
83// 3 Signed integer
84//
85// 4 Unsigned integer
86//
87// 5 String
88//
89// 6 Enumeration (that is, a set of defined code points)
90//
91// 7 Table
92//
93// (R) (mandatory) (1-byte)
94//
95// Lower Limit
96// This attribute provides the lowest value for the attribute. Valid for numeric types (pointer,
97// signed integer, unsigned integer) only. For attributes smaller than 4-bytes, the desired numeric
98// value is expressed in 4-byte representation (for example, the 2s complement 1-byte integer 0xFE
99// is expressed as 0xFFFF-FFFE; the unsigned 1-byte integer 0xFE is expressed as 0x0000-00FE). (R)
100// (mandatory) (4-bytes)
101//
102// Upper Limit
103// This attribute provides the highest value for the attribute. It has the same validity and format
104// as the lower limit attribute. (R) (mandatory) (4-bytes)
105//
106// Bit Field
107// This attribute is a mask of the supported bits in a bit field attribute, valid for bit field
108// type only. A 1 in any position signifies that its code point is supported, while 0 indicates
109// that it is not supported. For bit fields smaller than 4-bytes, the attribute is aligned at the
110// least significant end of the mask. (R) (mandatory) (4-bytes)
111//
112// Code Points Table
113// This attribute lists the code points supported by an enumerated attribute. (R) (mandatory) (2 *
114// Q bytes, where Q is the number of entries in the table.)
115//
116// Support
117// This attribute represents the level of support of the attribute (same notation as the attribute
118// of the same name in the ME). The following code points are defined.
119//
120// 1 Fully supported (supported as defined in this object)
121//
122// 2 Unsupported (OMCI returns an error code if accessed)
123//
124// 3 Partially supported (some aspects of attribute supported)
125//
126// 4 Ignored (OMCI supported, but underlying function is not)
127//
128// (R) (mandatory) (1-byte)
129//
130type AttributeMe struct {
131 ManagedEntityDefinition
132 Attributes AttributeValueMap
133}
134
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000135// Attribute name constants
136
137const AttributeMe_Name = "Name"
138const AttributeMe_Size = "Size"
139const AttributeMe_Access = "Access"
140const AttributeMe_Format = "Format"
141const AttributeMe_LowerLimit = "LowerLimit"
142const AttributeMe_UpperLimit = "UpperLimit"
143const AttributeMe_BitField = "BitField"
144const AttributeMe_CodePointsTable = "CodePointsTable"
145const AttributeMe_Support = "Support"
146
mpagenko836a1fd2021-11-01 16:12:42 +0000147func init() {
148 attributemeBME = &ManagedEntityDefinition{
149 Name: "AttributeMe",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000150 ClassID: AttributeMeClassID,
mpagenko836a1fd2021-11-01 16:12:42 +0000151 MessageTypes: mapset.NewSetWith(
152 Get,
153 GetNext,
154 ),
155 AllowedAttributeMask: 0xff80,
156 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000157 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
158 1: MultiByteField(AttributeMe_Name, OctetsAttributeType, 0x8000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 1),
159 2: Uint16Field(AttributeMe_Size, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
160 3: ByteField(AttributeMe_Access, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3),
161 4: ByteField(AttributeMe_Format, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
162 5: Uint32Field(AttributeMe_LowerLimit, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
163 6: Uint32Field(AttributeMe_UpperLimit, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
164 7: Uint32Field(AttributeMe_BitField, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
165 8: TableField(AttributeMe_CodePointsTable, TableAttributeType, 0x0100, TableInfo{nil, 2}, mapset.NewSetWith(Read), false, false, false, 8),
166 9: ByteField(AttributeMe_Support, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, false, false, 9),
mpagenko836a1fd2021-11-01 16:12:42 +0000167 },
168 Access: CreatedByOnu,
169 Support: UnknownSupport,
170 }
171}
172
173// NewAttributeMe (class ID 289) creates the basic
174// Managed Entity definition that is used to validate an ME of this type that
175// is received from or transmitted to the OMCC.
176func NewAttributeMe(params ...ParamData) (*ManagedEntity, OmciErrors) {
177 return NewManagedEntity(*attributemeBME, params...)
178}