blob: c6f3f0f5c75696bf8c6d86648cc47dc4c661e8cc [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 */
Andrea Campanella7167ebb2020-02-24 09:56:38 +010017 /*
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
30const OctetStringClassID ClassID = ClassID(307)
31
32var octetstringBME *ManagedEntityDefinition
33
34// OctetString (class ID #307)
35// 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
50// Managed entity ID: This attribute uniquely identifies each instance of this ME. The values 0 and
51// 0xFFFF are reserved. (R, setbycreate) (mandatory) (2-bytes)
52//
53// Length
54// Length: This attribute specifies the number of octets that comprise the sequence of octets. This
55// 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//
58// 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
59// Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part
60// 12, Part 13, Part 14, Part 15: (R,-W) (part 1 mandatory, others optional) (25-bytes * 15
61// attributes)
62//
63type OctetString struct {
64 ManagedEntityDefinition
65 Attributes AttributeValueMap
66}
67
68func init() {
69 octetstringBME = &ManagedEntityDefinition{
70 Name: "OctetString",
71 ClassID: 307,
72 MessageTypes: mapset.NewSetWith(
73 Create,
74 Delete,
75 Get,
76 Set,
77 ),
78 AllowedAttributeMask: 0xc000,
79 AttributeDefinitions: AttributeDefinitionMap{
80 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
81 1: Uint16Field("Length", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
82 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),
83 },
84 Access: CreatedByOlt,
85 Support: UnknownSupport,
86 }
87}
88
89// NewOctetString (class ID 307) creates the basic
90// Managed Entity definition that is used to validate an ME of this type that
91// is received from or transmitted to the OMCC.
92func NewOctetString(params ...ParamData) (*ManagedEntity, OmciErrors) {
93 return NewManagedEntity(*octetstringBME, params...)
94}