blob: 64c1ad681082619686ebab257214d4554af1094b [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Matteo Scandolof9d43412021-01-12 11:11:34 -08003 * Copyright 2020-present Open Networking Foundation
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07005 * 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
Elia Battiston9bfe1102022-02-03 10:38:03 +01008 *
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070011 * 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 */
Girish Gowdrae2683102021-03-05 08:24:26 -080017/*
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070018 * 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 */
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070023
Matteo Scandolof9d43412021-01-12 11:11:34 -080024package generated
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070025
26// ManagedEntityInfo provides ManagedEntity information
27type ManagedEntityInfo struct {
28 New func(params ...ParamData) (*ManagedEntity, error)
29}
30
31// ParamData can be passed to the 'New' function to dictate how the returned
32// Managed Entity is created. You should supply either zero or one ParamData
33// structure to 'New'.
34//
35// If No ParamData is passed, the returned Managed Entity can only be used for
36// providing validation of other structures. This is commonly done in a packet
37// encoder/decoder to assist in that process.
38//
39// If One ParamData is passed, the returned Managed Entity will be initialized
40// with the given values/attributes and then validated. This is commonly done
41// when you wish to create an ME for transmission, storage or removal from a
42// persistent database, or some other similar purpose.
43//
44type ParamData struct {
45 EntityID uint16
46 Attributes AttributeValueMap
47}
48
49// CreateME wraps a function that makes it a creator of a Managed Entity
50type CreateME func(params ...ParamData) (*ManagedEntity, OmciErrors)
51
52var classToManagedEntityMap map[ClassID]CreateME
53
54func init() {
55 // Create mapping of 16-bit managed entity class IDs to ME-type
Andrea Campanella10426e22021-10-15 17:58:04 +020056 classToManagedEntityMap = make(map[ClassID]CreateME, 193)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070057
58 classToManagedEntityMap[2] = NewOnuData
59 classToManagedEntityMap[5] = NewCardholder
60 classToManagedEntityMap[6] = NewCircuitPack
61 classToManagedEntityMap[7] = NewSoftwareImage
62 classToManagedEntityMap[11] = NewPhysicalPathTerminationPointEthernetUni
63 classToManagedEntityMap[12] = NewPhysicalPathTerminationPointCesUni
64 classToManagedEntityMap[14] = NewInterworkingVccTerminationPoint
65 classToManagedEntityMap[16] = NewAal5Profile
66 classToManagedEntityMap[18] = NewAal5PerformanceMonitoringHistoryData
67 classToManagedEntityMap[21] = NewCesServiceProfile
68 classToManagedEntityMap[24] = NewEthernetPerformanceMonitoringHistoryData
69 classToManagedEntityMap[45] = NewMacBridgeServiceProfile
70 classToManagedEntityMap[46] = NewMacBridgeConfigurationData
71 classToManagedEntityMap[47] = NewMacBridgePortConfigurationData
72 classToManagedEntityMap[48] = NewMacBridgePortDesignationData
73 classToManagedEntityMap[49] = NewMacBridgePortFilterTableData
74 classToManagedEntityMap[50] = NewMacBridgePortBridgeTableData
75 classToManagedEntityMap[51] = NewMacBridgePerformanceMonitoringHistoryData
76 classToManagedEntityMap[52] = NewMacBridgePortPerformanceMonitoringHistoryData
77 classToManagedEntityMap[53] = NewPhysicalPathTerminationPointPotsUni
78 classToManagedEntityMap[58] = NewVoiceServiceProfile
79 classToManagedEntityMap[62] = NewVpPerformanceMonitoringHistoryData
80 classToManagedEntityMap[78] = NewVlanTaggingOperationConfigurationData
81 classToManagedEntityMap[79] = NewMacBridgePortFilterPreAssignTable
82 classToManagedEntityMap[82] = NewPhysicalPathTerminationPointVideoUni
83 classToManagedEntityMap[83] = NewPhysicalPathTerminationPointLctUni
84 classToManagedEntityMap[84] = NewVlanTaggingFilterData
85 classToManagedEntityMap[89] = NewEthernetPerformanceMonitoringHistoryData2
86 classToManagedEntityMap[90] = NewPhysicalPathTerminationPointVideoAni
87 classToManagedEntityMap[98] = NewPhysicalPathTerminationPointXdslUniPart1
88 classToManagedEntityMap[99] = NewPhysicalPathTerminationPointXdslUniPart2
89 classToManagedEntityMap[100] = NewXdslLineInventoryAndStatusDataPart1
90 classToManagedEntityMap[101] = NewXdslLineInventoryAndStatusDataPart2
91 classToManagedEntityMap[102] = NewXdslChannelDownstreamStatusData
92 classToManagedEntityMap[103] = NewXdslChannelUpstreamStatusData
93 classToManagedEntityMap[105] = NewXdslLineConfigurationProfilePart2
94 classToManagedEntityMap[106] = NewXdslLineConfigurationProfilePart3
95 classToManagedEntityMap[107] = NewXdslChannelConfigurationProfile
96 classToManagedEntityMap[108] = NewXdslSubcarrierMaskingDownstreamProfile
97 classToManagedEntityMap[109] = NewXdslSubcarrierMaskingUpstreamProfile
Matteo Scandolof9d43412021-01-12 11:11:34 -080098 classToManagedEntityMap[110] = NewXdslPsdMaskProfile
99 classToManagedEntityMap[111] = NewXdslDownstreamRfiBandsProfile
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700100 classToManagedEntityMap[112] = NewXdslXtuCPerformanceMonitoringHistoryData
101 classToManagedEntityMap[113] = NewXdslXtuRPerformanceMonitoringHistoryData
102 classToManagedEntityMap[114] = NewXdslXtuCChannelPerformanceMonitoringHistoryData
103 classToManagedEntityMap[115] = NewXdslXtuRChannelPerformanceMonitoringHistoryData
104 classToManagedEntityMap[116] = NewTcAdaptorPerformanceMonitoringHistoryDataXdsl
105 classToManagedEntityMap[130] = NewIeee8021PMapperServiceProfile
106 classToManagedEntityMap[131] = NewOltG
107 classToManagedEntityMap[133] = NewOnuPowerShedding
108 classToManagedEntityMap[134] = NewIpHostConfigData
109 classToManagedEntityMap[135] = NewIpHostPerformanceMonitoringHistoryData
110 classToManagedEntityMap[136] = NewTcpUdpConfigData
111 classToManagedEntityMap[137] = NewNetworkAddress
112 classToManagedEntityMap[138] = NewVoipConfigData
113 classToManagedEntityMap[139] = NewVoipVoiceCtp
114 classToManagedEntityMap[140] = NewCallControlPerformanceMonitoringHistoryData
115 classToManagedEntityMap[141] = NewVoipLineStatus
116 classToManagedEntityMap[142] = NewVoipMediaProfile
117 classToManagedEntityMap[143] = NewRtpProfileData
118 classToManagedEntityMap[144] = NewRtpPerformanceMonitoringHistoryData
119 classToManagedEntityMap[145] = NewNetworkDialPlanTable
120 classToManagedEntityMap[146] = NewVoipApplicationServiceProfile
121 classToManagedEntityMap[147] = NewVoipFeatureAccessCodes
122 classToManagedEntityMap[148] = NewAuthenticationSecurityMethod
Andrea Campanella10426e22021-10-15 17:58:04 +0200123 classToManagedEntityMap[149] = NewSipConfigPortal
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700124 classToManagedEntityMap[150] = NewSipAgentConfigData
125 classToManagedEntityMap[151] = NewSipAgentPerformanceMonitoringHistoryData
126 classToManagedEntityMap[152] = NewSipCallInitiationPerformanceMonitoringHistoryData
127 classToManagedEntityMap[153] = NewSipUserData
Andrea Campanella10426e22021-10-15 17:58:04 +0200128 classToManagedEntityMap[154] = NewMgcConfigPortal
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700129 classToManagedEntityMap[155] = NewMgcConfigData
130 classToManagedEntityMap[156] = NewMgcPerformanceMonitoringHistoryData
Andrea Campanella10426e22021-10-15 17:58:04 +0200131 classToManagedEntityMap[157] = NewLargeString
132 classToManagedEntityMap[158] = NewOnuRemoteDebug
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700133 classToManagedEntityMap[160] = NewEquipmentExtensionPackage
134 classToManagedEntityMap[162] = NewPhysicalPathTerminationPointMocaUni
135 classToManagedEntityMap[163] = NewMocaEthernetPerformanceMonitoringHistoryData
Andrea Campanella10426e22021-10-15 17:58:04 +0200136 classToManagedEntityMap[164] = NewMocaInterfacePerformanceMonitoringHistoryData
137 classToManagedEntityMap[165] = NewVdsl2LineConfigurationExtensions
Matteo Scandolof9d43412021-01-12 11:11:34 -0800138 classToManagedEntityMap[168] = NewVdsl2LineInventoryAndStatusDataPart1
139 classToManagedEntityMap[169] = NewVdsl2LineInventoryAndStatusDataPart2
140 classToManagedEntityMap[170] = NewVdsl2LineInventoryAndStatusDataPart3
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700141 classToManagedEntityMap[171] = NewExtendedVlanTaggingOperationConfigurationData
142 classToManagedEntityMap[256] = NewOnuG
143 classToManagedEntityMap[257] = NewOnu2G
144 classToManagedEntityMap[262] = NewTCont
145 classToManagedEntityMap[263] = NewAniG
146 classToManagedEntityMap[264] = NewUniG
147 classToManagedEntityMap[266] = NewGemInterworkingTerminationPoint
148 classToManagedEntityMap[268] = NewGemPortNetworkCtp
149 classToManagedEntityMap[269] = NewVpNetworkCtp
150 classToManagedEntityMap[272] = NewGalEthernetProfile
151 classToManagedEntityMap[273] = NewThresholdData1
152 classToManagedEntityMap[274] = NewThresholdData2
153 classToManagedEntityMap[276] = NewGalEthernetPerformanceMonitoringHistoryData
154 classToManagedEntityMap[277] = NewPriorityQueue
155 classToManagedEntityMap[278] = NewTrafficScheduler
156 classToManagedEntityMap[280] = NewTrafficDescriptor
157 classToManagedEntityMap[281] = NewMulticastGemInterworkingTerminationPoint
158 classToManagedEntityMap[282] = NewPseudowireTerminationPoint
159 classToManagedEntityMap[283] = NewRtpPseudowireParameters
160 classToManagedEntityMap[284] = NewPseudowireMaintenanceProfile
161 classToManagedEntityMap[285] = NewPseudowirePerformanceMonitoringHistoryData
162 classToManagedEntityMap[286] = NewEthernetFlowTerminationPoint
163 classToManagedEntityMap[287] = NewOmci
164 classToManagedEntityMap[288] = NewManagedEntityMe
165 classToManagedEntityMap[289] = NewAttributeMe
166 classToManagedEntityMap[290] = NewDot1XPortExtensionPackage
167 classToManagedEntityMap[291] = NewDot1XConfigurationProfile
168 classToManagedEntityMap[292] = NewDot1XPerformanceMonitoringHistoryData
169 classToManagedEntityMap[293] = NewRadiusPerformanceMonitoringHistoryData
170 classToManagedEntityMap[296] = NewEthernetPerformanceMonitoringHistoryData3
171 classToManagedEntityMap[298] = NewDot1RateLimiter
172 classToManagedEntityMap[299] = NewDot1AgMaintenanceDomain
173 classToManagedEntityMap[300] = NewDot1AgMaintenanceAssociation
174 classToManagedEntityMap[301] = NewDot1AgDefaultMdLevel
175 classToManagedEntityMap[302] = NewDot1AgMep
176 classToManagedEntityMap[305] = NewDot1AgCfmStack
Matteo Scandolof9d43412021-01-12 11:11:34 -0800177 classToManagedEntityMap[306] = NewDot1AgChassisManagementInfo
178 classToManagedEntityMap[307] = NewOctetString
Girish Gowdrae2683102021-03-05 08:24:26 -0800179 classToManagedEntityMap[308] = NewGeneralPurposeBuffer
Matteo Scandolof9d43412021-01-12 11:11:34 -0800180 classToManagedEntityMap[309] = NewMulticastOperationsProfile
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700181 classToManagedEntityMap[310] = NewMulticastSubscriberConfigInfo
182 classToManagedEntityMap[311] = NewMulticastSubscriberMonitor
Girish Gowdrae2683102021-03-05 08:24:26 -0800183 classToManagedEntityMap[312] = NewFecPerformanceMonitoringHistoryData
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700184 classToManagedEntityMap[313] = NewReAniG
Matteo Scandolof9d43412021-01-12 11:11:34 -0800185 classToManagedEntityMap[314] = NewPhysicalPathTerminationPointReUni
186 classToManagedEntityMap[315] = NewReUpstreamAmplifier
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700187 classToManagedEntityMap[316] = NewReDownstreamAmplifier
188 classToManagedEntityMap[321] = NewEthernetFramePerformanceMonitoringHistoryDataDownstream
189 classToManagedEntityMap[322] = NewEthernetFramePerformanceMonitoringHistoryDataUpstream
Matteo Scandolof9d43412021-01-12 11:11:34 -0800190 classToManagedEntityMap[323] = NewVdsl2LineConfigurationExtensions2
191 classToManagedEntityMap[324] = NewXdslImpulseNoiseMonitorPerformanceMonitoringHistoryData
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700192 classToManagedEntityMap[325] = NewXdslLineInventoryAndStatusDataPart5
193 classToManagedEntityMap[328] = NewReCommonAmplifierParameters
194 classToManagedEntityMap[329] = NewVirtualEthernetInterfacePoint
195 classToManagedEntityMap[332] = NewEnhancedSecurityControl
196 classToManagedEntityMap[333] = NewMplsPseudowireTerminationPoint
197 classToManagedEntityMap[334] = NewEthernetFrameExtendedPm
198 classToManagedEntityMap[335] = NewSnmpConfigurationData
199 classToManagedEntityMap[336] = NewOnuDynamicPowerManagementControl
Matteo Scandolof9d43412021-01-12 11:11:34 -0800200 classToManagedEntityMap[337] = NewPwAtmConfigurationData
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700201 classToManagedEntityMap[338] = NewPwAtmPerformanceMonitoringHistoryData
202 classToManagedEntityMap[339] = NewPwEthernetConfigurationData
203 classToManagedEntityMap[340] = NewBbfTr069ManagementServer
204 classToManagedEntityMap[341] = NewGemPortNetworkCtpPerformanceMonitoringHistoryData
205 classToManagedEntityMap[342] = NewTcpUdpPerformanceMonitoringHistoryData
206 classToManagedEntityMap[343] = NewEnergyConsumptionPerformanceMonitoringHistoryData
207 classToManagedEntityMap[344] = NewXgPonTcPerformanceMonitoringHistoryData
208 classToManagedEntityMap[345] = NewXgPonDownstreamManagementPerformanceMonitoringHistoryData
209 classToManagedEntityMap[346] = NewXgPonUpstreamManagementPerformanceMonitoringHistoryData
210 classToManagedEntityMap[348] = NewMacBridgePortIcmpv6ProcessPreAssignTable
211 classToManagedEntityMap[400] = NewEthernetPseudowireParameters
Andrea Campanella10426e22021-10-15 17:58:04 +0200212 classToManagedEntityMap[406] = NewEponDownstreamPerformanceMonitoringConfiguration
213 classToManagedEntityMap[407] = NewSipAgentConfigData2
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700214 classToManagedEntityMap[408] = NewXdslXtuCPerformanceMonitoringHistoryDataPart2
215 classToManagedEntityMap[410] = NewVdsl2LineConfigurationExtensions3
216 classToManagedEntityMap[412] = NewXdslChannelConfigurationProfilePart2
Matteo Scandolof9d43412021-01-12 11:11:34 -0800217 classToManagedEntityMap[413] = NewXtuDataGatheringConfiguration
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700218 classToManagedEntityMap[414] = NewXdslLineInventoryAndStatusDataPart8
Andrea Campanella10426e22021-10-15 17:58:04 +0200219 classToManagedEntityMap[415] = NewVdsl2LineInventoryAndStatusDataPart4
220 classToManagedEntityMap[418] = NewEfmBondingGroup
221 classToManagedEntityMap[419] = NewEfmBondingLink
222 classToManagedEntityMap[420] = NewEfmBondingGroupPerformanceMonitoringHistoryData
223 classToManagedEntityMap[421] = NewEfmBondingGroupPerformanceMonitoringHistoryDataPart2
224 classToManagedEntityMap[422] = NewEfmBondingLinkPerformanceMonitoringHistoryData
225 classToManagedEntityMap[423] = NewEfmBondingPortPerformanceMonitoringHistoryData
226 classToManagedEntityMap[424] = NewEfmBondingPortPerformanceMonitoringHistoryDataPart2
227 classToManagedEntityMap[425] = NewEthernetFrameExtendedPm64Bit
228 classToManagedEntityMap[427] = NewPhysicalPathTerminationPointXdslUniPart3
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700229 classToManagedEntityMap[432] = NewFastChannelConfigurationProfile
230 classToManagedEntityMap[433] = NewFastDataPathConfigurationProfile
231 classToManagedEntityMap[434] = NewFastVectoringLineConfigurationExtensions
232 classToManagedEntityMap[436] = NewFastLineInventoryAndStatusDataPart2
233 classToManagedEntityMap[437] = NewFastXtuCPerformanceMonitoringHistoryData
234 classToManagedEntityMap[438] = NewFastXtuRPerformanceMonitoringHistoryData
Andrea Campanella10426e22021-10-15 17:58:04 +0200235 classToManagedEntityMap[440] = NewTimeStatusMessage
236 classToManagedEntityMap[441] = NewOnu3G
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700237 classToManagedEntityMap[443] = NewTwdmChannelManagedEntity
238 classToManagedEntityMap[444] = NewTwdmChannelPhyLodsPerformanceMonitoringHistoryData
239 classToManagedEntityMap[445] = NewTwdmChannelXgemPerformanceMonitoringHistoryData
240 classToManagedEntityMap[446] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart1
241 classToManagedEntityMap[447] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart2
242 classToManagedEntityMap[448] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart3
243 classToManagedEntityMap[449] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart1
244 classToManagedEntityMap[450] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart2
245 classToManagedEntityMap[451] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart3
246 classToManagedEntityMap[452] = NewTwdmChannelOmciPerformanceMonitoringHistoryData
Matteo Scandolof9d43412021-01-12 11:11:34 -0800247 classToManagedEntityMap[453] = NewEnhancedFecPerformanceMonitoringHistoryData
248 classToManagedEntityMap[454] = NewEnhancedTcPerformanceMonitoringHistoryData
Andrea Campanella10426e22021-10-15 17:58:04 +0200249 classToManagedEntityMap[456] = NewOnuManufacturingData
250 classToManagedEntityMap[457] = NewOnuTimeConfiguration
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700251}
252
Matteo Scandolof9d43412021-01-12 11:11:34 -0800253// LoadManagedEntityDefinition returns a function to create a Managed Entity for a specific
254// Managed Entity class ID
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700255func LoadManagedEntityDefinition(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800256 if newFunc, ok := classToManagedEntityMap[classID]; ok {
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700257 return newFunc(params...)
258 }
Matteo Scandolof9d43412021-01-12 11:11:34 -0800259 if IsVendorSpecificClassID(classID) {
260 return NewUnknownVendorSpecificME(classID, params...)
261 }
262 return NewUnknownG988ME(classID, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700263}
264
Matteo Scandolof9d43412021-01-12 11:11:34 -0800265// GetSupportedClassIDs returns an array of Managed Entity Class IDs supported
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700266func GetSupportedClassIDs() []ClassID {
267 supported := make([]ClassID, 0, len(classToManagedEntityMap))
268 for k := range classToManagedEntityMap {
269 supported = append(supported, k)
270 }
271 return supported
272}
Matteo Scandolof9d43412021-01-12 11:11:34 -0800273
274// GetAttributesDefinitions returns the attribute definition map for a specific class
275func GetAttributesDefinitions(classID ClassID) (AttributeDefinitionMap, OmciErrors) {
276 medef, err := LoadManagedEntityDefinition(classID)
277 if err.StatusCode() != Success {
278 return nil, err
279 }
280 return medef.GetAttributeDefinitions(), err
281}
282
283// IsVendorSpecificClassID returns true if the provided class ID is reserved in ITU-T G.988
284// for vendor specific functionality
285func IsVendorSpecificClassID(classID ClassID) bool {
286 // Values below are from Table 11.2.4-1 of ITU-T G.988 (11/2017)
287 return (ClassID(240) <= classID && classID <= ClassID(255)) ||
288 (ClassID(350) <= classID && classID <= ClassID(399)) ||
289 (ClassID(65280) <= classID && classID <= ClassID(65535))
Girish Gowdra161d27a2021-05-05 12:01:44 -0700290}
Andrea Campanella10426e22021-10-15 17:58:04 +0200291
292// IsUnknownClassID returns true if the provided class ID is reserved in ITU-T G.988
293// for vendor specific functionality or is not decoded/supported by this library
294func IsUnknownClassID(classID ClassID) bool {
295 if _, err := LoadManagedEntityDefinition(classID); err != nil {
296 return false
297 }
298 return true
299}