Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [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 | // AttributeMeClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Attribute ME |
| 30 | const AttributeMeClassID = ClassID(289) // 0x0121 |
| 31 | |
| 32 | var attributemeBME *ManagedEntityDefinition |
| 33 | |
| 34 | // AttributeMe (Class ID: #289 / 0x0121) |
| 35 | // This ME describes a particular attribute type that is supported by the ONU. This ME is not |
| 36 | // included in an MIB upload. |
| 37 | // |
| 38 | // Relationships |
| 39 | // One or more attribute entities are related to each ME entity. More than one ME entity can refer |
| 40 | // to a given attribute entity. |
| 41 | // |
| 42 | // Attributes |
| 43 | // Managed Entity Id |
| 44 | // This attribute uniquely identifies each instance of this ME. This number is the same as the one |
| 45 | // that appears in the attributes table in the ME. Only one instance of each unique attribute need |
| 46 | // be created. The ONU can assign attribute numbering as it pleases, out of the pool of 64K IDs; |
| 47 | // however, it is suggested that the numbering follow a rational scheme to aid human readability. |
| 48 | // (R) (mandatory) (2-bytes) |
| 49 | // |
| 50 | // Name |
| 51 | // This attribute contains a 25-byte mnemonic tag for the attribute. Strings shorter than 25-bytes |
| 52 | // are padded with null characters. (R) (mandatory) (25-bytes) |
| 53 | // |
| 54 | // Size |
| 55 | // This attribute contains the size of the attribute, in bytes. The value 0 indicates that the |
| 56 | // attribute can have a variable/unknown size. (R) (mandatory) (2-bytes) |
| 57 | // |
| 58 | // Access |
| 59 | // This attribute represents the OMCI access characteristics of the attribute. The following code |
| 60 | // points are defined. |
| 61 | // |
| 62 | // 1 Read |
| 63 | // |
| 64 | // 2 Write |
| 65 | // |
| 66 | // 3 Read, write |
| 67 | // |
| 68 | // 5 Read, setbycreate |
| 69 | // |
| 70 | // 6 Write, setbycreate |
| 71 | // |
| 72 | // 7 Read, write, setbycreate |
| 73 | // |
| 74 | // (R) (mandatory) (1-byte) |
| 75 | // |
| 76 | // Format |
| 77 | // This attribute represents the format of the attribute. The following code points are defined. |
| 78 | // |
| 79 | // 1 Pointer |
| 80 | // |
| 81 | // 2 Bit field |
| 82 | // |
| 83 | // 3 Signed integer |
| 84 | // |
| 85 | // 4 Unsigned integer |
| 86 | // |
| 87 | // 5 String |
| 88 | // |
| 89 | // 6 Enumeration (that is, a set of defined code points) |
| 90 | // |
| 91 | // 7 Table |
| 92 | // |
| 93 | // (R) (mandatory) (1-byte) |
| 94 | // |
| 95 | // Lower Limit |
| 96 | // This attribute provides the lowest value for the attribute. Valid for numeric types (pointer, |
| 97 | // signed integer, unsigned integer) only. For attributes smaller than 4-bytes, the desired numeric |
| 98 | // value is expressed in 4-byte representation (for example, the 2s complement 1-byte integer 0xFE |
| 99 | // is expressed as 0xFFFF-FFFE; the unsigned 1-byte integer 0xFE is expressed as 0x0000-00FE). (R) |
| 100 | // (mandatory) (4-bytes) |
| 101 | // |
| 102 | // Upper Limit |
| 103 | // This attribute provides the highest value for the attribute. It has the same validity and format |
| 104 | // as the lower limit attribute. (R) (mandatory) (4-bytes) |
| 105 | // |
| 106 | // Bit Field |
| 107 | // This attribute is a mask of the supported bits in a bit field attribute, valid for bit field |
| 108 | // type only. A 1 in any position signifies that its code point is supported, while 0 indicates |
| 109 | // that it is not supported. For bit fields smaller than 4-bytes, the attribute is aligned at the |
| 110 | // least significant end of the mask. (R) (mandatory) (4-bytes) |
| 111 | // |
| 112 | // Code Points Table |
| 113 | // This attribute lists the code points supported by an enumerated attribute. (R) (mandatory) (2 * |
| 114 | // Q bytes, where Q is the number of entries in the table.) |
| 115 | // |
| 116 | // Support |
| 117 | // This attribute represents the level of support of the attribute (same notation as the attribute |
| 118 | // of the same name in the ME). The following code points are defined. |
| 119 | // |
| 120 | // 1 Fully supported (supported as defined in this object) |
| 121 | // |
| 122 | // 2 Unsupported (OMCI returns an error code if accessed) |
| 123 | // |
| 124 | // 3 Partially supported (some aspects of attribute supported) |
| 125 | // |
| 126 | // 4 Ignored (OMCI supported, but underlying function is not) |
| 127 | // |
| 128 | // (R) (mandatory) (1-byte) |
| 129 | // |
| 130 | type AttributeMe struct { |
| 131 | ManagedEntityDefinition |
| 132 | Attributes AttributeValueMap |
| 133 | } |
| 134 | |
| 135 | func init() { |
| 136 | attributemeBME = &ManagedEntityDefinition{ |
| 137 | Name: "AttributeMe", |
| 138 | ClassID: 289, |
| 139 | MessageTypes: mapset.NewSetWith( |
| 140 | Get, |
| 141 | GetNext, |
| 142 | ), |
| 143 | AllowedAttributeMask: 0xff80, |
| 144 | AttributeDefinitions: AttributeDefinitionMap{ |
| 145 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 146 | 1: MultiByteField("Name", OctetsAttributeType, 0x8000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 1), |
| 147 | 2: Uint16Field("Size", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2), |
| 148 | 3: ByteField("Access", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, false, false, 3), |
| 149 | 4: ByteField("Format", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4), |
| 150 | 5: Uint32Field("LowerLimit", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5), |
| 151 | 6: Uint32Field("UpperLimit", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6), |
| 152 | 7: Uint32Field("BitField", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read), false, false, false, 7), |
| 153 | 8: TableField("CodePointsTable", TableAttributeType, 0x0100, TableInfo{nil, 2}, mapset.NewSetWith(Read), false, false, false, 8), |
| 154 | 9: ByteField("Support", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, false, false, 9), |
| 155 | }, |
| 156 | Access: CreatedByOnu, |
| 157 | Support: UnknownSupport, |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // NewAttributeMe (class ID 289) creates the basic |
| 162 | // Managed Entity definition that is used to validate an ME of this type that |
| 163 | // is received from or transmitted to the OMCC. |
| 164 | func NewAttributeMe(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 165 | return NewManagedEntity(*attributemeBME, params...) |
| 166 | } |