blob: 5d038bcf1b5b7ef0bac00468a60c6fad94c83a67 [file] [log] [blame]
Girish Gowdra5c5aaf42021-02-17 19:40:50 -08001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
Girish Gowdra5c5aaf42021-02-17 19:40:50 -08005 * 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
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
Girish Gowdra5c5aaf42021-02-17 19:40:50 -08009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080011 * 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
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// GeneralPurposeBufferClassID is the 16-bit ID for the OMCI
29// Managed entity General purpose buffer
mpagenko836a1fd2021-11-01 16:12:42 +000030const GeneralPurposeBufferClassID = ClassID(308) // 0x0134
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080031
32var generalpurposebufferBME *ManagedEntityDefinition
33
mpagenko836a1fd2021-11-01 16:12:42 +000034// GeneralPurposeBuffer (Class ID: #308 / 0x0134)
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080035// This ME is created by the OLT when needed to store the results of an operation, such as a test
36// command, that needs to return a block of data of indeterminate size. The buffer is retrieved
37// with get next operations, since its size is not known a priori. An instance of this ME is
38// created and deleted by the OLT, and typically made known to an ONU ME or to an action through a
39// pointer.
40//
41// The ME is defined as generically as possible, such that it can be used for other applications
42// that may not initially be apparent, such as logging. The format of its content is specific to
43// each application, and is documented there.
44//
45// The general purpose buffer is neither captured in an MIB upload, nor retained in a non-volatile
46// ONU memory.
47//
48// Relationships
49// Through a pointer, the OLT may associate a general purpose buffer with an ME or an operation
50// that has a need to create large or indeterminate blocks of data for subsequent upload.
51//
52// Attributes
53// Managed Entity Id
mpagenko836a1fd2021-11-01 16:12:42 +000054// This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory)
55// (2-bytes)
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080056//
57// Maximum Size
mpagenko836a1fd2021-11-01 16:12:42 +000058// The ONU determines the actual size of the buffer table in the process of capturing the data
59// directed to it. The maximum size attribute permits the OLT to restrict the maximum size of the
60// buffer table. The value 0 indicates that the OLT imposes no limit on the size; it is recognized
61// that ONU implementations will impose their own limits. The ONU will not create a buffer table
62// larger than the value of this attribute. If the ONU cannot allocate enough memory to accommodate
63// this size, it should deny the ME create action or a write operation that attempts to expand an
64// existing ME. (R,-W, setbycreate) (optional) (4-bytes)
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080065//
66// Buffer Table
mpagenko836a1fd2021-11-01 16:12:42 +000067// This attribute is an octet string that contains the result of some operation performed on the
68// ONU. The exact content depends on the operation, and is documented with the definition of each
69// operation. (R) (mandatory) (N bytes)
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080070//
71type GeneralPurposeBuffer struct {
72 ManagedEntityDefinition
73 Attributes AttributeValueMap
74}
75
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000076// Attribute name constants
77
78const GeneralPurposeBuffer_MaximumSize = "MaximumSize"
79const GeneralPurposeBuffer_BufferTable = "BufferTable"
80
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080081func init() {
82 generalpurposebufferBME = &ManagedEntityDefinition{
83 Name: "GeneralPurposeBuffer",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000084 ClassID: GeneralPurposeBufferClassID,
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080085 MessageTypes: mapset.NewSetWith(
86 Create,
87 Delete,
88 Get,
89 GetNext,
90 ),
91 AllowedAttributeMask: 0xc000,
92 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000093 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
94 1: Uint32Field(GeneralPurposeBuffer_MaximumSize, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 1),
95 2: TableField(GeneralPurposeBuffer_BufferTable, TableAttributeType, 0x4000, TableInfo{nil, -1}, mapset.NewSetWith(Read), true, false, false, 2),
Girish Gowdra5c5aaf42021-02-17 19:40:50 -080096 },
97 Access: CreatedByOlt,
98 Support: UnknownSupport,
99 }
100}
101
102// NewGeneralPurposeBuffer (class ID 308) creates the basic
103// Managed Entity definition that is used to validate an ME of this type that
104// is received from or transmitted to the OMCC.
105func NewGeneralPurposeBuffer(params ...ParamData) (*ManagedEntity, OmciErrors) {
106 return NewManagedEntity(*generalpurposebufferBME, params...)
107}