Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame^] | 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [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 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame^] | 8 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame^] | 10 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [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 | */ |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame^] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 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 | // OmciClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity OMCI |
| 30 | const OmciClassID ClassID = ClassID(287) |
| 31 | |
| 32 | var omciBME *ManagedEntityDefinition |
| 33 | |
| 34 | // Omci (class ID #287) |
| 35 | // This ME describes the ONU's general level of support for OMCI MEs and messages. This ME is not |
| 36 | // included in an MIB upload. |
| 37 | // |
| 38 | // Relationships |
| 39 | // One instance exists in the ONU. The ME entities are related to the OMCI entity. |
| 40 | // |
| 41 | // Attributes |
| 42 | // Managed Entity Id |
| 43 | // Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only |
| 44 | // one instance, number 0. (R) (mandatory) (2-bytes) |
| 45 | // |
| 46 | // Me Type Table |
| 47 | // ME type table: This attribute lists the ME classes supported by the ONU. Each entry contains the |
| 48 | // ME class value (see Table 11.2.4-1) of an ME type. (R) (mandatory) (2 * N bytes, where N is the |
| 49 | // number of entries in the list.) |
| 50 | // |
| 51 | // Message Type Table |
| 52 | // Message type table: This attribute is a list of message types (MTs) supported by the ONU. Each |
| 53 | // entry contains the MT of an OMCI message (see Table-11.2.2-1). (R) (mandatory) (M bytes, where M |
| 54 | // is the number of entries in the list.) |
| 55 | // |
| 56 | type Omci struct { |
| 57 | ManagedEntityDefinition |
| 58 | Attributes AttributeValueMap |
| 59 | } |
| 60 | |
| 61 | func init() { |
| 62 | omciBME = &ManagedEntityDefinition{ |
| 63 | Name: "Omci", |
| 64 | ClassID: 287, |
| 65 | MessageTypes: mapset.NewSetWith( |
| 66 | Get, |
| 67 | GetNext, |
| 68 | ), |
| 69 | AllowedAttributeMask: 0xc000, |
| 70 | AttributeDefinitions: AttributeDefinitionMap{ |
| 71 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 72 | 1: TableField("MeTypeTable", TableAttributeType, 0x8000, TableInfo{nil, 2}, mapset.NewSetWith(Read), false, false, false, 1), |
| 73 | 2: TableField("MessageTypeTable", TableAttributeType, 0x4000, TableInfo{nil, 1}, mapset.NewSetWith(Read), false, false, false, 2), |
| 74 | }, |
| 75 | Access: CreatedByOnu, |
| 76 | Support: UnknownSupport, |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // NewOmci (class ID 287) creates the basic |
| 81 | // Managed Entity definition that is used to validate an ME of this type that |
| 82 | // is received from or transmitted to the OMCC. |
| 83 | func NewOmci(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 84 | return NewManagedEntity(*omciBME, params...) |
| 85 | } |