blob: 07e8f79a45b6fd6f59dd80712c2133c44c573a5b [file] [log] [blame]
Holger Hildebrandtfa074992020-03-27 15:42:06 +00001/*
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 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00005 * 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 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
Holger Hildebrandtfa074992020-03-27 15:42:06 +000011 * 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 */
David K. Bainbridged80007b2021-04-12 12:22:29 +000017/*
Holger Hildebrandtfa074992020-03-27 15:42:06 +000018 * 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// OltGClassID is the 16-bit ID for the OMCI
29// Managed entity OLT-G
mpagenko836a1fd2021-11-01 16:12:42 +000030const OltGClassID = ClassID(131) // 0x0083
Holger Hildebrandtfa074992020-03-27 15:42:06 +000031
32var oltgBME *ManagedEntityDefinition
33
mpagenko836a1fd2021-11-01 16:12:42 +000034// OltG (Class ID: #131 / 0x0083)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000035// This optional ME identifies the OLT to which an ONU is connected. This ME provides a way for the
36// ONU to configure itself for operability with a particular OLT. It also provides a way for the
37// OLT to communicate the time of day to the ONU.
38//
39// An ONU that supports this ME automatically creates an instance of it. Immediately following the
40// start-up phase, the OLT should set the ONU to the desired configuration. Interpretation of the
41// OLT vendor ID, equipment ID and version attributes is a matter for negotiation between the two
42// vendors involved.
43//
44// Relationships
45// The single instance of this ME is associated with the ONU ME.
46//
47// Attributes
48// Managed Entity Id
mpagenko836a1fd2021-11-01 16:12:42 +000049// This attribute uniquely identifies each instance of this ME. There is only one instance, number
50// 0. (R) (mandatory) (2-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000051//
52// Olt Vendor Id
mpagenko836a1fd2021-11-01 16:12:42 +000053// This attribute identifies the OLT vendor. It is the same as the four most significant bytes of
54// an ONU serial number specified in the respective TC layer specification. Upon instantiation,
55// this attribute comprises all spaces. (R,-W) (mandatory) (4-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000056//
57// Equipment Id
mpagenko836a1fd2021-11-01 16:12:42 +000058// This attribute may be used to identify the specific type of OLT. The default value of all spaces
59// indicates that equipment ID information is not available or applicable to the OLT being
60// represented. (R,-W) (mandatory) (20-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000061//
62// Version
mpagenko836a1fd2021-11-01 16:12:42 +000063// This attribute identifies the version of the OLT as defined by the vendor. The default left-
64// justified ASCII string "0" (padded with trailing nulls) indicates that version information is
65// not available or applicable to the OLT being represented. (R,-W) (mandatory) (14-bytes)
Holger Hildebrandtfa074992020-03-27 15:42:06 +000066//
67// Time Of Day Information
mpagenko836a1fd2021-11-01 16:12:42 +000068// This attribute provides the information required to achieve time of day synchronization between
69// a reference clock at the OLT and a local clock at the ONU. This attribute comprises two fields:
70// the first field (4-bytes) is the sequence number of the specified GEM superframe. The second
71// field (10-bytes) is TstampN as defined in clause 10.4.6 of [ITUT G.984.3], clause 13.2 of [ITUT
72// G.987.3] and clause 13.2 of [ITU-T G.989.3], using the timestamp format of clause 5.3.3 of [IEEE
73// 1588]. The value 0 in all bytes is reserved as a null value. (R,-W) (optional) (14-bytes)
74//
Holger Hildebrandtfa074992020-03-27 15:42:06 +000075// NOTE - In ITU-T G.987/ITU-T G.989 systems, the superframe count field of the time of day
76// information attribute contains the 32 LSBs of the actual counter.
77//
78type OltG struct {
79 ManagedEntityDefinition
80 Attributes AttributeValueMap
81}
82
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000083// Attribute name constants
84
85const OltG_OltVendorId = "OltVendorId"
86const OltG_EquipmentId = "EquipmentId"
87const OltG_Version = "Version"
88const OltG_TimeOfDayInformation = "TimeOfDayInformation"
89
Holger Hildebrandtfa074992020-03-27 15:42:06 +000090func init() {
91 oltgBME = &ManagedEntityDefinition{
92 Name: "OltG",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000093 ClassID: OltGClassID,
Holger Hildebrandtfa074992020-03-27 15:42:06 +000094 MessageTypes: mapset.NewSetWith(
95 Get,
96 Set,
97 ),
98 AllowedAttributeMask: 0xf000,
99 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000100 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
101 1: MultiByteField(OltG_OltVendorId, StringAttributeType, 0x8000, 4, toOctets("ICAgIA=="), mapset.NewSetWith(Read, Write), false, false, false, 1),
102 2: MultiByteField(OltG_EquipmentId, StringAttributeType, 0x4000, 20, toOctets("ICAgICAgICAgICAgICAgICAgICA="), mapset.NewSetWith(Read, Write), false, false, false, 2),
103 3: MultiByteField(OltG_Version, StringAttributeType, 0x2000, 14, toOctets("MAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read, Write), false, false, false, 3),
104 4: MultiByteField(OltG_TimeOfDayInformation, OctetsAttributeType, 0x1000, 14, toOctets("AAAAAAAAAAAAAAAAAAA="), mapset.NewSetWith(Read, Write), false, true, false, 4),
Holger Hildebrandtfa074992020-03-27 15:42:06 +0000105 },
106 Access: CreatedByOnu,
107 Support: UnknownSupport,
108 }
109}
110
111// NewOltG (class ID 131) creates the basic
112// Managed Entity definition that is used to validate an ME of this type that
113// is received from or transmitted to the OMCC.
114func NewOltG(params ...ParamData) (*ManagedEntity, OmciErrors) {
115 return NewManagedEntity(*oltgBME, params...)
116}