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 | // LargeStringClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Large string |
| 30 | const LargeStringClassID = ClassID(157) // 0x009d |
| 31 | |
| 32 | var largestringBME *ManagedEntityDefinition |
| 33 | |
| 34 | // LargeString (Class ID: #157 / 0x009d) |
| 35 | // The large string ME holds character strings longer than 25-bytes, up to 375-bytes. It is |
| 36 | // maintained in up to 15 parts, each part containing 25-bytes. If the final part contains fewer |
| 37 | // than 25-bytes, it is terminated by at least one null byte. For example: |
| 38 | // |
| 39 | // Or |
| 40 | // |
| 41 | // Instances of this ME are created and deleted by the OLT. Under some circumstances, they may also |
| 42 | // be created by the ONU. To use this ME, the OLT or ONU instantiates the large string ME and then |
| 43 | // points to the created ME from other ME instances. Systems that maintain the large string should |
| 44 | // ensure that the large string ME is not deleted while it is still linked. |
| 45 | // |
| 46 | // Relationships |
| 47 | // An instance of this ME may be cited by any ME that requires a text string longer than 25-bytes. |
| 48 | // |
| 49 | // Attributes |
| 50 | // Managed Entity Id |
| 51 | // This attribute uniquely identifies each instance of this ME. The value 0xFFFF is reserved. When |
| 52 | // the large string is to be used as an IPv6 address, the value 0 is also reserved. The OLT should |
| 53 | // create large string MEs starting at 1 (or 0), and numbering upwards. The ONU should create large |
| 54 | // string MEs starting at 65534 (0xFFFE) and numbering downwards. (R,-setbycreate) (mandatory) |
| 55 | // (2-bytes) |
| 56 | // |
| 57 | // Number Of Parts |
| 58 | // This attribute specifies the number of non-empty parts that form the large string. This |
| 59 | // attribute defaults to 0 to indicate no large string content is defined.(R,-W) (mandatory) |
| 60 | // (1-byte) |
| 61 | // |
| 62 | // Fifteen additional attributes are defined in the following; they are identical. The large string |
| 63 | // is simply divided into as many parts as necessary, starting at part 1. If the end of the string |
| 64 | // does not lie at a part boundary, it is marked with a null byte. |
| 65 | // |
| 66 | // Part 1 |
| 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) (mandatory) (25-bytes * 15 attributes) |
| 69 | // |
| 70 | // Part 2 |
| 71 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 72 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 73 | // |
| 74 | // Part 3 |
| 75 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 76 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 77 | // |
| 78 | // Part 4 |
| 79 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 80 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 81 | // |
| 82 | // Part 5 |
| 83 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 84 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 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) (mandatory) (25-bytes * 15 attributes) |
| 89 | // |
| 90 | // Part 7 |
| 91 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 92 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 93 | // |
| 94 | // Part 8 |
| 95 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 96 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 97 | // |
| 98 | // Part 9 |
| 99 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 100 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 101 | // |
| 102 | // Part 10 |
| 103 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 104 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 105 | // |
| 106 | // Part 11 |
| 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) (mandatory) (25-bytes * 15 attributes) |
| 109 | // |
| 110 | // Part 12 |
| 111 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 112 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 113 | // |
| 114 | // Part 13 |
| 115 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 116 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 117 | // |
| 118 | // Part 14 |
| 119 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 120 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 121 | // |
| 122 | // Part 15 |
| 123 | // Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part |
| 124 | // 12, Part 13, Part 14, Part 15: (R,-W) (mandatory) (25-bytes * 15 attributes) |
| 125 | // |
| 126 | type LargeString struct { |
| 127 | ManagedEntityDefinition |
| 128 | Attributes AttributeValueMap |
| 129 | } |
| 130 | |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 131 | // Attribute name constants |
| 132 | |
| 133 | const LargeString_NumberOfParts = "NumberOfParts" |
| 134 | const LargeString_Part1 = "Part1" |
| 135 | const LargeString_Part2 = "Part2" |
| 136 | const LargeString_Part3 = "Part3" |
| 137 | const LargeString_Part4 = "Part4" |
| 138 | const LargeString_Part5 = "Part5" |
| 139 | const LargeString_Part6 = "Part6" |
| 140 | const LargeString_Part7 = "Part7" |
| 141 | const LargeString_Part8 = "Part8" |
| 142 | const LargeString_Part9 = "Part9" |
| 143 | const LargeString_Part10 = "Part10" |
| 144 | const LargeString_Part11 = "Part11" |
| 145 | const LargeString_Part12 = "Part12" |
| 146 | const LargeString_Part13 = "Part13" |
| 147 | const LargeString_Part14 = "Part14" |
| 148 | const LargeString_Part15 = "Part15" |
| 149 | |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 150 | func init() { |
| 151 | largestringBME = &ManagedEntityDefinition{ |
| 152 | Name: "LargeString", |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 153 | ClassID: LargeStringClassID, |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 154 | MessageTypes: mapset.NewSetWith( |
| 155 | Create, |
| 156 | Delete, |
| 157 | Get, |
| 158 | Set, |
| 159 | ), |
| 160 | AllowedAttributeMask: 0xffff, |
| 161 | AttributeDefinitions: AttributeDefinitionMap{ |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 162 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 163 | 1: ByteField(LargeString_NumberOfParts, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), true, false, false, 1), |
| 164 | 2: MultiByteField(LargeString_Part1, OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 2), |
| 165 | 3: MultiByteField(LargeString_Part2, OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 3), |
| 166 | 4: MultiByteField(LargeString_Part3, OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 4), |
| 167 | 5: MultiByteField(LargeString_Part4, OctetsAttributeType, 0x0800, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 5), |
| 168 | 6: MultiByteField(LargeString_Part5, OctetsAttributeType, 0x0400, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 6), |
| 169 | 7: MultiByteField(LargeString_Part6, OctetsAttributeType, 0x0200, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 7), |
| 170 | 8: MultiByteField(LargeString_Part7, OctetsAttributeType, 0x0100, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 8), |
| 171 | 9: MultiByteField(LargeString_Part8, OctetsAttributeType, 0x0080, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 9), |
| 172 | 10: MultiByteField(LargeString_Part9, OctetsAttributeType, 0x0040, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 10), |
| 173 | 11: MultiByteField(LargeString_Part10, OctetsAttributeType, 0x0020, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 11), |
| 174 | 12: MultiByteField(LargeString_Part11, OctetsAttributeType, 0x0010, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 12), |
| 175 | 13: MultiByteField(LargeString_Part12, OctetsAttributeType, 0x0008, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 13), |
| 176 | 14: MultiByteField(LargeString_Part13, OctetsAttributeType, 0x0004, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 14), |
| 177 | 15: MultiByteField(LargeString_Part14, OctetsAttributeType, 0x0002, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 15), |
| 178 | 16: MultiByteField(LargeString_Part15, OctetsAttributeType, 0x0001, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 16), |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 179 | }, |
| 180 | Access: CreatedByOlt, |
| 181 | Support: UnknownSupport, |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | // NewLargeString (class ID 157) creates the basic |
| 186 | // Managed Entity definition that is used to validate an ME of this type that |
| 187 | // is received from or transmitted to the OMCC. |
| 188 | func NewLargeString(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 189 | return NewManagedEntity(*largestringBME, params...) |
| 190 | } |