blob: 90cd13e42abbe9ca171781231ae5b740fb4677f7 [file] [log] [blame]
Girish Gowdrae2683102021-03-05 08:24:26 -08001/*
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
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
Andrea Campanella10426e22021-10-15 17:58:04 +020030const GeneralPurposeBufferClassID = ClassID(308) // 0x0134
Girish Gowdrae2683102021-03-05 08:24:26 -080031
32var generalpurposebufferBME *ManagedEntityDefinition
33
Andrea Campanella10426e22021-10-15 17:58:04 +020034// GeneralPurposeBuffer (Class ID: #308 / 0x0134)
Girish Gowdrae2683102021-03-05 08:24:26 -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
Andrea Campanella10426e22021-10-15 17:58:04 +020054// This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory)
55// (2-bytes)
Girish Gowdrae2683102021-03-05 08:24:26 -080056//
57// Maximum Size
Andrea Campanella10426e22021-10-15 17:58:04 +020058// 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 Gowdrae2683102021-03-05 08:24:26 -080065//
66// Buffer Table
Andrea Campanella10426e22021-10-15 17:58:04 +020067// 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 Gowdrae2683102021-03-05 08:24:26 -080070//
71type GeneralPurposeBuffer struct {
72 ManagedEntityDefinition
73 Attributes AttributeValueMap
74}
75
76func init() {
77 generalpurposebufferBME = &ManagedEntityDefinition{
78 Name: "GeneralPurposeBuffer",
79 ClassID: 308,
80 MessageTypes: mapset.NewSetWith(
81 Create,
82 Delete,
83 Get,
84 GetNext,
85 ),
86 AllowedAttributeMask: 0xc000,
87 AttributeDefinitions: AttributeDefinitionMap{
88 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
89 1: Uint32Field("MaximumSize", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 1),
90 2: TableField("BufferTable", TableAttributeType, 0x4000, TableInfo{nil, -1}, mapset.NewSetWith(Read), true, false, false, 2),
91 },
92 Access: CreatedByOlt,
93 Support: UnknownSupport,
94 }
95}
96
97// NewGeneralPurposeBuffer (class ID 308) creates the basic
98// Managed Entity definition that is used to validate an ME of this type that
99// is received from or transmitted to the OMCC.
100func NewGeneralPurposeBuffer(params ...ParamData) (*ManagedEntity, OmciErrors) {
101 return NewManagedEntity(*generalpurposebufferBME, params...)
102}