blob: 7538d668855bdcbcfd2dd5dafebea9d80a2f4013 [file] [log] [blame]
Takahiro Suzuki241c10e2020-12-17 20:17:57 +09001/*
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 "fmt"
27
28// ManagedEntityInfo provides ManagedEntity information
29type ManagedEntityInfo struct {
30 New func(params ...ParamData) (*ManagedEntity, error)
31}
32
33// ParamData can be passed to the 'New' function to dictate how the returned
34// Managed Entity is created. You should supply either zero or one ParamData
35// structure to 'New'.
36//
37// If No ParamData is passed, the returned Managed Entity can only be used for
38// providing validation of other structures. This is commonly done in a packet
39// encoder/decoder to assist in that process.
40//
41// If One ParamData is passed, the returned Managed Entity will be initialized
42// with the given values/attributes and then validated. This is commonly done
43// when you wish to create an ME for transmission, storage or removal from a
44// persistent database, or some other similar purpose.
45//
46type ParamData struct {
47 EntityID uint16
48 Attributes AttributeValueMap
49}
50
51// CreateME wraps a function that makes it a creator of a Managed Entity
52type CreateME func(params ...ParamData) (*ManagedEntity, OmciErrors)
53
54var classToManagedEntityMap map[ClassID]CreateME
55
56func init() {
57 // Create mapping of 16-bit managed entity class IDs to ME-type
58 classToManagedEntityMap = make(map[ClassID]CreateME, 177)
59
60 classToManagedEntityMap[2] = NewOnuData
61 classToManagedEntityMap[5] = NewCardholder
62 classToManagedEntityMap[6] = NewCircuitPack
63 classToManagedEntityMap[7] = NewSoftwareImage
64 classToManagedEntityMap[11] = NewPhysicalPathTerminationPointEthernetUni
65 classToManagedEntityMap[12] = NewPhysicalPathTerminationPointCesUni
66 classToManagedEntityMap[14] = NewInterworkingVccTerminationPoint
67 classToManagedEntityMap[16] = NewAal5Profile
68 classToManagedEntityMap[18] = NewAal5PerformanceMonitoringHistoryData
69 classToManagedEntityMap[21] = NewCesServiceProfile
70 classToManagedEntityMap[24] = NewEthernetPerformanceMonitoringHistoryData
71 classToManagedEntityMap[45] = NewMacBridgeServiceProfile
72 classToManagedEntityMap[46] = NewMacBridgeConfigurationData
73 classToManagedEntityMap[47] = NewMacBridgePortConfigurationData
74 classToManagedEntityMap[48] = NewMacBridgePortDesignationData
75 classToManagedEntityMap[49] = NewMacBridgePortFilterTableData
76 classToManagedEntityMap[50] = NewMacBridgePortBridgeTableData
77 classToManagedEntityMap[51] = NewMacBridgePerformanceMonitoringHistoryData
78 classToManagedEntityMap[52] = NewMacBridgePortPerformanceMonitoringHistoryData
79 classToManagedEntityMap[53] = NewPhysicalPathTerminationPointPotsUni
80 classToManagedEntityMap[58] = NewVoiceServiceProfile
81 classToManagedEntityMap[62] = NewVpPerformanceMonitoringHistoryData
82 classToManagedEntityMap[78] = NewVlanTaggingOperationConfigurationData
83 classToManagedEntityMap[79] = NewMacBridgePortFilterPreAssignTable
84 classToManagedEntityMap[82] = NewPhysicalPathTerminationPointVideoUni
85 classToManagedEntityMap[83] = NewPhysicalPathTerminationPointLctUni
86 classToManagedEntityMap[84] = NewVlanTaggingFilterData
87 classToManagedEntityMap[89] = NewEthernetPerformanceMonitoringHistoryData2
88 classToManagedEntityMap[90] = NewPhysicalPathTerminationPointVideoAni
89 classToManagedEntityMap[98] = NewPhysicalPathTerminationPointXdslUniPart1
90 classToManagedEntityMap[99] = NewPhysicalPathTerminationPointXdslUniPart2
91 classToManagedEntityMap[100] = NewXdslLineInventoryAndStatusDataPart1
92 classToManagedEntityMap[101] = NewXdslLineInventoryAndStatusDataPart2
93 classToManagedEntityMap[102] = NewXdslChannelDownstreamStatusData
94 classToManagedEntityMap[103] = NewXdslChannelUpstreamStatusData
95 classToManagedEntityMap[105] = NewXdslLineConfigurationProfilePart2
96 classToManagedEntityMap[106] = NewXdslLineConfigurationProfilePart3
97 classToManagedEntityMap[107] = NewXdslChannelConfigurationProfile
98 classToManagedEntityMap[108] = NewXdslSubcarrierMaskingDownstreamProfile
99 classToManagedEntityMap[109] = NewXdslSubcarrierMaskingUpstreamProfile
100 classToManagedEntityMap[110] = NewXdslPsdMaskProfile
101 classToManagedEntityMap[111] = NewXdslDownstreamRfiBandsProfile
102 classToManagedEntityMap[112] = NewXdslXtuCPerformanceMonitoringHistoryData
103 classToManagedEntityMap[113] = NewXdslXtuRPerformanceMonitoringHistoryData
104 classToManagedEntityMap[114] = NewXdslXtuCChannelPerformanceMonitoringHistoryData
105 classToManagedEntityMap[115] = NewXdslXtuRChannelPerformanceMonitoringHistoryData
106 classToManagedEntityMap[116] = NewTcAdaptorPerformanceMonitoringHistoryDataXdsl
107 classToManagedEntityMap[130] = NewIeee8021PMapperServiceProfile
108 classToManagedEntityMap[131] = NewOltG
109 classToManagedEntityMap[133] = NewOnuPowerShedding
110 classToManagedEntityMap[134] = NewIpHostConfigData
111 classToManagedEntityMap[135] = NewIpHostPerformanceMonitoringHistoryData
112 classToManagedEntityMap[136] = NewTcpUdpConfigData
113 classToManagedEntityMap[137] = NewNetworkAddress
114 classToManagedEntityMap[138] = NewVoipConfigData
115 classToManagedEntityMap[139] = NewVoipVoiceCtp
116 classToManagedEntityMap[140] = NewCallControlPerformanceMonitoringHistoryData
117 classToManagedEntityMap[141] = NewVoipLineStatus
118 classToManagedEntityMap[142] = NewVoipMediaProfile
119 classToManagedEntityMap[143] = NewRtpProfileData
120 classToManagedEntityMap[144] = NewRtpPerformanceMonitoringHistoryData
121 classToManagedEntityMap[145] = NewNetworkDialPlanTable
122 classToManagedEntityMap[146] = NewVoipApplicationServiceProfile
123 classToManagedEntityMap[147] = NewVoipFeatureAccessCodes
124 classToManagedEntityMap[148] = NewAuthenticationSecurityMethod
125 classToManagedEntityMap[150] = NewSipAgentConfigData
126 classToManagedEntityMap[151] = NewSipAgentPerformanceMonitoringHistoryData
127 classToManagedEntityMap[152] = NewSipCallInitiationPerformanceMonitoringHistoryData
128 classToManagedEntityMap[153] = NewSipUserData
129 classToManagedEntityMap[155] = NewMgcConfigData
130 classToManagedEntityMap[156] = NewMgcPerformanceMonitoringHistoryData
131 classToManagedEntityMap[160] = NewEquipmentExtensionPackage
132 classToManagedEntityMap[162] = NewPhysicalPathTerminationPointMocaUni
133 classToManagedEntityMap[163] = NewMocaEthernetPerformanceMonitoringHistoryData
134 classToManagedEntityMap[168] = NewVdsl2LineInventoryAndStatusDataPart1
135 classToManagedEntityMap[169] = NewVdsl2LineInventoryAndStatusDataPart2
136 classToManagedEntityMap[170] = NewVdsl2LineInventoryAndStatusDataPart3
137 classToManagedEntityMap[171] = NewExtendedVlanTaggingOperationConfigurationData
138 classToManagedEntityMap[256] = NewOnuG
139 classToManagedEntityMap[257] = NewOnu2G
140 classToManagedEntityMap[262] = NewTCont
141 classToManagedEntityMap[263] = NewAniG
142 classToManagedEntityMap[264] = NewUniG
143 classToManagedEntityMap[266] = NewGemInterworkingTerminationPoint
144 classToManagedEntityMap[268] = NewGemPortNetworkCtp
145 classToManagedEntityMap[269] = NewVpNetworkCtp
146 classToManagedEntityMap[272] = NewGalEthernetProfile
147 classToManagedEntityMap[273] = NewThresholdData1
148 classToManagedEntityMap[274] = NewThresholdData2
149 classToManagedEntityMap[276] = NewGalEthernetPerformanceMonitoringHistoryData
150 classToManagedEntityMap[277] = NewPriorityQueue
151 classToManagedEntityMap[278] = NewTrafficScheduler
152 classToManagedEntityMap[280] = NewTrafficDescriptor
153 classToManagedEntityMap[281] = NewMulticastGemInterworkingTerminationPoint
154 classToManagedEntityMap[282] = NewPseudowireTerminationPoint
155 classToManagedEntityMap[283] = NewRtpPseudowireParameters
156 classToManagedEntityMap[284] = NewPseudowireMaintenanceProfile
157 classToManagedEntityMap[285] = NewPseudowirePerformanceMonitoringHistoryData
158 classToManagedEntityMap[286] = NewEthernetFlowTerminationPoint
159 classToManagedEntityMap[287] = NewOmci
160 classToManagedEntityMap[288] = NewManagedEntityMe
161 classToManagedEntityMap[289] = NewAttributeMe
162 classToManagedEntityMap[290] = NewDot1XPortExtensionPackage
163 classToManagedEntityMap[291] = NewDot1XConfigurationProfile
164 classToManagedEntityMap[292] = NewDot1XPerformanceMonitoringHistoryData
165 classToManagedEntityMap[293] = NewRadiusPerformanceMonitoringHistoryData
166 classToManagedEntityMap[296] = NewEthernetPerformanceMonitoringHistoryData3
167 classToManagedEntityMap[298] = NewDot1RateLimiter
168 classToManagedEntityMap[299] = NewDot1AgMaintenanceDomain
169 classToManagedEntityMap[300] = NewDot1AgMaintenanceAssociation
170 classToManagedEntityMap[301] = NewDot1AgDefaultMdLevel
171 classToManagedEntityMap[302] = NewDot1AgMep
172 classToManagedEntityMap[305] = NewDot1AgCfmStack
173 classToManagedEntityMap[306] = NewDot1AgChassisManagementInfo
174 classToManagedEntityMap[307] = NewOctetString
175 classToManagedEntityMap[309] = NewMulticastOperationsProfile
176 classToManagedEntityMap[310] = NewMulticastSubscriberConfigInfo
177 classToManagedEntityMap[311] = NewMulticastSubscriberMonitor
178 classToManagedEntityMap[313] = NewReAniG
179 classToManagedEntityMap[314] = NewPhysicalPathTerminationPointReUni
180 classToManagedEntityMap[315] = NewReUpstreamAmplifier
181 classToManagedEntityMap[316] = NewReDownstreamAmplifier
182 classToManagedEntityMap[321] = NewEthernetFramePerformanceMonitoringHistoryDataDownstream
183 classToManagedEntityMap[322] = NewEthernetFramePerformanceMonitoringHistoryDataUpstream
184 classToManagedEntityMap[323] = NewVdsl2LineConfigurationExtensions2
185 classToManagedEntityMap[324] = NewXdslImpulseNoiseMonitorPerformanceMonitoringHistoryData
186 classToManagedEntityMap[325] = NewXdslLineInventoryAndStatusDataPart5
187 classToManagedEntityMap[328] = NewReCommonAmplifierParameters
188 classToManagedEntityMap[329] = NewVirtualEthernetInterfacePoint
189 classToManagedEntityMap[332] = NewEnhancedSecurityControl
190 classToManagedEntityMap[333] = NewMplsPseudowireTerminationPoint
191 classToManagedEntityMap[334] = NewEthernetFrameExtendedPm
192 classToManagedEntityMap[335] = NewSnmpConfigurationData
193 classToManagedEntityMap[336] = NewOnuDynamicPowerManagementControl
194 classToManagedEntityMap[337] = NewPwAtmConfigurationData
195 classToManagedEntityMap[338] = NewPwAtmPerformanceMonitoringHistoryData
196 classToManagedEntityMap[339] = NewPwEthernetConfigurationData
197 classToManagedEntityMap[340] = NewBbfTr069ManagementServer
198 classToManagedEntityMap[341] = NewGemPortNetworkCtpPerformanceMonitoringHistoryData
199 classToManagedEntityMap[342] = NewTcpUdpPerformanceMonitoringHistoryData
200 classToManagedEntityMap[343] = NewEnergyConsumptionPerformanceMonitoringHistoryData
201 classToManagedEntityMap[344] = NewXgPonTcPerformanceMonitoringHistoryData
202 classToManagedEntityMap[345] = NewXgPonDownstreamManagementPerformanceMonitoringHistoryData
203 classToManagedEntityMap[346] = NewXgPonUpstreamManagementPerformanceMonitoringHistoryData
204 classToManagedEntityMap[348] = NewMacBridgePortIcmpv6ProcessPreAssignTable
205 classToManagedEntityMap[400] = NewEthernetPseudowireParameters
206 classToManagedEntityMap[408] = NewXdslXtuCPerformanceMonitoringHistoryDataPart2
207 classToManagedEntityMap[410] = NewVdsl2LineConfigurationExtensions3
208 classToManagedEntityMap[412] = NewXdslChannelConfigurationProfilePart2
209 classToManagedEntityMap[413] = NewXtuDataGatheringConfiguration
210 classToManagedEntityMap[414] = NewXdslLineInventoryAndStatusDataPart8
211 classToManagedEntityMap[419] = NewEfmBondingGroup
212 classToManagedEntityMap[420] = NewEfmBondingLink
213 classToManagedEntityMap[421] = NewEfmBondingGroupPerformanceMonitoringHistoryData
214 classToManagedEntityMap[422] = NewEfmBondingGroupPerformanceMonitoringHistoryDataPart2
215 classToManagedEntityMap[423] = NewEfmBondingLinkPerformanceMonitoringHistoryData
216 classToManagedEntityMap[424] = NewEfmBondingPortPerformanceMonitoringHistoryData
217 classToManagedEntityMap[425] = NewEfmBondingPortPerformanceMonitoringHistoryDataPart2
218 classToManagedEntityMap[426] = NewEthernetFrameExtendedPm64Bit
219 classToManagedEntityMap[432] = NewFastChannelConfigurationProfile
220 classToManagedEntityMap[433] = NewFastDataPathConfigurationProfile
221 classToManagedEntityMap[434] = NewFastVectoringLineConfigurationExtensions
222 classToManagedEntityMap[436] = NewFastLineInventoryAndStatusDataPart2
223 classToManagedEntityMap[437] = NewFastXtuCPerformanceMonitoringHistoryData
224 classToManagedEntityMap[438] = NewFastXtuRPerformanceMonitoringHistoryData
225 classToManagedEntityMap[443] = NewTwdmChannelManagedEntity
226 classToManagedEntityMap[444] = NewTwdmChannelPhyLodsPerformanceMonitoringHistoryData
227 classToManagedEntityMap[445] = NewTwdmChannelXgemPerformanceMonitoringHistoryData
228 classToManagedEntityMap[446] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart1
229 classToManagedEntityMap[447] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart2
230 classToManagedEntityMap[448] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart3
231 classToManagedEntityMap[449] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart1
232 classToManagedEntityMap[450] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart2
233 classToManagedEntityMap[451] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart3
234 classToManagedEntityMap[452] = NewTwdmChannelOmciPerformanceMonitoringHistoryData
235 classToManagedEntityMap[453] = NewEnhancedFecPerformanceMonitoringHistoryData
236 classToManagedEntityMap[454] = NewEnhancedTcPerformanceMonitoringHistoryData
237}
238
239// LoadManagedEntityDefinition returns a function to create a Managed Entity for a specific
240// Managed Entity class ID
241func LoadManagedEntityDefinition(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) {
242 newFunc, ok := classToManagedEntityMap[classID]
243 if ok {
244 return newFunc(params...)
245 }
246 return nil, NewUnknownEntityError(fmt.Sprintf("managed entity %d (%#x) definition not found",
247 uint16(classID), uint16(classID)))
248}
249
250// GetSupportedClassIDs returns an array of Managed Entity Class IDs supported
251func GetSupportedClassIDs() []ClassID {
252 supported := make([]ClassID, 0, len(classToManagedEntityMap))
253 for k := range classToManagedEntityMap {
254 supported = append(supported, k)
255 }
256 return supported
257}
258
259// GetAttributesDefinitions returns the attribute definition map for a specific class
260func GetAttributesDefinitions(classID ClassID) (AttributeDefinitionMap, OmciErrors) {
261 medef, err := LoadManagedEntityDefinition(classID)
262 if err.StatusCode() != Success {
263 return nil, err
264 }
265 return medef.GetAttributeDefinitions(), err
266}