mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * Copyright 2020-present Open Networking Foundation |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 4 | * |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [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 |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 8 | * |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 10 | * |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [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 | */ |
| 17 | /* |
| 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 |
| 30 | const OctetStringClassID = ClassID(307) // 0x0133 |
| 31 | |
| 32 | var octetstringBME *ManagedEntityDefinition |
| 33 | |
| 34 | // OctetString (Class ID: #307 / 0x0133) |
| 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 | // This attribute uniquely identifies each instance of this ME. The values 0 and 0xFFFF are |
| 51 | // reserved. (R, setbycreate) (mandatory) (2-bytes) |
| 52 | // |
| 53 | // Length |
| 54 | // 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 | // 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 |
| 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 | |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 141 | // Attribute name constants |
| 142 | |
| 143 | const OctetString_Length = "Length" |
| 144 | const OctetString_Part1 = "Part1" |
| 145 | const OctetString_Part2 = "Part2" |
| 146 | const OctetString_Part3 = "Part3" |
| 147 | const OctetString_Part4 = "Part4" |
| 148 | const OctetString_Part5 = "Part5" |
| 149 | const OctetString_Part6 = "Part6" |
| 150 | const OctetString_Part7 = "Part7" |
| 151 | const OctetString_Part8 = "Part8" |
| 152 | const OctetString_Part9 = "Part9" |
| 153 | const OctetString_Part10 = "Part10" |
| 154 | const OctetString_Part11 = "Part11" |
| 155 | const OctetString_Part12 = "Part12" |
| 156 | const OctetString_Part13 = "Part13" |
| 157 | const OctetString_Part14 = "Part14" |
| 158 | const OctetString_Part15 = "Part15" |
| 159 | |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 160 | func init() { |
| 161 | octetstringBME = &ManagedEntityDefinition{ |
| 162 | Name: "OctetString", |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 163 | ClassID: OctetStringClassID, |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 164 | MessageTypes: mapset.NewSetWith( |
| 165 | Create, |
| 166 | Delete, |
| 167 | Get, |
| 168 | Set, |
| 169 | ), |
| 170 | AllowedAttributeMask: 0xffff, |
| 171 | AttributeDefinitions: AttributeDefinitionMap{ |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 172 | 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), |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 189 | }, |
| 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. |
| 198 | func NewOctetString(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 199 | return NewManagedEntity(*octetstringBME, params...) |
| 200 | } |