1 /******************************************************************************
4 ** Copyright (C) 2006-2009 ascolab GmbH. All Rights Reserved.
5 ** Web: http://www.ascolab.com
7 ** This program is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU General Public License
9 ** as published by the Free Software Foundation; either version 2
10 ** of the License, or (at your option) any later version.
12 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15 ** Project: OpcUa Wireshark Plugin
17 ** Description: Service table and service dispatcher.
19 ** This file was autogenerated on 31.03.2009.
20 ** DON'T MODIFY THIS FILE!
21 ** XXX - well, except that you may have to. See the README.
23 ******************************************************************************/
30 #include <epan/packet.h>
31 #include "opcua_simpletypes.h"
32 #include "opcua_complextypeparser.h"
33 #include "opcua_extensionobjectids.h"
34 #include "opcua_hfindeces.h"
36 ExtensionObjectParserEntry g_arExtensionObjectParserTable[] = {
37 { OpcUaId_DataChangeNotification_Encoding_DefaultBinary, parseDataChangeNotification, "DataChangeNotification" },
38 { OpcUaId_EventNotificationList_Encoding_DefaultBinary, parseEventNotificationList, "EventNotificationList" },
40 const int g_NumTypes = sizeof(g_arExtensionObjectParserTable) / sizeof(ExtensionObjectParserEntry);
42 /** Dispatch all extension objects to a special parser function. */
43 void dispatchExtensionObjectType(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int TypeId)
45 gint iOffset = *pOffset;
50 /* get the length of the body */
51 iLen = tvb_get_letohl(tvb, iOffset);
54 while (index < g_NumTypes)
56 if (g_arExtensionObjectParserTable[index].iRequestId == TypeId)
59 (*g_arExtensionObjectParserTable[index].pParser)(tree, tvb, &iOffset, g_arExtensionObjectParserTable[index].typeName);
65 /* display contained object as ByteString if unknown type */
70 proto_tree_add_text(tree, tvb, iOffset, 0, "[OpcUa Null ByteString]");
74 proto_tree_add_item(tree, hf_opcua_ByteString, tvb, iOffset, iLen, TRUE);
75 iOffset += iLen; /* eat the whole bytestring */
79 char *szValue = ep_strdup_printf("[Invalid ByteString] Invalid length: %d", iLen);
80 proto_tree_add_text(tree, tvb, iOffset, 0, "%s", szValue);