blob: cd323bf5bfc532fb17c1e78c410082ca8615fcae [file] [log] [blame]
Chip Boling115c7912021-02-17 10:34:54 -06001/*
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
30const GeneralPurposeBufferClassID ClassID = ClassID(308)
31
32var generalpurposebufferBME *ManagedEntityDefinition
33
34// GeneralPurposeBuffer (class ID #308)
35// 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
54// Managed entity ID: This attribute uniquely identifies each instance of this ME. (R, setbycreate)
55// (mandatory) (2-bytes)
56//
57// Maximum Size
58// Maximum size: The ONU determines the actual size of the buffer table in the process of capturing
59// the data directed to it. The maximum size attribute permits the OLT to restrict the maximum size
60// of the buffer table. The value 0 indicates that the OLT imposes no limit on the size; it is
61// recognized that ONU implementations will impose their own limits. The ONU will not create a
62// buffer table larger than the value of this attribute. If the ONU cannot allocate enough memory
63// to accommodate this size, it should deny the ME create action or a write operation that attempts
64// to expand an existing ME. (R,-W, setbycreate) (optional) (4-bytes)
65//
66// Buffer Table
67// Buffer table: This attribute is an octet string that contains the result of some operation
68// performed on the ONU. The exact content depends on the operation, and is documented with the
69// definition of each operation. (R) (mandatory) (N bytes)
70//
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}