1 /******************************************************************************
2 ** Copyright (C) 2006-2015 ascolab GmbH. All Rights Reserved.
3 ** Web: http://www.ascolab.com
4 **
5 ** SPDX-License-Identifier: GPL-2.0-or-later
6 **
7 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
8 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
9 **
10 ** Project: OpcUa Wireshark Plugin
11 **
12 ** Description: OpcUa Enum Type Parser
13 **
14 ** This file was autogenerated on 13.10.2015.
15 ** DON'T MODIFY THIS FILE!
16 **
17 ******************************************************************************/
18 
19 #include "config.h"
20 
21 #include <epan/packet.h>
22 
23 #include "opcua_enumparser.h"
24 
25 gint ett_opcua_array_NodeIdType = -1;
26 gint ett_opcua_array_NamingRuleType = -1;
27 gint ett_opcua_array_OpenFileMode = -1;
28 gint ett_opcua_array_TrustListMasks = -1;
29 gint ett_opcua_array_IdType = -1;
30 gint ett_opcua_array_NodeClass = -1;
31 gint ett_opcua_array_ApplicationType = -1;
32 gint ett_opcua_array_MessageSecurityMode = -1;
33 gint ett_opcua_array_UserTokenType = -1;
34 gint ett_opcua_array_SecurityTokenRequestType = -1;
35 gint ett_opcua_array_NodeAttributesMask = -1;
36 gint ett_opcua_array_AttributeWriteMask = -1;
37 gint ett_opcua_array_BrowseDirection = -1;
38 gint ett_opcua_array_BrowseResultMask = -1;
39 gint ett_opcua_array_ComplianceLevel = -1;
40 gint ett_opcua_array_FilterOperator = -1;
41 gint ett_opcua_array_TimestampsToReturn = -1;
42 gint ett_opcua_array_HistoryUpdateType = -1;
43 gint ett_opcua_array_PerformUpdateType = -1;
44 gint ett_opcua_array_MonitoringMode = -1;
45 gint ett_opcua_array_DataChangeTrigger = -1;
46 gint ett_opcua_array_DeadbandType = -1;
47 gint ett_opcua_array_EnumeratedTestType = -1;
48 gint ett_opcua_array_RedundancySupport = -1;
49 gint ett_opcua_array_ServerState = -1;
50 gint ett_opcua_array_ModelChangeStructureVerbMask = -1;
51 gint ett_opcua_array_AxisScaleEnumeration = -1;
52 gint ett_opcua_array_ExceptionDeviationFormat = -1;
53 
54 /** NodeIdType enum table */
55 static const value_string g_NodeIdTypeTable[] = {
56   { 0, "TwoByte" },
57   { 1, "FourByte" },
58   { 2, "Numeric" },
59   { 3, "String" },
60   { 4, "Guid" },
61   { 5, "ByteString" },
62   { 0, NULL }
63 };
64 static int hf_opcua_NodeIdType = -1;
65 
parseNodeIdType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)66 void parseNodeIdType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
67 {
68     proto_tree_add_item(tree, hf_opcua_NodeIdType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
69 }
70 /** NamingRuleType enum table */
71 static const value_string g_NamingRuleTypeTable[] = {
72   { 1, "Mandatory" },
73   { 2, "Optional" },
74   { 3, "Constraint" },
75   { 0, NULL }
76 };
77 static int hf_opcua_NamingRuleType = -1;
78 
parseNamingRuleType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)79 void parseNamingRuleType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
80 {
81     proto_tree_add_item(tree, hf_opcua_NamingRuleType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
82 }
83 /** OpenFileMode enum table */
84 static const value_string g_OpenFileModeTable[] = {
85   { 1, "Read" },
86   { 2, "Write" },
87   { 4, "EraseExisting" },
88   { 8, "Append" },
89   { 0, NULL }
90 };
91 static int hf_opcua_OpenFileMode = -1;
92 
parseOpenFileMode(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)93 void parseOpenFileMode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
94 {
95     proto_tree_add_item(tree, hf_opcua_OpenFileMode, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
96 }
97 /** TrustListMasks enum table */
98 static const value_string g_TrustListMasksTable[] = {
99   { 0, "None" },
100   { 1, "TrustedCertificates" },
101   { 2, "TrustedCrls" },
102   { 4, "IssuerCertificates" },
103   { 8, "IssuerCrls" },
104   { 15, "All" },
105   { 0, NULL }
106 };
107 static int hf_opcua_TrustListMasks = -1;
108 
parseTrustListMasks(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)109 void parseTrustListMasks(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
110 {
111     proto_tree_add_item(tree, hf_opcua_TrustListMasks, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
112 }
113 /** IdType enum table */
114 static const value_string g_IdTypeTable[] = {
115   { 0, "Numeric" },
116   { 1, "String" },
117   { 2, "Guid" },
118   { 3, "Opaque" },
119   { 0, NULL }
120 };
121 static int hf_opcua_IdType = -1;
122 
parseIdType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)123 void parseIdType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
124 {
125     proto_tree_add_item(tree, hf_opcua_IdType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
126 }
127 /** NodeClass enum table */
128 static const value_string g_NodeClassTable[] = {
129   { 0, "Unspecified" },
130   { 1, "Object" },
131   { 2, "Variable" },
132   { 4, "Method" },
133   { 8, "ObjectType" },
134   { 16, "VariableType" },
135   { 32, "ReferenceType" },
136   { 64, "DataType" },
137   { 128, "View" },
138   { 0, NULL }
139 };
140 static int hf_opcua_NodeClass = -1;
141 
parseNodeClass(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)142 void parseNodeClass(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
143 {
144     proto_tree_add_item(tree, hf_opcua_NodeClass, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
145 }
146 /** ApplicationType enum table */
147 static const value_string g_ApplicationTypeTable[] = {
148   { 0, "Server" },
149   { 1, "Client" },
150   { 2, "ClientAndServer" },
151   { 3, "DiscoveryServer" },
152   { 0, NULL }
153 };
154 static int hf_opcua_ApplicationType = -1;
155 
parseApplicationType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)156 void parseApplicationType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
157 {
158     proto_tree_add_item(tree, hf_opcua_ApplicationType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
159 }
160 /** MessageSecurityMode enum table */
161 static const value_string g_MessageSecurityModeTable[] = {
162   { 0, "Invalid" },
163   { 1, "None" },
164   { 2, "Sign" },
165   { 3, "SignAndEncrypt" },
166   { 0, NULL }
167 };
168 static int hf_opcua_MessageSecurityMode = -1;
169 
parseMessageSecurityMode(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)170 void parseMessageSecurityMode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
171 {
172     proto_tree_add_item(tree, hf_opcua_MessageSecurityMode, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
173 }
174 /** UserTokenType enum table */
175 static const value_string g_UserTokenTypeTable[] = {
176   { 0, "Anonymous" },
177   { 1, "UserName" },
178   { 2, "Certificate" },
179   { 3, "IssuedToken" },
180   { 4, "Kerberos" },
181   { 0, NULL }
182 };
183 static int hf_opcua_UserTokenType = -1;
184 
parseUserTokenType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)185 void parseUserTokenType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
186 {
187     proto_tree_add_item(tree, hf_opcua_UserTokenType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
188 }
189 /** SecurityTokenRequestType enum table */
190 static const value_string g_SecurityTokenRequestTypeTable[] = {
191   { 0, "Issue" },
192   { 1, "Renew" },
193   { 0, NULL }
194 };
195 static int hf_opcua_SecurityTokenRequestType = -1;
196 
parseSecurityTokenRequestType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)197 void parseSecurityTokenRequestType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
198 {
199     proto_tree_add_item(tree, hf_opcua_SecurityTokenRequestType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
200 }
201 /** NodeAttributesMask enum table */
202 static const value_string g_NodeAttributesMaskTable[] = {
203   { 0, "None" },
204   { 1, "AccessLevel" },
205   { 2, "ArrayDimensions" },
206   { 4, "BrowseName" },
207   { 8, "ContainsNoLoops" },
208   { 16, "DataType" },
209   { 32, "Description" },
210   { 64, "DisplayName" },
211   { 128, "EventNotifier" },
212   { 256, "Executable" },
213   { 512, "Historizing" },
214   { 1024, "InverseName" },
215   { 2048, "IsAbstract" },
216   { 4096, "MinimumSamplingInterval" },
217   { 8192, "NodeClass" },
218   { 16384, "NodeId" },
219   { 32768, "Symmetric" },
220   { 65536, "UserAccessLevel" },
221   { 131072, "UserExecutable" },
222   { 262144, "UserWriteMask" },
223   { 524288, "ValueRank" },
224   { 1048576, "WriteMask" },
225   { 2097152, "Value" },
226   { 4194303, "All" },
227   { 1335396, "BaseNode" },
228   { 1335524, "Object" },
229   { 1337444, "ObjectTypeOrDataType" },
230   { 4026999, "Variable" },
231   { 3958902, "VariableType" },
232   { 1466724, "Method" },
233   { 1371236, "ReferenceType" },
234   { 1335532, "View" },
235   { 0, NULL }
236 };
237 static int hf_opcua_NodeAttributesMask = -1;
238 
parseNodeAttributesMask(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)239 void parseNodeAttributesMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
240 {
241     proto_tree_add_item(tree, hf_opcua_NodeAttributesMask, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
242 }
243 /** AttributeWriteMask enum table */
244 static const value_string g_AttributeWriteMaskTable[] = {
245   { 0, "None" },
246   { 1, "AccessLevel" },
247   { 2, "ArrayDimensions" },
248   { 4, "BrowseName" },
249   { 8, "ContainsNoLoops" },
250   { 16, "DataType" },
251   { 32, "Description" },
252   { 64, "DisplayName" },
253   { 128, "EventNotifier" },
254   { 256, "Executable" },
255   { 512, "Historizing" },
256   { 1024, "InverseName" },
257   { 2048, "IsAbstract" },
258   { 4096, "MinimumSamplingInterval" },
259   { 8192, "NodeClass" },
260   { 16384, "NodeId" },
261   { 32768, "Symmetric" },
262   { 65536, "UserAccessLevel" },
263   { 131072, "UserExecutable" },
264   { 262144, "UserWriteMask" },
265   { 524288, "ValueRank" },
266   { 1048576, "WriteMask" },
267   { 2097152, "ValueForVariableType" },
268   { 4194304, "DataTypeDefinition" },
269   { 8388608, "RolePermissions" },
270   { 16777216, "AccessRestrictions" },
271   { 33554432, "AccessLevelEx" },
272   { 0, NULL }
273 };
274 static int hf_opcua_AttributeWriteMask = -1;
275 
parseAttributeWriteMask(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)276 void parseAttributeWriteMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
277 {
278     proto_tree_add_item(tree, hf_opcua_AttributeWriteMask, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
279 }
280 /** BrowseDirection enum table */
281 static const value_string g_BrowseDirectionTable[] = {
282   { 0, "Forward" },
283   { 1, "Inverse" },
284   { 2, "Both" },
285   { 0, NULL }
286 };
287 static int hf_opcua_BrowseDirection = -1;
288 
parseBrowseDirection(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)289 void parseBrowseDirection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
290 {
291     proto_tree_add_item(tree, hf_opcua_BrowseDirection, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
292 }
293 
294 /** ComplianceLevel enum table */
295 static const value_string g_ComplianceLevelTable[] = {
296   { 0, "Untested" },
297   { 1, "Partial" },
298   { 2, "SelfTested" },
299   { 3, "Certified" },
300   { 0, NULL }
301 };
302 static int hf_opcua_ComplianceLevel = -1;
303 
parseComplianceLevel(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)304 void parseComplianceLevel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
305 {
306     proto_tree_add_item(tree, hf_opcua_ComplianceLevel, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
307 }
308 /** FilterOperator enum table */
309 static const value_string g_FilterOperatorTable[] = {
310   { 0, "Equals" },
311   { 1, "IsNull" },
312   { 2, "GreaterThan" },
313   { 3, "LessThan" },
314   { 4, "GreaterThanOrEqual" },
315   { 5, "LessThanOrEqual" },
316   { 6, "Like" },
317   { 7, "Not" },
318   { 8, "Between" },
319   { 9, "InList" },
320   { 10, "And" },
321   { 11, "Or" },
322   { 12, "Cast" },
323   { 13, "InView" },
324   { 14, "OfType" },
325   { 15, "RelatedTo" },
326   { 16, "BitwiseAnd" },
327   { 17, "BitwiseOr" },
328   { 0, NULL }
329 };
330 static int hf_opcua_FilterOperator = -1;
331 
parseFilterOperator(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)332 void parseFilterOperator(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
333 {
334     proto_tree_add_item(tree, hf_opcua_FilterOperator, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
335 }
336 /** TimestampsToReturn enum table */
337 static const value_string g_TimestampsToReturnTable[] = {
338   { 0, "Source" },
339   { 1, "Server" },
340   { 2, "Both" },
341   { 3, "Neither" },
342   { 4, "Invalid" },
343   { 0, NULL }
344 };
345 static int hf_opcua_TimestampsToReturn = -1;
346 
parseTimestampsToReturn(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)347 void parseTimestampsToReturn(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
348 {
349     proto_tree_add_item(tree, hf_opcua_TimestampsToReturn, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
350 }
351 /** HistoryUpdateType enum table */
352 static const value_string g_HistoryUpdateTypeTable[] = {
353   { 1, "Insert" },
354   { 2, "Replace" },
355   { 3, "Update" },
356   { 4, "Delete" },
357   { 0, NULL }
358 };
359 static int hf_opcua_HistoryUpdateType = -1;
360 
parseHistoryUpdateType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)361 void parseHistoryUpdateType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
362 {
363     proto_tree_add_item(tree, hf_opcua_HistoryUpdateType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
364 }
365 /** PerformUpdateType enum table */
366 static const value_string g_PerformUpdateTypeTable[] = {
367   { 1, "Insert" },
368   { 2, "Replace" },
369   { 3, "Update" },
370   { 4, "Remove" },
371   { 0, NULL }
372 };
373 static int hf_opcua_PerformUpdateType = -1;
374 
parsePerformUpdateType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)375 void parsePerformUpdateType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
376 {
377     proto_tree_add_item(tree, hf_opcua_PerformUpdateType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
378 }
379 /** MonitoringMode enum table */
380 static const value_string g_MonitoringModeTable[] = {
381   { 0, "Disabled" },
382   { 1, "Sampling" },
383   { 2, "Reporting" },
384   { 0, NULL }
385 };
386 static int hf_opcua_MonitoringMode = -1;
387 
parseMonitoringMode(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)388 void parseMonitoringMode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
389 {
390     proto_tree_add_item(tree, hf_opcua_MonitoringMode, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
391 }
392 /** DataChangeTrigger enum table */
393 static const value_string g_DataChangeTriggerTable[] = {
394   { 0, "Status" },
395   { 1, "StatusValue" },
396   { 2, "StatusValueTimestamp" },
397   { 0, NULL }
398 };
399 static int hf_opcua_DataChangeTrigger = -1;
400 
parseDataChangeTrigger(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)401 void parseDataChangeTrigger(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
402 {
403     proto_tree_add_item(tree, hf_opcua_DataChangeTrigger, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
404 }
405 /** DeadbandType enum table */
406 static const value_string g_DeadbandTypeTable[] = {
407   { 0, "None" },
408   { 1, "Absolute" },
409   { 2, "Percent" },
410   { 0, NULL }
411 };
412 static int hf_opcua_DeadbandType = -1;
413 
parseDeadbandType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)414 void parseDeadbandType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
415 {
416     proto_tree_add_item(tree, hf_opcua_DeadbandType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
417 }
418 /** EnumeratedTestType enum table */
419 static const value_string g_EnumeratedTestTypeTable[] = {
420   { 1, "Red" },
421   { 4, "Yellow" },
422   { 5, "Green" },
423   { 0, NULL }
424 };
425 static int hf_opcua_EnumeratedTestType = -1;
426 
parseEnumeratedTestType(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)427 void parseEnumeratedTestType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
428 {
429     proto_tree_add_item(tree, hf_opcua_EnumeratedTestType, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
430 }
431 /** RedundancySupport enum table */
432 static const value_string g_RedundancySupportTable[] = {
433   { 0, "None" },
434   { 1, "Cold" },
435   { 2, "Warm" },
436   { 3, "Hot" },
437   { 4, "Transparent" },
438   { 5, "HotAndMirrored" },
439   { 0, NULL }
440 };
441 static int hf_opcua_RedundancySupport = -1;
442 
parseRedundancySupport(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)443 void parseRedundancySupport(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
444 {
445     proto_tree_add_item(tree, hf_opcua_RedundancySupport, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
446 }
447 /** ServerState enum table */
448 static const value_string g_ServerStateTable[] = {
449   { 0, "Running" },
450   { 1, "Failed" },
451   { 2, "NoConfiguration" },
452   { 3, "Suspended" },
453   { 4, "Shutdown" },
454   { 5, "Test" },
455   { 6, "CommunicationFault" },
456   { 7, "Unknown" },
457   { 0, NULL }
458 };
459 static int hf_opcua_ServerState = -1;
460 
parseServerState(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)461 void parseServerState(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
462 {
463     proto_tree_add_item(tree, hf_opcua_ServerState, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
464 }
465 /** ModelChangeStructureVerbMask enum table */
466 static const value_string g_ModelChangeStructureVerbMaskTable[] = {
467   { 1, "NodeAdded" },
468   { 2, "NodeDeleted" },
469   { 4, "ReferenceAdded" },
470   { 8, "ReferenceDeleted" },
471   { 16, "DataTypeChanged" },
472   { 0, NULL }
473 };
474 static int hf_opcua_ModelChangeStructureVerbMask = -1;
475 
parseModelChangeStructureVerbMask(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)476 void parseModelChangeStructureVerbMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
477 {
478     proto_tree_add_item(tree, hf_opcua_ModelChangeStructureVerbMask, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
479 }
480 /** AxisScaleEnumeration enum table */
481 static const value_string g_AxisScaleEnumerationTable[] = {
482   { 0, "Linear" },
483   { 1, "Log" },
484   { 2, "Ln" },
485   { 0, NULL }
486 };
487 static int hf_opcua_AxisScaleEnumeration = -1;
488 
parseAxisScaleEnumeration(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)489 void parseAxisScaleEnumeration(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
490 {
491     proto_tree_add_item(tree, hf_opcua_AxisScaleEnumeration, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
492 }
493 /** ExceptionDeviationFormat enum table */
494 static const value_string g_ExceptionDeviationFormatTable[] = {
495   { 0, "AbsoluteValue" },
496   { 1, "PercentOfValue" },
497   { 2, "PercentOfRange" },
498   { 3, "PercentOfEURange" },
499   { 4, "Unknown" },
500   { 0, NULL }
501 };
502 static int hf_opcua_ExceptionDeviationFormat = -1;
503 
parseExceptionDeviationFormat(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)504 void parseExceptionDeviationFormat(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
505 {
506     proto_tree_add_item(tree, hf_opcua_ExceptionDeviationFormat, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
507 }
508 /** AttributeId enum table */
509 static const value_string g_AttributeIdTable[] = {
510     {1, "NodeId"},
511     {2, "NodeClass"},
512     {3, "BrowseName"},
513     {4, "DisplayName"},
514     {5, "Description"},
515     {6, "WriteMask"},
516     {7, "UserWriteMask"},
517     {8, "IsAbstract"},
518     {9, "Symmetric"},
519     {10, "InverseName"},
520     {11, "ContainsNoLoops"},
521     {12, "EventNotifier"},
522     {13, "Value"},
523     {14, "DataType"},
524     {15, "ValueRank"},
525     {16, "ArrayDimensions"},
526     {17, "AccessLevel"},
527     {18, "UserAccessLevel"},
528     {19, "MinimumSamplingInterval"},
529     {20, "Historizing"},
530     {21, "Executable"},
531     {22, "UserExecutable"},
532     {23, "DataTypeDefinition"},
533     {24, "RolePermissions"},
534     {25, "UserRolePermissions"},
535     {26, "AccessRestrictions"},
536     {27, "AccessLevelEx"},
537     {0, NULL}
538 };
539 static int hf_opcua_AttributeId = -1;
540 
parseAttributeId(proto_tree * tree,tvbuff_t * tvb,packet_info * pinfo _U_,gint * pOffset)541 void parseAttributeId(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
542 {
543     proto_tree_add_item(tree, hf_opcua_AttributeId, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset += 4;
544 }
545 
546 /** Setup enum subtree array */
547 static gint *ett[] =
548 {
549     &ett_opcua_array_NodeIdType,
550     &ett_opcua_array_NamingRuleType,
551     &ett_opcua_array_OpenFileMode,
552     &ett_opcua_array_TrustListMasks,
553     &ett_opcua_array_IdType,
554     &ett_opcua_array_NodeClass,
555     &ett_opcua_array_ApplicationType,
556     &ett_opcua_array_MessageSecurityMode,
557     &ett_opcua_array_UserTokenType,
558     &ett_opcua_array_SecurityTokenRequestType,
559     &ett_opcua_array_NodeAttributesMask,
560     &ett_opcua_array_AttributeWriteMask,
561     &ett_opcua_array_BrowseDirection,
562     &ett_opcua_array_BrowseResultMask,
563     &ett_opcua_array_ComplianceLevel,
564     &ett_opcua_array_FilterOperator,
565     &ett_opcua_array_TimestampsToReturn,
566     &ett_opcua_array_HistoryUpdateType,
567     &ett_opcua_array_PerformUpdateType,
568     &ett_opcua_array_MonitoringMode,
569     &ett_opcua_array_DataChangeTrigger,
570     &ett_opcua_array_DeadbandType,
571     &ett_opcua_array_EnumeratedTestType,
572     &ett_opcua_array_RedundancySupport,
573     &ett_opcua_array_ServerState,
574     &ett_opcua_array_ModelChangeStructureVerbMask,
575     &ett_opcua_array_AxisScaleEnumeration,
576     &ett_opcua_array_ExceptionDeviationFormat,
577 };
578 
579 /** Register enum types. */
registerEnumTypes(int proto)580 void registerEnumTypes(int proto)
581 {
582     /** header field definitions */
583     static hf_register_info hf[] =
584     {
585         { &hf_opcua_NodeIdType,
586         {  "NodeIdType", "opcua.NodeIdType", FT_UINT32, BASE_HEX,  VALS(g_NodeIdTypeTable), 0x0, NULL, HFILL }
587         },
588         { &hf_opcua_NamingRuleType,
589         {  "NamingRuleType", "opcua.NamingRuleType", FT_UINT32, BASE_HEX,  VALS(g_NamingRuleTypeTable), 0x0, NULL, HFILL }
590         },
591         { &hf_opcua_OpenFileMode,
592         {  "OpenFileMode", "opcua.OpenFileMode", FT_UINT32, BASE_HEX,  VALS(g_OpenFileModeTable), 0x0, NULL, HFILL }
593         },
594         { &hf_opcua_TrustListMasks,
595         {  "TrustListMasks", "opcua.TrustListMasks", FT_UINT32, BASE_HEX,  VALS(g_TrustListMasksTable), 0x0, NULL, HFILL }
596         },
597         { &hf_opcua_IdType,
598         {  "IdType", "opcua.IdType", FT_UINT32, BASE_HEX,  VALS(g_IdTypeTable), 0x0, NULL, HFILL }
599         },
600         { &hf_opcua_NodeClass,
601         {  "NodeClass", "opcua.NodeClass", FT_UINT32, BASE_HEX,  VALS(g_NodeClassTable), 0x0, NULL, HFILL }
602         },
603         { &hf_opcua_ApplicationType,
604         {  "ApplicationType", "opcua.ApplicationType", FT_UINT32, BASE_HEX,  VALS(g_ApplicationTypeTable), 0x0, NULL, HFILL }
605         },
606         { &hf_opcua_MessageSecurityMode,
607         {  "MessageSecurityMode", "opcua.MessageSecurityMode", FT_UINT32, BASE_HEX,  VALS(g_MessageSecurityModeTable), 0x0, NULL, HFILL }
608         },
609         { &hf_opcua_UserTokenType,
610         {  "UserTokenType", "opcua.UserTokenType", FT_UINT32, BASE_HEX,  VALS(g_UserTokenTypeTable), 0x0, NULL, HFILL }
611         },
612         { &hf_opcua_SecurityTokenRequestType,
613         {  "SecurityTokenRequestType", "opcua.SecurityTokenRequestType", FT_UINT32, BASE_HEX,  VALS(g_SecurityTokenRequestTypeTable), 0x0, NULL, HFILL }
614         },
615         { &hf_opcua_NodeAttributesMask,
616         {  "NodeAttributesMask", "opcua.NodeAttributesMask", FT_UINT32, BASE_HEX,  VALS(g_NodeAttributesMaskTable), 0x0, NULL, HFILL }
617         },
618         { &hf_opcua_AttributeWriteMask,
619         {  "AttributeWriteMask", "opcua.AttributeWriteMask", FT_UINT32, BASE_HEX,  VALS(g_AttributeWriteMaskTable), 0x0, NULL, HFILL }
620         },
621         { &hf_opcua_BrowseDirection,
622         {  "BrowseDirection", "opcua.BrowseDirection", FT_UINT32, BASE_HEX,  VALS(g_BrowseDirectionTable), 0x0, NULL, HFILL }
623         },
624         { &hf_opcua_ComplianceLevel,
625         {  "ComplianceLevel", "opcua.ComplianceLevel", FT_UINT32, BASE_HEX,  VALS(g_ComplianceLevelTable), 0x0, NULL, HFILL }
626         },
627         { &hf_opcua_FilterOperator,
628         {  "FilterOperator", "opcua.FilterOperator", FT_UINT32, BASE_HEX,  VALS(g_FilterOperatorTable), 0x0, NULL, HFILL }
629         },
630         { &hf_opcua_TimestampsToReturn,
631         {  "TimestampsToReturn", "opcua.TimestampsToReturn", FT_UINT32, BASE_HEX,  VALS(g_TimestampsToReturnTable), 0x0, NULL, HFILL }
632         },
633         { &hf_opcua_HistoryUpdateType,
634         {  "HistoryUpdateType", "opcua.HistoryUpdateType", FT_UINT32, BASE_HEX,  VALS(g_HistoryUpdateTypeTable), 0x0, NULL, HFILL }
635         },
636         { &hf_opcua_PerformUpdateType,
637         {  "PerformUpdateType", "opcua.PerformUpdateType", FT_UINT32, BASE_HEX,  VALS(g_PerformUpdateTypeTable), 0x0, NULL, HFILL }
638         },
639         { &hf_opcua_MonitoringMode,
640         {  "MonitoringMode", "opcua.MonitoringMode", FT_UINT32, BASE_HEX,  VALS(g_MonitoringModeTable), 0x0, NULL, HFILL }
641         },
642         { &hf_opcua_DataChangeTrigger,
643         {  "DataChangeTrigger", "opcua.DataChangeTrigger", FT_UINT32, BASE_HEX,  VALS(g_DataChangeTriggerTable), 0x0, NULL, HFILL }
644         },
645         { &hf_opcua_DeadbandType,
646         {  "DeadbandType", "opcua.DeadbandType", FT_UINT32, BASE_HEX,  VALS(g_DeadbandTypeTable), 0x0, NULL, HFILL }
647         },
648         { &hf_opcua_EnumeratedTestType,
649         {  "EnumeratedTestType", "opcua.EnumeratedTestType", FT_UINT32, BASE_HEX,  VALS(g_EnumeratedTestTypeTable), 0x0, NULL, HFILL }
650         },
651         { &hf_opcua_RedundancySupport,
652         {  "RedundancySupport", "opcua.RedundancySupport", FT_UINT32, BASE_HEX,  VALS(g_RedundancySupportTable), 0x0, NULL, HFILL }
653         },
654         { &hf_opcua_ServerState,
655         {  "ServerState", "opcua.ServerState", FT_UINT32, BASE_HEX,  VALS(g_ServerStateTable), 0x0, NULL, HFILL }
656         },
657         { &hf_opcua_ModelChangeStructureVerbMask,
658         {  "ModelChangeStructureVerbMask", "opcua.ModelChangeStructureVerbMask", FT_UINT32, BASE_HEX,  VALS(g_ModelChangeStructureVerbMaskTable), 0x0, NULL, HFILL }
659         },
660         { &hf_opcua_AxisScaleEnumeration,
661         {  "AxisScaleEnumeration", "opcua.AxisScaleEnumeration", FT_UINT32, BASE_HEX,  VALS(g_AxisScaleEnumerationTable), 0x0, NULL, HFILL }
662         },
663         { &hf_opcua_ExceptionDeviationFormat,
664         {  "ExceptionDeviationFormat", "opcua.ExceptionDeviationFormat", FT_UINT32, BASE_HEX,  VALS(g_ExceptionDeviationFormatTable), 0x0, NULL, HFILL }
665         },
666         { &hf_opcua_AttributeId,
667         {  "AttributeId", "opcua.AttributeId", FT_UINT32, BASE_HEX,  VALS(g_AttributeIdTable), 0x0, NULL, HFILL }
668         },
669     };
670 
671     proto_register_field_array(proto, hf, array_length(hf));
672     proto_register_subtree_array(ett, array_length(ett));
673 }
674 
675