blob: 77e6a0c40961451d587edf9e2815ac9b24f5fd26 [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14/*
15 * NOTE: This file was generated, manual edits will be overwritten!
16 *
17 * Generated by 'goCodeGenerator.py':
18 * https://github.com/cboling/OMCI-parser/README.md
19 */
20package generated
21
22import "fmt"
23
24// ManagedEntityInfo provides ManagedEntity information
25type ManagedEntityInfo struct {
26 New func(params ...ParamData) (*ManagedEntity, error)
27}
28
29// ParamData can be passed to the 'New' function to dictate how the returned
30// Managed Entity is created. You should supply either zero or one ParamData
31// structure to 'New'.
32//
33// If No ParamData is passed, the returned Managed Entity can only be used for
34// providing validation of other structures. This is commonly done in a packet
35// encoder/decoder to assist in that process.
36//
37// If One ParamData is passed, the returned Managed Entity will be initialized
38// with the given values/attributes and then validated. This is commonly done
39// when you wish to create an ME for transmission, storage or removal from a
40// persistent database, or some other similar purpose.
41//
42type ParamData struct {
43 EntityID uint16
44 Attributes AttributeValueMap
45}
46
47// CreateME wraps a function that makes it a creator of a Managed Entity
48type CreateME func(params ...ParamData) (*ManagedEntity, OmciErrors)
49
50var classToManagedEntityMap map[ClassID]CreateME
51
52func init() {
53 // Create mapping of 16-bit managed entity class IDs to ME-type
54 classToManagedEntityMap = make(map[ClassID]CreateME, 160)
55
56 classToManagedEntityMap[2] = NewOnuData
57 classToManagedEntityMap[5] = NewCardholder
58 classToManagedEntityMap[6] = NewCircuitPack
59 classToManagedEntityMap[7] = NewSoftwareImage
60 classToManagedEntityMap[11] = NewPhysicalPathTerminationPointEthernetUni
61 classToManagedEntityMap[12] = NewPhysicalPathTerminationPointCesUni
62 classToManagedEntityMap[14] = NewInterworkingVccTerminationPoint
63 classToManagedEntityMap[16] = NewAal5Profile
64 classToManagedEntityMap[18] = NewAal5PerformanceMonitoringHistoryData
65 classToManagedEntityMap[21] = NewCesServiceProfile
66 classToManagedEntityMap[24] = NewEthernetPerformanceMonitoringHistoryData
67 classToManagedEntityMap[45] = NewMacBridgeServiceProfile
68 classToManagedEntityMap[46] = NewMacBridgeConfigurationData
69 classToManagedEntityMap[47] = NewMacBridgePortConfigurationData
70 classToManagedEntityMap[48] = NewMacBridgePortDesignationData
71 classToManagedEntityMap[49] = NewMacBridgePortFilterTableData
72 classToManagedEntityMap[50] = NewMacBridgePortBridgeTableData
73 classToManagedEntityMap[51] = NewMacBridgePerformanceMonitoringHistoryData
74 classToManagedEntityMap[52] = NewMacBridgePortPerformanceMonitoringHistoryData
75 classToManagedEntityMap[53] = NewPhysicalPathTerminationPointPotsUni
76 classToManagedEntityMap[58] = NewVoiceServiceProfile
77 classToManagedEntityMap[62] = NewVpPerformanceMonitoringHistoryData
78 classToManagedEntityMap[78] = NewVlanTaggingOperationConfigurationData
79 classToManagedEntityMap[79] = NewMacBridgePortFilterPreAssignTable
80 classToManagedEntityMap[82] = NewPhysicalPathTerminationPointVideoUni
81 classToManagedEntityMap[83] = NewPhysicalPathTerminationPointLctUni
82 classToManagedEntityMap[84] = NewVlanTaggingFilterData
83 classToManagedEntityMap[89] = NewEthernetPerformanceMonitoringHistoryData2
84 classToManagedEntityMap[90] = NewPhysicalPathTerminationPointVideoAni
85 classToManagedEntityMap[98] = NewPhysicalPathTerminationPointXdslUniPart1
86 classToManagedEntityMap[99] = NewPhysicalPathTerminationPointXdslUniPart2
87 classToManagedEntityMap[100] = NewXdslLineInventoryAndStatusDataPart1
88 classToManagedEntityMap[101] = NewXdslLineInventoryAndStatusDataPart2
89 classToManagedEntityMap[102] = NewXdslChannelDownstreamStatusData
90 classToManagedEntityMap[103] = NewXdslChannelUpstreamStatusData
91 classToManagedEntityMap[105] = NewXdslLineConfigurationProfilePart2
92 classToManagedEntityMap[106] = NewXdslLineConfigurationProfilePart3
93 classToManagedEntityMap[107] = NewXdslChannelConfigurationProfile
94 classToManagedEntityMap[108] = NewXdslSubcarrierMaskingDownstreamProfile
95 classToManagedEntityMap[109] = NewXdslSubcarrierMaskingUpstreamProfile
96 classToManagedEntityMap[112] = NewXdslXtuCPerformanceMonitoringHistoryData
97 classToManagedEntityMap[113] = NewXdslXtuRPerformanceMonitoringHistoryData
98 classToManagedEntityMap[114] = NewXdslXtuCChannelPerformanceMonitoringHistoryData
99 classToManagedEntityMap[115] = NewXdslXtuRChannelPerformanceMonitoringHistoryData
100 classToManagedEntityMap[116] = NewTcAdaptorPerformanceMonitoringHistoryDataXdsl
101 classToManagedEntityMap[130] = NewIeee8021PMapperServiceProfile
102 classToManagedEntityMap[131] = NewOltG
103 classToManagedEntityMap[133] = NewOnuPowerShedding
104 classToManagedEntityMap[134] = NewIpHostConfigData
105 classToManagedEntityMap[135] = NewIpHostPerformanceMonitoringHistoryData
106 classToManagedEntityMap[136] = NewTcpUdpConfigData
107 classToManagedEntityMap[137] = NewNetworkAddress
108 classToManagedEntityMap[138] = NewVoipConfigData
109 classToManagedEntityMap[139] = NewVoipVoiceCtp
110 classToManagedEntityMap[140] = NewCallControlPerformanceMonitoringHistoryData
111 classToManagedEntityMap[141] = NewVoipLineStatus
112 classToManagedEntityMap[142] = NewVoipMediaProfile
113 classToManagedEntityMap[143] = NewRtpProfileData
114 classToManagedEntityMap[144] = NewRtpPerformanceMonitoringHistoryData
115 classToManagedEntityMap[145] = NewNetworkDialPlanTable
116 classToManagedEntityMap[146] = NewVoipApplicationServiceProfile
117 classToManagedEntityMap[147] = NewVoipFeatureAccessCodes
118 classToManagedEntityMap[148] = NewAuthenticationSecurityMethod
119 classToManagedEntityMap[150] = NewSipAgentConfigData
120 classToManagedEntityMap[151] = NewSipAgentPerformanceMonitoringHistoryData
121 classToManagedEntityMap[152] = NewSipCallInitiationPerformanceMonitoringHistoryData
122 classToManagedEntityMap[153] = NewSipUserData
123 classToManagedEntityMap[155] = NewMgcConfigData
124 classToManagedEntityMap[156] = NewMgcPerformanceMonitoringHistoryData
125 classToManagedEntityMap[160] = NewEquipmentExtensionPackage
126 classToManagedEntityMap[162] = NewPhysicalPathTerminationPointMocaUni
127 classToManagedEntityMap[163] = NewMocaEthernetPerformanceMonitoringHistoryData
128 classToManagedEntityMap[171] = NewExtendedVlanTaggingOperationConfigurationData
129 classToManagedEntityMap[256] = NewOnuG
130 classToManagedEntityMap[257] = NewOnu2G
131 classToManagedEntityMap[262] = NewTCont
132 classToManagedEntityMap[263] = NewAniG
133 classToManagedEntityMap[264] = NewUniG
134 classToManagedEntityMap[266] = NewGemInterworkingTerminationPoint
135 classToManagedEntityMap[268] = NewGemPortNetworkCtp
136 classToManagedEntityMap[269] = NewVpNetworkCtp
137 classToManagedEntityMap[272] = NewGalEthernetProfile
138 classToManagedEntityMap[273] = NewThresholdData1
139 classToManagedEntityMap[274] = NewThresholdData2
140 classToManagedEntityMap[276] = NewGalEthernetPerformanceMonitoringHistoryData
141 classToManagedEntityMap[277] = NewPriorityQueue
142 classToManagedEntityMap[278] = NewTrafficScheduler
143 classToManagedEntityMap[280] = NewTrafficDescriptor
144 classToManagedEntityMap[281] = NewMulticastGemInterworkingTerminationPoint
145 classToManagedEntityMap[282] = NewPseudowireTerminationPoint
146 classToManagedEntityMap[283] = NewRtpPseudowireParameters
147 classToManagedEntityMap[284] = NewPseudowireMaintenanceProfile
148 classToManagedEntityMap[285] = NewPseudowirePerformanceMonitoringHistoryData
149 classToManagedEntityMap[286] = NewEthernetFlowTerminationPoint
150 classToManagedEntityMap[287] = NewOmci
151 classToManagedEntityMap[288] = NewManagedEntityMe
152 classToManagedEntityMap[289] = NewAttributeMe
153 classToManagedEntityMap[290] = NewDot1XPortExtensionPackage
154 classToManagedEntityMap[291] = NewDot1XConfigurationProfile
155 classToManagedEntityMap[292] = NewDot1XPerformanceMonitoringHistoryData
156 classToManagedEntityMap[293] = NewRadiusPerformanceMonitoringHistoryData
157 classToManagedEntityMap[296] = NewEthernetPerformanceMonitoringHistoryData3
158 classToManagedEntityMap[298] = NewDot1RateLimiter
159 classToManagedEntityMap[299] = NewDot1AgMaintenanceDomain
160 classToManagedEntityMap[300] = NewDot1AgMaintenanceAssociation
161 classToManagedEntityMap[301] = NewDot1AgDefaultMdLevel
162 classToManagedEntityMap[302] = NewDot1AgMep
163 classToManagedEntityMap[305] = NewDot1AgCfmStack
164 classToManagedEntityMap[310] = NewMulticastSubscriberConfigInfo
165 classToManagedEntityMap[311] = NewMulticastSubscriberMonitor
166 classToManagedEntityMap[313] = NewReAniG
167 classToManagedEntityMap[316] = NewReDownstreamAmplifier
168 classToManagedEntityMap[321] = NewEthernetFramePerformanceMonitoringHistoryDataDownstream
169 classToManagedEntityMap[322] = NewEthernetFramePerformanceMonitoringHistoryDataUpstream
170 classToManagedEntityMap[325] = NewXdslLineInventoryAndStatusDataPart5
171 classToManagedEntityMap[328] = NewReCommonAmplifierParameters
172 classToManagedEntityMap[329] = NewVirtualEthernetInterfacePoint
173 classToManagedEntityMap[332] = NewEnhancedSecurityControl
174 classToManagedEntityMap[333] = NewMplsPseudowireTerminationPoint
175 classToManagedEntityMap[334] = NewEthernetFrameExtendedPm
176 classToManagedEntityMap[335] = NewSnmpConfigurationData
177 classToManagedEntityMap[336] = NewOnuDynamicPowerManagementControl
178 classToManagedEntityMap[338] = NewPwAtmPerformanceMonitoringHistoryData
179 classToManagedEntityMap[339] = NewPwEthernetConfigurationData
180 classToManagedEntityMap[340] = NewBbfTr069ManagementServer
181 classToManagedEntityMap[341] = NewGemPortNetworkCtpPerformanceMonitoringHistoryData
182 classToManagedEntityMap[342] = NewTcpUdpPerformanceMonitoringHistoryData
183 classToManagedEntityMap[343] = NewEnergyConsumptionPerformanceMonitoringHistoryData
184 classToManagedEntityMap[344] = NewXgPonTcPerformanceMonitoringHistoryData
185 classToManagedEntityMap[345] = NewXgPonDownstreamManagementPerformanceMonitoringHistoryData
186 classToManagedEntityMap[346] = NewXgPonUpstreamManagementPerformanceMonitoringHistoryData
187 classToManagedEntityMap[348] = NewMacBridgePortIcmpv6ProcessPreAssignTable
188 classToManagedEntityMap[400] = NewEthernetPseudowireParameters
189 classToManagedEntityMap[408] = NewXdslXtuCPerformanceMonitoringHistoryDataPart2
190 classToManagedEntityMap[410] = NewVdsl2LineConfigurationExtensions3
191 classToManagedEntityMap[412] = NewXdslChannelConfigurationProfilePart2
192 classToManagedEntityMap[414] = NewXdslLineInventoryAndStatusDataPart8
193 classToManagedEntityMap[420] = NewEfmBondingLink
194 classToManagedEntityMap[421] = NewEfmBondingGroupPerformanceMonitoringHistoryData
195 classToManagedEntityMap[422] = NewEfmBondingGroupPerformanceMonitoringHistoryDataPart2
196 classToManagedEntityMap[423] = NewEfmBondingLinkPerformanceMonitoringHistoryData
197 classToManagedEntityMap[424] = NewEfmBondingPortPerformanceMonitoringHistoryData
198 classToManagedEntityMap[425] = NewEfmBondingPortPerformanceMonitoringHistoryDataPart2
199 classToManagedEntityMap[426] = NewEthernetFrameExtendedPm64Bit
200 classToManagedEntityMap[432] = NewFastChannelConfigurationProfile
201 classToManagedEntityMap[433] = NewFastDataPathConfigurationProfile
202 classToManagedEntityMap[434] = NewFastVectoringLineConfigurationExtensions
203 classToManagedEntityMap[436] = NewFastLineInventoryAndStatusDataPart2
204 classToManagedEntityMap[437] = NewFastXtuCPerformanceMonitoringHistoryData
205 classToManagedEntityMap[438] = NewFastXtuRPerformanceMonitoringHistoryData
206 classToManagedEntityMap[443] = NewTwdmChannelManagedEntity
207 classToManagedEntityMap[444] = NewTwdmChannelPhyLodsPerformanceMonitoringHistoryData
208 classToManagedEntityMap[445] = NewTwdmChannelXgemPerformanceMonitoringHistoryData
209 classToManagedEntityMap[446] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart1
210 classToManagedEntityMap[447] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart2
211 classToManagedEntityMap[448] = NewTwdmChannelPloamPerformanceMonitoringHistoryDataPart3
212 classToManagedEntityMap[449] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart1
213 classToManagedEntityMap[450] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart2
214 classToManagedEntityMap[451] = NewTwdmChannelTuningPerformanceMonitoringHistoryDataPart3
215 classToManagedEntityMap[452] = NewTwdmChannelOmciPerformanceMonitoringHistoryData
216}
217
218func LoadManagedEntityDefinition(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) {
219 newFunc, ok := classToManagedEntityMap[classID]
220 if ok {
221 return newFunc(params...)
222 }
223 return nil, NewUnknownEntityError(fmt.Sprintf("managed entity %d (%#x) definition not found",
224 uint16(classID), uint16(classID)))
225}
226
227func GetSupportedClassIDs() []ClassID {
228 supported := make([]ClassID, 0, len(classToManagedEntityMap))
229 for k := range classToManagedEntityMap {
230 supported = append(supported, k)
231 }
232 return supported
233}