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