Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
opcua_simpletypes.h
1/******************************************************************************
2** Copyright (C) 2006-2007 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: Implementation of OpcUa built-in type parsers.
13** This contains all the simple types and some complex types.
14**
15** Author: Gerhard Gappmeier <[email protected]>
16******************************************************************************/
17#ifndef OPCUA_IDENTIFIERS_H
18#define OPCUA_IDENTIFIERS_H
19
20#include <epan/expert.h>
21
22#include "opcua_identifiers.h"
23
25#define MAX_ARRAY_LEN 10000
26
28extern int hf_opcua_ArraySize;
29
31extern expert_field ei_array_length;
32
33/* simple header fields */
35extern int hf_opcua_returnDiag;
36
38extern int hf_opcua_returnDiag_mask_sl_symbolicId;
39
41extern int hf_opcua_returnDiag_mask_sl_localizedText;
42
44extern int hf_opcua_returnDiag_mask_sl_additionalinfo;
45
47extern int hf_opcua_returnDiag_mask_sl_innerstatuscode;
48
50extern int hf_opcua_returnDiag_mask_sl_innerdiagnostics;
51
53extern int hf_opcua_returnDiag_mask_ol_symbolicId;
54
56extern int hf_opcua_returnDiag_mask_ol_localizedText;
57
59extern int hf_opcua_returnDiag_mask_ol_additionalinfo;
60
62extern int hf_opcua_returnDiag_mask_ol_innerstatuscode;
63
65extern int hf_opcua_returnDiag_mask_ol_innerdiagnostics;
66
68extern int hf_opcua_nodeClassMask;
69
71extern int hf_opcua_nodeClassMask_all;
72
74extern int hf_opcua_nodeClassMask_object;
75
77extern int hf_opcua_nodeClassMask_variable;
78
80extern int hf_opcua_nodeClassMask_method;
81
83extern int hf_opcua_nodeClassMask_objecttype;
84
86extern int hf_opcua_nodeClassMask_variabletype;
87
89extern int hf_opcua_nodeClassMask_referencetype;
90
92extern int hf_opcua_nodeClassMask_datatype;
93
95extern int hf_opcua_nodeClassMask_view;
96
98extern int hf_opcua_resultMask;
99
101extern int hf_opcua_resultMask_all;
102
104extern int hf_opcua_resultMask_referencetype;
105
107extern int hf_opcua_resultMask_isforward;
108
110extern int hf_opcua_resultMask_nodeclass;
111
113extern int hf_opcua_resultMask_browsename;
114
116extern int hf_opcua_resultMask_displayname;
117
119extern int hf_opcua_resultMask_typedefinition;
120
121/* simple types trees */
123extern int ett_opcua_nodeid;
124
126extern int ett_opcua_extensionobject;
127
129extern int ett_opcua_array_Boolean;
130
132extern int ett_opcua_array_SByte;
133
135extern int ett_opcua_array_Byte;
136
138extern int ett_opcua_array_Int16;
139
141extern int ett_opcua_array_UInt16;
142
144extern int ett_opcua_array_Int32;
145
147extern int ett_opcua_array_UInt32;
148
150extern int ett_opcua_array_Int64;
151
153extern int ett_opcua_array_UInt64;
154
156extern int ett_opcua_array_Float;
157
159extern int ett_opcua_array_Double;
160
162extern int ett_opcua_array_String;
163
165extern int ett_opcua_array_DateTime;
166
168extern int ett_opcua_array_Guid;
169
171extern int ett_opcua_array_ByteString;
172
174extern int ett_opcua_array_XmlElement;
175
177extern int ett_opcua_array_NodeId;
178
180extern int ett_opcua_array_ExpandedNodeId;
181
183extern int ett_opcua_array_StatusCode;
184
186extern int ett_opcua_array_DiagnosticInfo;
187
189extern int ett_opcua_array_QualifiedName;
190
192extern int ett_opcua_array_LocalizedText;
193
195extern int ett_opcua_array_ExtensionObject;
196
198extern int ett_opcua_array_DataValue;
199
201extern int ett_opcua_array_Variant;
202
204extern int ett_opcua_returnDiagnostics;
205
207extern int ett_opcua_nodeClassMask;
208
210extern int ett_opcua_resultMask;
211
212
216enum ua_message_mode {
217 UA_MessageMode_Unknown = 0,
218 UA_MessageMode_None,
219 UA_MessageMode_Sign,
220 UA_MessageMode_SignAndEncrypt,
221 UA_MessageMode_MaybeEncrypted
222};
223
224/* simple types */
225
236proto_item* parseBoolean(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
237
248proto_item* parseByte(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
249
260proto_item* parseSByte(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
261
272proto_item* parseUInt16(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
273
284proto_item* parseInt16(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
285
296proto_item* parseUInt32(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
297
308proto_item* parseInt32(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
309
320proto_item* parseUInt64(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
321
332proto_item* parseInt64(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
333
344proto_item* parseString(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
345
358proto_item* parseString_ret_string_and_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int *pOffset, int hfIndex, const uint8_t **retval, int *lenretval);
359
370proto_item* parseGuid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
371
382proto_item* parseByteString(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
383
394proto_item* parseXmlElement(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
395
406proto_item* parseFloat(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
407
418proto_item* parseDouble(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
419
430proto_item* parseDateTime(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
431
442proto_item* parseStatusCode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
443/* complex types */
444
454void parseLocalizedText(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
464void parseNodeId(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
465
475void parseDiagnosticInfo(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
476
486void parseExtensionObject(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
487
497void parseQualifiedName(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
498
508void parseCertificate(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, int hfIndex);
509
519void parseDataValue(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
520
530void parseVariant(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
531
541void parseExpandedNodeId(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName);
542
556void parseArraySimple(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName, const char *szTypeName, int hfIndex, fctSimpleTypeParser pParserFunction, const int idx);
557
570void parseArrayEnum(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName, const char *szTypeName, fctEnumParser pParserFunction, const int idx);
571
584void parseArrayComplex(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const char *szFieldName, const char *szTypeName, fctComplexTypeParser pParserFunction, const int idx);
585
591void registerSimpleTypes(int proto);
592
599typedef struct {
600 uint16_t ns;
602 uint32_t numeric;
603 const char *string;
605
614ExtensionObjectTypeId getExtensionObjectType(tvbuff_t *tvb, packet_info *pinfo, int *pOffset);
615
624void parseNodeClassMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset);
625
634void parseResultMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset);
635
646void dispatchExtensionObjectType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int *pOffset, const ExtensionObjectTypeId *typeId);
647
648#endif /* OPCUA_IDENTIFIERS_H */
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
proto_node proto_item
Definition proto.h:927
Type ID (NodeId) of an ExtensionObject.
Definition opcua_simpletypes.h:599
uint32_t numeric
Definition opcua_simpletypes.h:602
const char * string
Definition opcua_simpletypes.h:603
bool isNumeric
Definition opcua_simpletypes.h:601
uint16_t ns
Definition opcua_simpletypes.h:600
Pairs an expert info index with its associated header field index for registration and display.
Definition expert.h:41