blob: dea63e6dfe99117a8e717baf52373fb4494fcbb2 [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// OctetStringClassID is the 16-bit ID for the OMCI
26// Managed entity Octet string
27const OctetStringClassID ClassID = ClassID(307)
28
29var octetstringBME *ManagedEntityDefinition
30
31// OctetString (class ID #307)
32// The octet string is modelled on the large string ME. The large string is constrained to
33// printable characters because it uses null as a trailing delimiter. The octet string has a length
34// attribute and is therefore suitable for arbitrary sequences of bytes.
35//
36// Instances of this ME are created and deleted by the OLT. To use this ME, the OLT instantiates
37// the octet string ME and then points to the created ME from other ME instances. Systems that
38// maintain the octet string should ensure that the octet string ME is not deleted while it is
39// still linked.
40//
41// Relationships
42// An instance of this ME may be cited by any ME that requires an octet string that can exceed
43// 25-bytes in length.
44//
45// Attributes
46// Managed Entity Id
47// Managed entity ID: This attribute uniquely identifies each instance of this ME. The values 0 and
48// 0xFFFF are reserved. (R, setbycreate) (mandatory) (2-bytes)
49//
50// Length
51// Length: This attribute specifies the number of octets that comprise the sequence of octets. This
52// attribute defaults to 0 to indicate no octet string is defined. The maximum value of this
53// attribute is 375 (15 parts, 25-bytes each). (R,-W) (mandatory) (2-bytes)
54//
55// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part 12, Part 13, Part 14, Part 15
56// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
57// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
58// attributes)
59//
60type OctetString struct {
61 ManagedEntityDefinition
62 Attributes AttributeValueMap
63}
64
65func init() {
66 octetstringBME = &ManagedEntityDefinition{
67 Name: "OctetString",
68 ClassID: 307,
69 MessageTypes: mapset.NewSetWith(
70 Create,
71 Delete,
72 Get,
73 Set,
74 ),
75 AllowedAttributeMask: 0xc000,
76 AttributeDefinitions: AttributeDefinitionMap{
77 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
78 1: Uint16Field("Length", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
79 2: MultiByteField("Part1,Part2,Part3,Part4,Part5,Part6,Part7,Part8,Part9,Part10,Part11,Part12,Part13,Part14,Part15", OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 2),
80 },
81 Access: CreatedByOlt,
82 Support: UnknownSupport,
83 }
84}
85
86// NewOctetString (class ID 307) creates the basic
87// Managed Entity definition that is used to validate an ME of this type that
88// is received from or transmitted to the OMCC.
89func NewOctetString(params ...ParamData) (*ManagedEntity, OmciErrors) {
90 return NewManagedEntity(*octetstringBME, params...)
91}