Chip Boling | 8a5379a | 2020-11-17 12:59:40 -0600 | [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 | |
Chip Boling | 8a5379a | 2020-11-17 12:59:40 -0600 | [diff] [blame] | 28 | var unknownG988BME *ManagedEntityDefinition |
| 29 | |
| 30 | type UnknownG988ME struct { |
| 31 | ManagedEntityDefinition |
| 32 | Attributes AttributeValueMap |
| 33 | } |
| 34 | |
| 35 | func init() { |
| 36 | unknownG988BME = &ManagedEntityDefinition{ |
| 37 | Name: "UnknownItuG988ManagedEntity", |
| 38 | ClassID: 0, |
| 39 | MessageTypes: mapset.NewSetWith( |
| 40 | MibUploadNext, |
| 41 | AlarmNotification, |
| 42 | AttributeValueChange, |
| 43 | ), |
| 44 | AllowedAttributeMask: 0xffff, |
| 45 | AttributeDefinitions: AttributeDefinitionMap{ |
David K. Bainbridge | adf422d | 2021-04-09 16:06:41 +0000 | [diff] [blame^] | 46 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 47 | 1: MultiByteField("UnknownAttr_1", OctetsAttributeType, 0x8000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 1), |
| 48 | 2: MultiByteField("UnknownAttr_2", OctetsAttributeType, 0x4000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 2), |
| 49 | 3: MultiByteField("UnknownAttr_3", OctetsAttributeType, 0x2000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 3), |
| 50 | 4: MultiByteField("UnknownAttr_4", OctetsAttributeType, 0x1000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 4), |
| 51 | 5: MultiByteField("UnknownAttr_5", OctetsAttributeType, 0x0800, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 5), |
| 52 | 6: MultiByteField("UnknownAttr_6", OctetsAttributeType, 0x0400, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 6), |
| 53 | 7: MultiByteField("UnknownAttr_7", OctetsAttributeType, 0x0200, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 7), |
| 54 | 8: MultiByteField("UnknownAttr_8", OctetsAttributeType, 0x0100, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 8), |
| 55 | 9: MultiByteField("UnknownAttr_9", OctetsAttributeType, 0x0080, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 9), |
Chip Boling | 8a5379a | 2020-11-17 12:59:40 -0600 | [diff] [blame] | 56 | 10: MultiByteField("UnknownAttr_10", OctetsAttributeType, 0x0040, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 10), |
| 57 | 11: MultiByteField("UnknownAttr_11", OctetsAttributeType, 0x0020, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 11), |
| 58 | 12: MultiByteField("UnknownAttr_12", OctetsAttributeType, 0x0010, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 12), |
| 59 | 13: MultiByteField("UnknownAttr_13", OctetsAttributeType, 0x0008, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 13), |
| 60 | 14: MultiByteField("UnknownAttr_14", OctetsAttributeType, 0x0004, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 14), |
| 61 | 15: MultiByteField("UnknownAttr_15", OctetsAttributeType, 0x0002, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 15), |
| 62 | 16: MultiByteField("UnknownAttr_16", OctetsAttributeType, 0x0001, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 16), |
| 63 | }, |
| 64 | Access: UnknownAccess, |
| 65 | Support: UnsupportedManagedEntity, |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func NewUnknownG988ME(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 70 | return newUnknownManagedEntity(classID, *unknownG988BME, params...) |
| 71 | } |
| 72 | |
| 73 | // newUnknownManagedEntity creates a ManagedEntity given an ME Definition and parameter/attribute data |
| 74 | // much like NewManagedEntity but treats attributes is a special way |
| 75 | func newUnknownManagedEntity(classID ClassID, definition ManagedEntityDefinition, params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 76 | entity := &ManagedEntity{ |
| 77 | definition: definition, |
| 78 | attributes: make(map[string]interface{}), |
| 79 | } |
| 80 | // Make this unique for the received class ID and attribute masks |
| 81 | entity.SetClassID(classID) |
| 82 | |
| 83 | if params != nil { |
| 84 | if err := entity.setAttributes(params...); err.StatusCode() != Success { |
| 85 | return nil, err |
| 86 | } |
| 87 | } |
| 88 | return entity, NewOmciSuccess() |
| 89 | } |