Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * Unless required by applicable law or agreed to in writing, software |
| 9 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | * See the License for the specific language governing permissions and |
| 12 | * limitations under the License. |
| 13 | */ |
| 14 | /* |
| 15 | * NOTE: This file was generated, manual edits will be overwritten! |
| 16 | * |
| 17 | * Generated by 'goCodeGenerator.py': |
| 18 | * https://github.com/cboling/OMCI-parser/README.md |
| 19 | */ |
| 20 | |
| 21 | package generated |
| 22 | |
| 23 | import "github.com/deckarep/golang-set" |
| 24 | |
| 25 | // OltGClassID is the 16-bit ID for the OMCI |
| 26 | // Managed entity OLT-G |
| 27 | const OltGClassID ClassID = ClassID(131) |
| 28 | |
| 29 | var oltgBME *ManagedEntityDefinition |
| 30 | |
| 31 | // OltG (class ID #131) |
| 32 | // This optional ME identifies the OLT to which an ONU is connected. This ME provides a way for the |
| 33 | // ONU to configure itself for operability with a particular OLT. It also provides a way for the |
| 34 | // OLT to communicate the time of day to the ONU. |
| 35 | // |
| 36 | // An ONU that supports this ME automatically creates an instance of it. Immediately following the |
| 37 | // start-up phase, the OLT should set the ONU to the desired configuration. Interpretation of the |
| 38 | // OLT vendor ID, equipment ID and version attributes is a matter for negotiation between the two |
| 39 | // vendors involved. |
| 40 | // |
| 41 | // Relationships |
| 42 | // The single instance of this ME is associated with the ONU ME. |
| 43 | // |
| 44 | // Attributes |
| 45 | // Managed Entity Id |
| 46 | // Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only |
| 47 | // one instance, number 0. (R) (mandatory) (2-bytes) |
| 48 | // |
| 49 | // Olt Vendor Id |
| 50 | // OLT vendor ID: This attribute identifies the OLT vendor. It is the same as the four most |
| 51 | // significant bytes of an ONU serial number specified in the respective TC layer specification. |
| 52 | // Upon instantiation, this attribute comprises all spaces. (R,-W) (mandatory) (4-bytes) |
| 53 | // |
| 54 | // Equipment Id |
| 55 | // Equipment ID: This attribute may be used to identify the specific type of OLT. The default value |
| 56 | // of all spaces indicates that equipment ID information is not available or applicable to the OLT |
| 57 | // being represented. (R,-W) (mandatory) (20-bytes) |
| 58 | // |
| 59 | // Version |
| 60 | // Version: This attribute identifies the version of the OLT as defined by the vendor. The default |
| 61 | // left-justified ASCII string "0" (padded with trailing nulls) indicates that version information |
| 62 | // is not available or applicable to the OLT being represented. (R,-W) (mandatory) (14-bytes) |
| 63 | // |
| 64 | // Time Of Day Information |
| 65 | // NOTE - In ITU-T G.987/ITU-T G.989 systems, the superframe count field of the time of day |
| 66 | // information attribute contains the 32 LSBs of the actual counter. |
| 67 | // |
| 68 | type OltG struct { |
| 69 | ManagedEntityDefinition |
| 70 | Attributes AttributeValueMap |
| 71 | } |
| 72 | |
| 73 | func init() { |
| 74 | oltgBME = &ManagedEntityDefinition{ |
| 75 | Name: "OltG", |
| 76 | ClassID: 131, |
| 77 | MessageTypes: mapset.NewSetWith( |
| 78 | Get, |
| 79 | Set, |
| 80 | ), |
| 81 | AllowedAttributeMask: 0xf000, |
| 82 | AttributeDefinitions: AttributeDefinitionMap{ |
| 83 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 84 | 1: MultiByteField("OltVendorId", StringAttributeType, 0x8000, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read, Write), false, false, false, 1), |
| 85 | 2: MultiByteField("EquipmentId", StringAttributeType, 0x4000, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read, Write), false, false, false, 2), |
| 86 | 3: MultiByteField("Version", StringAttributeType, 0x2000, 14, toOctets("MAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read, Write), false, false, false, 3), |
| 87 | 4: MultiByteField("TimeOfDayInformation", OctetsAttributeType, 0x1000, 14, toOctets("AAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read, Write), false, true, false, 4), |
| 88 | }, |
| 89 | Access: CreatedByOnu, |
| 90 | Support: UnknownSupport, |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | // NewOltG (class ID 131) creates the basic |
| 95 | // Managed Entity definition that is used to validate an ME of this type that |
| 96 | // is received from or transmitted to the OMCC. |
| 97 | func NewOltG(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 98 | return NewManagedEntity(*oltgBME, params...) |
| 99 | } |