blob: 43d73da54b7beb6c6953ecbaaaeec2e485071090 [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
Chip Boling610117d2021-09-09 11:24:34 -050030const AttributeMeClassID = ClassID(289) // 0x0121
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var attributemeBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// AttributeMe (Class ID: #289 / 0x0121)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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
Chip Boling610117d2021-09-09 11:24:34 -050044// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060049//
50// Name
Chip Boling610117d2021-09-09 11:24:34 -050051// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060053//
54// Size
Chip Boling610117d2021-09-09 11:24:34 -050055// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060057//
58// Access
Chip Boling610117d2021-09-09 11:24:34 -050059// 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//
Chip Boling6e27b352020-02-14 09:10:01 -060074// (R) (mandatory) (1-byte)
75//
76// Format
Chip Boling610117d2021-09-09 11:24:34 -050077// 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//
Chip Boling6e27b352020-02-14 09:10:01 -060093// (R) (mandatory) (1-byte)
94//
95// Lower Limit
Chip Boling610117d2021-09-09 11:24:34 -050096// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600101//
102// Upper Limit
Chip Boling610117d2021-09-09 11:24:34 -0500103// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600105//
106// Bit Field
Chip Boling610117d2021-09-09 11:24:34 -0500107// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600111//
112// Code Points Table
Chip Boling610117d2021-09-09 11:24:34 -0500113// 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.)
Chip Boling6e27b352020-02-14 09:10:01 -0600115//
116// Support
Chip Boling610117d2021-09-09 11:24:34 -0500117// 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//
Chip Boling6e27b352020-02-14 09:10:01 -0600128// (R) (mandatory) (1-byte)
129//
130type AttributeMe struct {
131 ManagedEntityDefinition
132 Attributes AttributeValueMap
133}
134
135func init() {
136 attributemeBME = &ManagedEntityDefinition{
137 Name: "AttributeMe",
138 ClassID: 289,
139 MessageTypes: mapset.NewSetWith(
140 Get,
141 GetNext,
142 ),
143 AllowedAttributeMask: 0xff80,
144 AttributeDefinitions: AttributeDefinitionMap{
145 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
146 1: MultiByteField("Name", OctetsAttributeType, 0x8000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 1),
147 2: Uint16Field("Size", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2),
148 3: ByteField("Access", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3),
149 4: ByteField("Format", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
150 5: Uint32Field("LowerLimit", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5),
151 6: Uint32Field("UpperLimit", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6),
152 7: Uint32Field("BitField", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7),
153 8: TableField("CodePointsTable", TableAttributeType, 0x0100, TableInfo{nil, 2}, mapset.NewSetWith(Read), false, false, false, 8),
154 9: ByteField("Support", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, false, false, 9),
155 },
156 Access: CreatedByOnu,
157 Support: UnknownSupport,
158 }
159}
160
161// NewAttributeMe (class ID 289) creates the basic
162// Managed Entity definition that is used to validate an ME of this type that
163// is received from or transmitted to the OMCC.
164func NewAttributeMe(params ...ParamData) (*ManagedEntity, OmciErrors) {
165 return NewManagedEntity(*attributemeBME, params...)
166}