blob: 628a9e68b0e21bae0323019a35a7a95b80cd71ca [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
Chip Boling8cdd6392022-01-27 08:43:37 -06004 *
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
Chip Boling8cdd6392022-01-27 08:43:37 -06008 *
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Chip Boling8cdd6392022-01-27 08:43:37 -060010 *
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// OctetStringClassID is the 16-bit ID for the OMCI
29// Managed entity Octet string
Chip Boling610117d2021-09-09 11:24:34 -050030const OctetStringClassID = ClassID(307) // 0x0133
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var octetstringBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// OctetString (Class ID: #307 / 0x0133)
Chip Boling6e27b352020-02-14 09:10:01 -060035// The octet string is modelled on the large string ME. The large string is constrained to
36// printable characters because it uses null as a trailing delimiter. The octet string has a length
37// attribute and is therefore suitable for arbitrary sequences of bytes.
38//
39// Instances of this ME are created and deleted by the OLT. To use this ME, the OLT instantiates
40// the octet string ME and then points to the created ME from other ME instances. Systems that
41// maintain the octet string should ensure that the octet string ME is not deleted while it is
42// still linked.
43//
44// Relationships
45// An instance of this ME may be cited by any ME that requires an octet string that can exceed
46// 25-bytes in length.
47//
48// Attributes
49// Managed Entity Id
Chip Boling610117d2021-09-09 11:24:34 -050050// This attribute uniquely identifies each instance of this ME. The values 0 and 0xFFFF are
51// reserved. (R, setbycreate) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060052//
53// Length
Chip Boling610117d2021-09-09 11:24:34 -050054// This attribute specifies the number of octets that comprise the sequence of octets. This
Chip Boling6e27b352020-02-14 09:10:01 -060055// attribute defaults to 0 to indicate no octet string is defined. The maximum value of this
56// attribute is 375 (15 parts, 25-bytes each). (R,-W) (mandatory) (2-bytes)
57//
Chip Boling610117d2021-09-09 11:24:34 -050058// In the following, 15 additional attributes are defined; they are identical. The octet string is
59// simply divided into as many parts as necessary, starting at part 1 and left justified.
60//
61// Part 1
62// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
63// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
64// attributes)
65//
66// Part 2
67// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
68// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
69// attributes)
70//
71// Part 3
72// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
73// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
74// attributes)
75//
76// Part 4
77// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
78// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
79// attributes)
80//
81// Part 5
82// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
83// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
84// attributes)
85//
86// Part 6
87// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
88// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
89// attributes)
90//
91// Part 7
92// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
93// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
94// attributes)
95//
96// Part 8
97// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
98// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
99// attributes)
100//
101// Part 9
102// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
103// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
104// attributes)
105//
106// Part 10
107// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
108// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
109// attributes)
110//
111// Part 11
112// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
113// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
114// attributes)
115//
116// Part 12
117// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
118// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
119// attributes)
120//
121// Part 13
122// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
123// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
124// attributes)
125//
126// Part 14
127// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
128// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
129// attributes)
130//
131// Part 15
Chip Boling6e27b352020-02-14 09:10:01 -0600132// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
133// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
134// attributes)
135//
136type OctetString struct {
137 ManagedEntityDefinition
138 Attributes AttributeValueMap
139}
140
Chip Boling8cdd6392022-01-27 08:43:37 -0600141// Attribute name constants
142
143const OctetString_Length = "Length"
144const OctetString_Part1 = "Part1"
145const OctetString_Part2 = "Part2"
146const OctetString_Part3 = "Part3"
147const OctetString_Part4 = "Part4"
148const OctetString_Part5 = "Part5"
149const OctetString_Part6 = "Part6"
150const OctetString_Part7 = "Part7"
151const OctetString_Part8 = "Part8"
152const OctetString_Part9 = "Part9"
153const OctetString_Part10 = "Part10"
154const OctetString_Part11 = "Part11"
155const OctetString_Part12 = "Part12"
156const OctetString_Part13 = "Part13"
157const OctetString_Part14 = "Part14"
158const OctetString_Part15 = "Part15"
159
Chip Boling6e27b352020-02-14 09:10:01 -0600160func init() {
161 octetstringBME = &ManagedEntityDefinition{
162 Name: "OctetString",
Chip Boling8cdd6392022-01-27 08:43:37 -0600163 ClassID: OctetStringClassID,
Chip Boling6e27b352020-02-14 09:10:01 -0600164 MessageTypes: mapset.NewSetWith(
165 Create,
166 Delete,
167 Get,
168 Set,
169 ),
Chip Boling610117d2021-09-09 11:24:34 -0500170 AllowedAttributeMask: 0xffff,
Chip Boling6e27b352020-02-14 09:10:01 -0600171 AttributeDefinitions: AttributeDefinitionMap{
Chip Boling8cdd6392022-01-27 08:43:37 -0600172 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
173 1: Uint16Field(OctetString_Length, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
174 2: MultiByteField(OctetString_Part1, OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 2),
175 3: MultiByteField(OctetString_Part2, OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 3),
176 4: MultiByteField(OctetString_Part3, OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 4),
177 5: MultiByteField(OctetString_Part4, OctetsAttributeType, 0x0800, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 5),
178 6: MultiByteField(OctetString_Part5, OctetsAttributeType, 0x0400, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 6),
179 7: MultiByteField(OctetString_Part6, OctetsAttributeType, 0x0200, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 7),
180 8: MultiByteField(OctetString_Part7, OctetsAttributeType, 0x0100, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 8),
181 9: MultiByteField(OctetString_Part8, OctetsAttributeType, 0x0080, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 9),
182 10: MultiByteField(OctetString_Part9, OctetsAttributeType, 0x0040, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 10),
183 11: MultiByteField(OctetString_Part10, OctetsAttributeType, 0x0020, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 11),
184 12: MultiByteField(OctetString_Part11, OctetsAttributeType, 0x0010, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 12),
185 13: MultiByteField(OctetString_Part12, OctetsAttributeType, 0x0008, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 13),
186 14: MultiByteField(OctetString_Part13, OctetsAttributeType, 0x0004, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 14),
187 15: MultiByteField(OctetString_Part14, OctetsAttributeType, 0x0002, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 15),
188 16: MultiByteField(OctetString_Part15, OctetsAttributeType, 0x0001, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 16),
Chip Boling6e27b352020-02-14 09:10:01 -0600189 },
190 Access: CreatedByOlt,
191 Support: UnknownSupport,
192 }
193}
194
195// NewOctetString (class ID 307) creates the basic
196// Managed Entity definition that is used to validate an ME of this type that
197// is received from or transmitted to the OMCC.
198func NewOctetString(params ...ParamData) (*ManagedEntity, OmciErrors) {
199 return NewManagedEntity(*octetstringBME, params...)
200}