Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
| 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 |
| 8 | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 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 | |
| 131 | func init() { |
| 132 | largestringBME = &ManagedEntityDefinition{ |
| 133 | Name: "LargeString", |
| 134 | ClassID: 157, |
| 135 | MessageTypes: mapset.NewSetWith( |
| 136 | Create, |
| 137 | Delete, |
| 138 | Get, |
| 139 | Set, |
| 140 | ), |
| 141 | AllowedAttributeMask: 0xffff, |
| 142 | AttributeDefinitions: AttributeDefinitionMap{ |
| 143 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 144 | 1: ByteField("NumberOfParts", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), true, false, false, 1), |
| 145 | 2: MultiByteField("Part1", OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 2), |
| 146 | 3: MultiByteField("Part2", OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 3), |
| 147 | 4: MultiByteField("Part3", OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 4), |
| 148 | 5: MultiByteField("Part4", OctetsAttributeType, 0x0800, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 5), |
| 149 | 6: MultiByteField("Part5", OctetsAttributeType, 0x0400, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 6), |
| 150 | 7: MultiByteField("Part6", OctetsAttributeType, 0x0200, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 7), |
| 151 | 8: MultiByteField("Part7", OctetsAttributeType, 0x0100, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 8), |
| 152 | 9: MultiByteField("Part8", OctetsAttributeType, 0x0080, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 9), |
| 153 | 10: MultiByteField("Part9", OctetsAttributeType, 0x0040, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 10), |
| 154 | 11: MultiByteField("Part10", OctetsAttributeType, 0x0020, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 11), |
| 155 | 12: MultiByteField("Part11", OctetsAttributeType, 0x0010, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 12), |
| 156 | 13: MultiByteField("Part12", OctetsAttributeType, 0x0008, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 13), |
| 157 | 14: MultiByteField("Part13", OctetsAttributeType, 0x0004, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 14), |
| 158 | 15: MultiByteField("Part14", OctetsAttributeType, 0x0002, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 15), |
| 159 | 16: MultiByteField("Part15", OctetsAttributeType, 0x0001, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), true, false, false, 16), |
| 160 | }, |
| 161 | Access: CreatedByOlt, |
| 162 | Support: UnknownSupport, |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // NewLargeString (class ID 157) creates the basic |
| 167 | // Managed Entity definition that is used to validate an ME of this type that |
| 168 | // is received from or transmitted to the OMCC. |
| 169 | func NewLargeString(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 170 | return NewManagedEntity(*largestringBME, params...) |
| 171 | } |