Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 5 | * 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 Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 8 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 10 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 11 | * 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. Bainbridge | adf422d | 2021-04-09 16:06:41 +0000 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // OctetStringClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Octet string |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const OctetStringClassID = ClassID(307) // 0x0133 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var octetstringBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // OctetString (Class ID: #307 / 0x0133) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 50 | // This attribute uniquely identifies each instance of this ME. The values 0 and 0xFFFF are |
| 51 | // reserved. (R, setbycreate) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 52 | // |
| 53 | // Length |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 54 | // This attribute specifies the number of octets that comprise the sequence of octets. This |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 58 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 132 | // 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 | // |
| 136 | type OctetString struct { |
| 137 | ManagedEntityDefinition |
| 138 | Attributes AttributeValueMap |
| 139 | } |
| 140 | |
| 141 | func init() { |
| 142 | octetstringBME = &ManagedEntityDefinition{ |
| 143 | Name: "OctetString", |
| 144 | ClassID: 307, |
| 145 | MessageTypes: mapset.NewSetWith( |
| 146 | Create, |
| 147 | Delete, |
| 148 | Get, |
| 149 | Set, |
| 150 | ), |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 151 | AllowedAttributeMask: 0xffff, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 152 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 153 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 154 | 1: Uint16Field("Length", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1), |
| 155 | 2: MultiByteField("Part1", OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 2), |
| 156 | 3: MultiByteField("Part2", OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 3), |
| 157 | 4: MultiByteField("Part3", OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 4), |
| 158 | 5: MultiByteField("Part4", OctetsAttributeType, 0x0800, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 5), |
| 159 | 6: MultiByteField("Part5", OctetsAttributeType, 0x0400, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 6), |
| 160 | 7: MultiByteField("Part6", OctetsAttributeType, 0x0200, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 7), |
| 161 | 8: MultiByteField("Part7", OctetsAttributeType, 0x0100, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 8), |
| 162 | 9: MultiByteField("Part8", OctetsAttributeType, 0x0080, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 9), |
| 163 | 10: MultiByteField("Part9", OctetsAttributeType, 0x0040, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 10), |
| 164 | 11: MultiByteField("Part10", OctetsAttributeType, 0x0020, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 11), |
| 165 | 12: MultiByteField("Part11", OctetsAttributeType, 0x0010, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 12), |
| 166 | 13: MultiByteField("Part12", OctetsAttributeType, 0x0008, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 13), |
| 167 | 14: MultiByteField("Part13", OctetsAttributeType, 0x0004, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 14), |
| 168 | 15: MultiByteField("Part14", OctetsAttributeType, 0x0002, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 15), |
| 169 | 16: MultiByteField("Part15", OctetsAttributeType, 0x0001, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 16), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 170 | }, |
| 171 | Access: CreatedByOlt, |
| 172 | Support: UnknownSupport, |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // NewOctetString (class ID 307) creates the basic |
| 177 | // Managed Entity definition that is used to validate an ME of this type that |
| 178 | // is received from or transmitted to the OMCC. |
| 179 | func NewOctetString(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 180 | return NewManagedEntity(*octetstringBME, params...) |
| 181 | } |