2 * Routines for DCOM CBA
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include <epan/packet.h>
31 #include <epan/emem.h>
32 #include <epan/expert.h>
33 #include <epan/dissectors/packet-dcerpc.h>
34 #include <epan/dissectors/packet-dcom.h>
35 #include <epan/dissectors/packet-dcom-dispatch.h>
36 #include "packet-dcom-cba-acco.h"
39 static int hf_cba_opnum = -1;
41 static int hf_cba_revision_major = -1;
42 static int hf_cba_revision_minor = -1;
43 static int hf_cba_revision_service_pack = -1;
44 static int hf_cba_revision_build = -1;
46 static int hf_cba_time = -1;
48 static int hf_cba_name = -1;
49 static int hf_cba_producer = -1;
50 static int hf_cba_product = -1;
51 static int hf_cba_production_date = -1;
52 static int hf_cba_serial_no = -1;
53 static int hf_cba_multi_app = -1;
54 static int hf_cba_profinet_dcom_stack = -1;
55 static int hf_cba_pdev_stamp = -1;
57 static int hf_cba_browse_count = -1;
58 static int hf_cba_browse_offset = -1;
59 static int hf_cba_browse_max_return = -1;
60 static int hf_cba_browse_item = -1;
61 static int hf_cba_browse_data_type = -1;
62 static int hf_cba_browse_access_right = -1;
63 static int hf_cba_browse_selector = -1;
64 static int hf_cba_browse_info1 = -1;
65 static int hf_cba_browse_info2 = -1;
67 static int hf_cba_cookie = -1;
68 static int hf_cba_state = -1;
69 static int hf_cba_new_state = -1;
70 static int hf_cba_old_state = -1;
71 static int hf_cba_grouperror = -1;
72 static int hf_cba_new_grouperror = -1;
73 static int hf_cba_old_grouperror = -1;
75 static int hf_cba_component_id = -1;
76 static int hf_cba_component_version = -1;
77 static int hf_cba_pbaddress = -1;
78 static int hf_cba_pbaddress_system_id = -1;
79 static int hf_cba_pbaddress_address = -1;
81 static int hf_cba_save_ldev_name = -1;
82 static int hf_cba_save_result = -1;
84 static e_uuid_t uuid_coclass_CBAPhysicalDevice = { 0xcba00000, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
88 static int proto_ICBAPhysicalDevice = -1;
89 static gint ett_ICBAPhysicalDevice = -1;
90 static e_uuid_t uuid_ICBAPhysicalDevice = { 0xcba00001, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
91 static guint16 ver_ICBAPhysicalDevice = 0;
93 static int proto_ICBAPhysicalDevice2 = -1;
94 static e_uuid_t uuid_ICBAPhysicalDevice2 = { 0xcba00006, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
95 static guint16 ver_ICBAPhysicalDevice2 = 0;
97 static int proto_ICBABrowse = -1;
98 static gint ett_ICBABrowse = -1;
99 static e_uuid_t uuid_ICBABrowse = { 0xcba00002, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
100 static guint16 ver_ICBABrowse = 0;
102 static int proto_ICBABrowse2 = -1;
103 static e_uuid_t uuid_ICBABrowse2 = { 0xcba00007, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
104 static guint16 ver_ICBABrowse2 = 0;
106 static int proto_ICBAPhysicalDevicePC = -1;
107 static gint ett_ICBAPhysicalDevicePC = -1;
108 static e_uuid_t uuid_ICBAPhysicalDevicePC = { 0xcba00003, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
109 static guint16 ver_ICBAPhysicalDevicePC = 0;
111 static int proto_ICBAPhysicalDevicePCEvent = -1;
112 static gint ett_ICBAPhysicalDevicePCEvent = -1;
113 static e_uuid_t uuid_ICBAPhysicalDevicePCEvent = { 0xcba00004, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
114 static guint16 ver_ICBAPhysicalDevicePCEvent = 0;
116 static int proto_ICBAPersist = -1;
117 static gint ett_ICBAPersist = -1;
118 static e_uuid_t uuid_ICBAPersist = { 0xcba00005, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
119 static guint16 ver_ICBAPersist = 0;
121 static int proto_ICBAPersist2 = -1;
122 static e_uuid_t uuid_ICBAPersist2 = { 0xcba00008, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
123 static guint16 ver_ICBAPersist2 = 0;
125 static int proto_ICBALogicalDevice = -1;
126 static gint ett_ICBALogicalDevice = -1;
127 static e_uuid_t uuid_ICBALogicalDevice = { 0xcba00011, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
128 static guint16 ver_ICBALogicalDevice = 0;
130 static int proto_ICBALogicalDevice2 = -1;
131 static e_uuid_t uuid_ICBALogicalDevice2 = { 0xcba00017, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
132 static guint16 ver_ICBALogicalDevice2 = 0;
134 static int proto_ICBAState = -1;
135 static gint ett_ICBAState = -1;
136 static e_uuid_t uuid_ICBAState = { 0xcba00012, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
137 static guint16 ver_ICBAState = 0;
139 static int proto_ICBAStateEvent = -1;
140 static gint ett_ICBAStateEvent = -1;
141 static e_uuid_t uuid_ICBAStateEvent = { 0xcba00013, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
142 static guint16 ver_ICBAStateEvent = 0;
144 static int proto_ICBATime = -1;
145 static gint ett_ICBATime = -1;
146 static e_uuid_t uuid_ICBATime = { 0xcba00014, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
147 static guint16 ver_ICBATime = 0;
149 static int proto_ICBAGroupError = -1;
150 static gint ett_ICBAGroupError = -1;
151 static e_uuid_t uuid_ICBAGroupError = { 0xcba00015, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
152 static guint16 ver_ICBAGroupError = 0;
154 static int proto_ICBAGroupErrorEvent = -1;
155 static gint ett_ICBAGroupErrorEvent = -1;
156 static e_uuid_t uuid_ICBAGroupErrorEvent = { 0xcba00016, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
157 static guint16 ver_ICBAGroupErrorEvent = 0;
159 static int proto_ICBARTAuto = -1;
160 static gint ett_ICBARTAuto = -1;
161 static e_uuid_t uuid_ICBARTAuto = { 0xcba00051, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
162 static guint16 ver_ICBARTAuto = 0;
164 static int proto_ICBARTAuto2 = -1;
165 static e_uuid_t uuid_ICBARTAuto2 = { 0xcba00052, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
166 static guint16 ver_ICBARTAuto2 = 0;
168 static int proto_ICBASystemProperties = -1;
169 static gint ett_ICBASystemProperties = -1;
170 static e_uuid_t uuid_ICBASystemProperties = { 0xcba00062, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
171 static guint16 ver_ICBASystemProperties = 0;
174 static gint ett_PBAddress = -1;
177 static const value_string cba_state_vals[] = {
178 { 0x00, "NonExistent" },
179 { 0x01, "Initializing" },
181 { 0x03, "Operating" },
187 static const value_string cba_grouperror_vals[] = {
188 { 0x00, "NonAccessible" },
192 { 0x04, "MaintenanceRequired" },
193 { 0x05, "MaintenanceDemanded" },
194 { 0x06, "MaintenanceRequiredAndDemanded" },
195 { 0x07, "ProblemAndMaintenanceRequired" },
196 { 0x08, "ProblemAndMaintenanceDemanded" },
197 { 0x09, "ProblemAndMaintenanceRequiredAndDemanded" },
201 static const value_string dcom_boolean_vals[] = {
212 dissect_ICBABrowse_get_Count_resp(tvbuff_t *tvb, int offset,
213 packet_info *pinfo, proto_tree *tree, guint8 *drep)
219 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
221 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
222 hf_cba_browse_count, &u32Count);
224 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
227 if (u32HResult) { /* !S_OK */
228 col_append_fstr(pinfo->cinfo, COL_INFO, "-> %s",
229 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
231 col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u -> S_OK", u32Count);
240 dissect_ICBABrowse_BrowseItems_rqst(tvbuff_t *tvb, int offset,
241 packet_info *pinfo, proto_tree *tree, guint8 *drep)
244 guint32 u32MaxReturn;
247 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
249 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
250 hf_cba_browse_offset, &u32Offset);
251 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
252 hf_cba_browse_max_return, &u32MaxReturn);
254 col_append_fstr(pinfo->cinfo, COL_INFO, " Offset=%u MaxReturn=%u",
255 u32Offset, u32MaxReturn);
262 dissect_ICBABrowse_BrowseItems_resp(tvbuff_t *tvb, int offset,
263 packet_info *pinfo, proto_tree *tree, guint8 *drep)
269 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
271 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
274 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_browse_item);
277 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
280 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_browse_data_type);
283 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
286 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_browse_access_right);
289 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
292 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
293 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
300 dissect_ICBABrowse2_get_Count2_rqst(tvbuff_t *tvb, int offset,
301 packet_info *pinfo, proto_tree *tree, guint8 *drep)
306 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
308 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
309 hf_cba_browse_selector, &u32Selector);
311 col_append_fstr(pinfo->cinfo, COL_INFO, " Selector=%u",
320 dissect_ICBABrowse2_BrowseItems2_rqst(tvbuff_t *tvb, int offset,
321 packet_info *pinfo, proto_tree *tree, guint8 *drep)
325 guint32 u32MaxReturn;
328 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
330 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
331 hf_cba_browse_selector, &u32Selector);
332 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
333 hf_cba_browse_offset, &u32Offset);
334 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
335 hf_cba_browse_max_return, &u32MaxReturn);
337 col_append_fstr(pinfo->cinfo, COL_INFO, " Sel=%u Offset=%u MaxReturn=%u",
338 u32Selector, u32Offset, u32MaxReturn);
345 dissect_ICBABrowse2_BrowseItems2_resp(tvbuff_t *tvb, int offset,
346 packet_info *pinfo, proto_tree *tree, guint8 *drep)
352 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
354 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
357 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_browse_item);
360 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
363 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_browse_info1);
366 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
369 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_browse_info2);
372 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
375 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
376 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
383 dissect_ICBAPersist2_Save2_resp(tvbuff_t *tvb, int offset,
384 packet_info *pinfo, proto_tree *tree, guint8 *drep)
390 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
392 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
395 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_save_ldev_name);
398 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
401 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep, hf_cba_save_result);
404 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
407 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
408 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
416 dissect_get_BSTR_resp(tvbuff_t *tvb, int offset,
417 packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex)
420 guint32 u32MaxStr = sizeof(szStr);
425 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
427 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
430 offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, drep,
431 hfindex, szStr, u32MaxStr);
434 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
437 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\" -> %s", szStr,
438 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
445 dissect_get_ProductionDate_resp(tvbuff_t *tvb, int offset,
446 packet_info *pinfo, proto_tree *tree, guint8 *drep)
452 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
454 offset = dissect_dcom_DATE(tvb, offset, pinfo, tree, drep,
455 hf_cba_production_date, &r8Date);
457 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
460 col_append_fstr(pinfo->cinfo, COL_INFO, ": Date: %g -> %s",
462 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
469 dissect_get_SerialNo_resp(tvbuff_t *tvb, int offset,
470 packet_info *pinfo, proto_tree *tree, guint8 *drep)
476 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
478 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
481 offset = dissect_dcom_VARIANT(tvb, offset, pinfo, tree, drep,
485 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
488 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
489 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
496 dissect_ICBATime_get_Time_resp(tvbuff_t *tvb, int offset,
497 packet_info *pinfo, proto_tree *tree, guint8 *drep)
503 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
505 offset = dissect_dcom_DATE(tvb, offset, pinfo, tree, drep,
506 hf_cba_time, &r8Date);
508 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
511 col_append_fstr(pinfo->cinfo, COL_INFO, ": Time: %g -> %s",
513 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
520 dissect_ICBATime_put_Time_rqst(tvbuff_t *tvb, int offset,
521 packet_info *pinfo, proto_tree *tree, guint8 *drep)
526 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
528 offset = dissect_dcom_DATE(tvb, offset, pinfo, tree, drep,
529 hf_cba_time, &r8Date);
536 dissect_get_Producer_resp(tvbuff_t *tvb, int offset,
537 packet_info *pinfo, proto_tree *tree, guint8 *drep)
540 return dissect_get_BSTR_resp(tvb, offset, pinfo, tree, drep, hf_cba_producer);
545 dissect_get_Product_resp(tvbuff_t *tvb, int offset,
546 packet_info *pinfo, proto_tree *tree, guint8 *drep)
549 return dissect_get_BSTR_resp(tvb, offset, pinfo, tree, drep, hf_cba_product);
554 dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset,
555 packet_info *pinfo, proto_tree *tree, guint8 *drep)
559 guint32 u32MaxStr = sizeof(szStr);
560 dcerpc_info *info = (dcerpc_info *) pinfo->private_data;
564 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
566 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
569 offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, drep,
570 hf_cba_name, szStr, u32MaxStr);
573 if(strlen(szStr) > 0) {
574 call = se_strdup(szStr);
575 info->call_data->private_data = call;
578 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\"", szStr);
585 dissect_ICBAPhysicalDevice_get_LogicalDevice_resp(tvbuff_t *tvb, int offset,
586 packet_info *pinfo, proto_tree *tree, guint8 *drep)
589 dcerpc_info *info = (dcerpc_info *) pinfo->private_data;
590 gchar *ldev_name = info->call_data->private_data;
591 dcom_interface_t *pdev_interf;
592 dcom_interface_t *ldev_interf;
597 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
599 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &ldev_interf);
601 /* try to read the ldev name from the request */
602 if(ldev_name != NULL && ldev_interf != NULL) {
603 /* XXX - this is a hack to create a pdev interface */
604 /* as I currently don't understand the objref process for a root interface! */
605 pdev_interf = dcom_interface_new(pinfo, pinfo->net_dst.data, &uuid_ICBAPhysicalDevice, 0, 0, &info->call_data->object_uuid);
606 if(pdev_interf != NULL) {
607 pdev = cba_pdev_add(pinfo, pinfo->net_dst.data);
608 cba_pdev_link(pinfo, pdev, pdev_interf);
610 ldev = cba_ldev_add(pinfo, pdev, ldev_name);
611 cba_ldev_link(pinfo, ldev, ldev_interf);
615 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
618 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
619 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
626 dissect_ICBAPhysicalDevice2_Type_resp(tvbuff_t *tvb, int offset,
627 packet_info *pinfo, proto_tree *tree, guint8 *drep)
630 guint16 u16PROFInetDCOMStack;
634 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
636 offset = dissect_dcom_VARIANT_BOOL(tvb, offset, pinfo, tree, drep,
637 hf_cba_multi_app, &u16MultiApp);
639 offset = dissect_dcom_VARIANT_BOOL(tvb, offset, pinfo, tree, drep,
640 hf_cba_profinet_dcom_stack, &u16PROFInetDCOMStack);
642 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
645 col_append_fstr(pinfo->cinfo, COL_INFO, " App=%s Stack=%s -> %s",
646 (u16MultiApp) ? "Multi" : "Single",
647 (u16PROFInetDCOMStack) ? "PN-DCOM" : "MS-DCOM",
648 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
655 dissect_PROFInetRevision_resp(tvbuff_t *tvb, int offset,
656 packet_info *pinfo, proto_tree *tree, guint8 *drep)
660 guint16 u16ServicePack;
665 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
667 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
668 hf_cba_revision_major, &u16Major);
669 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
670 hf_cba_revision_minor, &u16Minor);
671 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
672 hf_cba_revision_service_pack, &u16ServicePack);
673 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
674 hf_cba_revision_build, &u16Build);
676 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
679 col_append_fstr(pinfo->cinfo, COL_INFO, " Revision=%u.%u.%u.%u -> %s",
680 u16Major, u16Minor, u16ServicePack, u16Build,
681 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
688 dissect_ICBAPhysicalDevice2_get_PDevStamp_resp(tvbuff_t *tvb, int offset,
689 packet_info *pinfo, proto_tree *tree, guint8 *drep)
691 guint32 u32PDevStamp;
695 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
697 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
698 hf_cba_pdev_stamp, &u32PDevStamp);
700 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
703 col_append_fstr(pinfo->cinfo, COL_INFO, " PDevStamp=0x%x -> %s",
705 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
712 dissect_Revision_resp(tvbuff_t *tvb, int offset,
713 packet_info *pinfo, proto_tree *tree, guint8 *drep)
720 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
722 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
723 hf_cba_revision_major, &u16Major);
725 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
726 hf_cba_revision_minor, &u16Minor);
728 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
731 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u.%u -> %s",
733 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
740 dissect_ICBALogicalDevice_get_Name_resp(tvbuff_t *tvb, int offset,
741 packet_info *pinfo, proto_tree *tree, guint8 *drep)
744 guint32 u32MaxStr = sizeof(szStr);
749 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
751 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
754 offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, drep,
755 hf_cba_name, szStr, u32MaxStr);
758 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
761 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\" -> %s", szStr,
762 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
769 dissect_RTAuto_get_Name_resp(tvbuff_t *tvb, int offset,
770 packet_info *pinfo, proto_tree *tree, guint8 *drep)
773 return dissect_get_BSTR_resp(tvb, offset, pinfo, tree, drep, hf_cba_name);
778 dissect_ICBALogicalDevice_get_ACCO_resp(tvbuff_t *tvb, int offset,
779 packet_info *pinfo, proto_tree *tree, guint8 *drep)
782 dcom_interface_t *acco_interf;
783 dcerpc_info *info = (dcerpc_info *) pinfo->private_data;
787 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
789 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &acco_interf);
790 if(acco_interf == NULL) {
791 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_WARN,
792 "LDev_get_ACCO: can't resolve ACCO interface pointer");
795 ldev = cba_ldev_find(pinfo, pinfo->net_src.data, &info->call_data->object_uuid);
797 /* "crosslink" interface and it's object */
798 if(ldev != NULL && acco_interf != NULL) {
799 cba_ldev_link_acco(pinfo, ldev, acco_interf);
802 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult);
804 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
805 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
812 dissect_ICBALogicalDevice_get_RTAuto_resp(tvbuff_t *tvb, int offset,
813 packet_info *pinfo, proto_tree *tree, guint8 *drep)
818 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
820 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, NULL);
822 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult);
824 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
825 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
832 dissect_ICBALogicalDevice_Get_RTAuto_rqst(tvbuff_t *tvb, int offset,
833 packet_info *pinfo, proto_tree *tree, guint8 *drep)
836 guint32 u32MaxStr = sizeof(szStr);
840 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
842 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
845 offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, drep,
846 hf_cba_name, szStr, u32MaxStr);
849 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\"", szStr);
857 dissect_ComponentInfo_resp(tvbuff_t *tvb, int offset,
858 packet_info *pinfo, proto_tree *tree, guint8 *drep)
861 guint32 u32MaxStr = sizeof(szStr);
863 guint32 u32MaxStr2 = sizeof(szStr2);
868 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
870 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
873 offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, drep,
874 hf_cba_component_id, szStr, u32MaxStr);
877 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
880 offset = dissect_dcom_BSTR(tvb, offset, pinfo, tree, drep,
881 hf_cba_component_version, szStr2, u32MaxStr2);
884 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult);
886 col_append_fstr(pinfo->cinfo, COL_INFO, ": ID=\"%s\" Version=\"%s\" -> %s",
888 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
895 dissect_PBAddressInfo(tvbuff_t *tvb, gint offset, packet_info *pinfo,
896 proto_tree *tree, guint8 *drep,
897 guint32 u32VarType _U_, guint32 u32ArraySize)
901 proto_item *sub_item;
902 proto_tree *sub_tree;
905 while(u32ArraySize != 0) {
906 sub_item = proto_tree_add_item(tree, hf_cba_pbaddress, tvb, offset, 2, ENC_NA);
907 sub_tree = proto_item_add_subtree(sub_item, ett_PBAddress);
909 offset = dissect_dcom_BYTE(tvb, offset, pinfo, sub_tree, drep,
910 hf_cba_pbaddress_system_id, &u8ID);
911 offset = dissect_dcom_BYTE(tvb, offset, pinfo, sub_tree, drep,
912 hf_cba_pbaddress_address, &u8Addr);
915 proto_item_append_text(sub_item, ": ID=0x%x Addr=%u", u8ID, u8Addr);
916 col_append_fstr(pinfo->cinfo, COL_INFO, ", ID=0x%x Addr=%u",
923 dissect_PBAddressInfo_resp(tvbuff_t *tvb, int offset,
924 packet_info *pinfo, proto_tree *tree, guint8 *drep)
928 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
930 offset = dissect_dcom_SAFEARRAY(tvb, offset, pinfo, tree, drep, 0 /*hfindex _U_ */, dissect_PBAddressInfo);
932 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, &u32HResult);
934 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
935 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
942 dissect_Advise_rqst(tvbuff_t *tvb, int offset,
943 packet_info *pinfo, proto_tree *tree, guint8 *drep)
947 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
949 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, NULL);
956 dissect_Advise_resp(tvbuff_t *tvb, int offset,
957 packet_info *pinfo, proto_tree *tree, guint8 *drep)
963 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
965 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
966 hf_cba_cookie, &u32Cookie);
968 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
971 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cookie=0x%x -> %s",
973 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
980 dissect_Unadvise_rqst(tvbuff_t *tvb, int offset,
981 packet_info *pinfo, proto_tree *tree, guint8 *drep)
986 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
988 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
989 hf_cba_cookie, &u32Cookie);
991 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cookie=0x%x",
999 dissect_ICBAState_get_State_resp(tvbuff_t *tvb, int offset,
1000 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1006 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1008 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1009 hf_cba_state, &u16State);
1011 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1014 col_append_fstr(pinfo->cinfo, COL_INFO, ": State=%s -> %s",
1015 val_to_str(u16State, cba_state_vals, "Unknown (0x%08x)"),
1016 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1023 dissect_ICBAStateEvent_OnStateChanged_rqst(tvbuff_t *tvb, int offset,
1024 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1026 guint16 u16NewState;
1027 guint16 u16OldState;
1030 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1032 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1033 hf_cba_new_state, &u16NewState);
1035 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1036 hf_cba_old_state, &u16OldState);
1038 col_append_fstr(pinfo->cinfo, COL_INFO, ": NewState=%s OldState=%s",
1039 val_to_str(u16NewState, cba_state_vals, "Unknown (0x%04x)"),
1040 val_to_str(u16OldState, cba_state_vals, "Unknown (0x%04x)") );
1047 dissect_ICBAGroupError_OnGroupErrorChanged_rqst(tvbuff_t *tvb, int offset,
1048 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1050 guint16 u16NewGroupError;
1051 guint16 u16OldGroupError;
1054 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1056 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1057 hf_cba_new_grouperror, &u16NewGroupError);
1059 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1060 hf_cba_old_grouperror, &u16OldGroupError);
1062 col_append_fstr(pinfo->cinfo, COL_INFO, ": NewGE=%s OldGE=%s",
1063 val_to_str(u16NewGroupError, cba_grouperror_vals, "Unknown (0x%04x)"),
1064 val_to_str(u16OldGroupError, cba_grouperror_vals, "Unknown (0x%04x)") );
1071 dissect_ICBAPhysicalDevicePCEvent_OnLogicalDeviceAdded_rqst(tvbuff_t *tvb, int offset,
1072 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1078 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1080 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1081 hf_cba_cookie, &u32Cookie);
1083 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, NULL);
1085 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1088 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cookie=0x%x %s",
1090 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1097 dissect_ICBAGroupError_GroupError_resp(tvbuff_t *tvb, int offset,
1098 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1100 guint16 u16GroupError;
1105 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1107 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1108 hf_cba_grouperror, &u16GroupError);
1110 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1111 hf_cba_cookie, &u32Cookie);
1113 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1116 col_append_fstr(pinfo->cinfo, COL_INFO, ": GroupError=%s Cookie=0x%x -> %s",
1117 val_to_str(u16GroupError, cba_grouperror_vals, "Unknown (0x%08x)"),
1119 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1125 /* sub dissector table of ICBAPhysicalDevice / ICBAPhysicalDevice2 interface */
1126 static dcerpc_sub_dissector ICBAPhysicalDevice_dissectors[] = {
1127 { 0, "QueryInterface", NULL, NULL },
1128 { 1, "AddRef", NULL, NULL },
1129 { 2, "Release", NULL, NULL },
1131 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1132 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1133 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1134 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1136 { 7, "get_Producer", dissect_dcom_simple_rqst, dissect_get_Producer_resp },
1137 { 8, "get_Product", dissect_dcom_simple_rqst, dissect_get_Product_resp },
1138 { 9, "get_SerialNo", dissect_dcom_simple_rqst, dissect_get_SerialNo_resp },
1139 {10, "get_ProductionDate", dissect_dcom_simple_rqst, dissect_get_ProductionDate_resp },
1140 {11, "Revision", dissect_dcom_simple_rqst, dissect_Revision_resp },
1141 {12, "get_LogicalDevice", dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst, dissect_ICBAPhysicalDevice_get_LogicalDevice_resp },
1143 {13, "Type", dissect_dcom_simple_rqst, dissect_ICBAPhysicalDevice2_Type_resp },
1144 {14, "PROFInetRevision", dissect_dcom_simple_rqst, dissect_PROFInetRevision_resp },
1145 {15, "PDevStamp", dissect_dcom_simple_rqst, dissect_ICBAPhysicalDevice2_get_PDevStamp_resp },
1146 { 0, NULL, NULL, NULL },
1150 /* sub dissector table of ICBABrowse / ICBABrowse2 interface */
1151 static dcerpc_sub_dissector ICBABrowse_dissectors[] = {
1152 { 0, "QueryInterface", NULL, NULL },
1153 { 1, "AddRef", NULL, NULL },
1154 { 2, "Release", NULL, NULL },
1156 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1157 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1158 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1159 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1161 { 7, "get_Count", dissect_dcom_simple_rqst, dissect_ICBABrowse_get_Count_resp },
1162 { 8, "BrowseItems", dissect_ICBABrowse_BrowseItems_rqst, dissect_ICBABrowse_BrowseItems_resp },
1164 { 9, "get_Count2", dissect_ICBABrowse2_get_Count2_rqst, dissect_ICBABrowse_get_Count_resp },
1165 {10, "BrowseItems2", dissect_ICBABrowse2_BrowseItems2_rqst, dissect_ICBABrowse2_BrowseItems2_resp },
1166 { 0, NULL, NULL, NULL },
1170 /* sub dissector table of ICBAPersist / ICBAPersist2 interface */
1171 static dcerpc_sub_dissector ICBAPersist_dissectors[] = {
1172 { 0, "QueryInterface", NULL, NULL },
1173 { 1, "AddRef", NULL, NULL },
1174 { 2, "Release", NULL, NULL },
1176 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1177 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1178 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1179 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1181 { 7, "Save", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
1183 { 8, "Save2", dissect_dcom_simple_rqst, dissect_ICBAPersist2_Save2_resp },
1184 { 0, NULL, NULL, NULL },
1188 /* sub dissector table of ICBAPhysicalDevicePC interface */
1189 /* (local COM interface, not to be called over network) */
1190 static dcerpc_sub_dissector ICBAPhysicalDevicePC_dissectors[] = {
1191 { 0, "QueryInterface", NULL, NULL },
1192 { 1, "AddRef", NULL, NULL },
1193 { 2, "Release", NULL, NULL },
1195 { 3, "AddLogicalDevice", dissect_Advise_rqst, dissect_Advise_resp },
1196 { 4, "RemoveLogicalDevice", dissect_Unadvise_rqst, dissect_dcom_simple_resp },
1197 { 5, "AdvisePDevPC", dissect_Advise_rqst, dissect_Advise_resp },
1198 { 6, "UnadvisePDevPC", dissect_Unadvise_rqst, dissect_dcom_simple_resp },
1200 { 7, "RegisterApplication", NULL, NULL },
1201 { 8, "UnRegisterApplication", NULL, NULL },
1202 { 9, "AddLogicalDevice2", NULL, NULL },
1203 { 0, NULL, NULL, NULL },
1207 /* sub dissector table of ICBAPhysicalDevicePCEvent interface */
1208 static dcerpc_sub_dissector ICBAPhysicalDevicePCEvent_dissectors[] = {
1209 { 0, "QueryInterface", NULL, NULL },
1210 { 1, "AddRef", NULL, NULL },
1211 { 2, "Release", NULL, NULL },
1213 { 3, "OnLogicalDeviceAdded", dissect_ICBAPhysicalDevicePCEvent_OnLogicalDeviceAdded_rqst, dissect_dcom_simple_resp },
1214 { 4, "OnLogicalDeviceRemoved", dissect_Unadvise_rqst, dissect_dcom_simple_resp },
1215 { 0, NULL, NULL, NULL },
1219 /* sub dissector table of ICBALogicalDevice / ICBALogicalDevice2 interface */
1220 static dcerpc_sub_dissector ICBALogicalDevice_dissectors[] = {
1221 { 0, "QueryInterface", NULL, NULL },
1222 { 1, "AddRef", NULL, NULL },
1223 { 2, "Release", NULL, NULL },
1225 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1226 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1227 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1228 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1230 { 7, "get_Name", dissect_dcom_simple_rqst, dissect_ICBALogicalDevice_get_Name_resp },
1231 { 8, "get_Producer", dissect_dcom_simple_rqst, dissect_get_Producer_resp },
1232 { 9, "get_Product", dissect_dcom_simple_rqst, dissect_get_Product_resp },
1233 {10, "get_SerialNo", dissect_dcom_simple_rqst, dissect_get_SerialNo_resp },
1234 {11, "get_ProductionDate", dissect_dcom_simple_rqst, dissect_get_ProductionDate_resp },
1235 {12, "Revision", dissect_dcom_simple_rqst, dissect_Revision_resp },
1236 {13, "get_ACCO", dissect_dcom_simple_rqst, dissect_ICBALogicalDevice_get_ACCO_resp },
1237 {14, "get_RTAuto", dissect_ICBALogicalDevice_Get_RTAuto_rqst, dissect_ICBALogicalDevice_get_RTAuto_resp },
1239 {15, "PROFInetRevision", dissect_dcom_simple_rqst, dissect_PROFInetRevision_resp },
1240 {16, "ComponentInfo", dissect_dcom_simple_rqst, dissect_ComponentInfo_resp },
1241 {17, "PBAddressInfo", dissect_dcom_simple_rqst, dissect_PBAddressInfo_resp },
1242 { 0, NULL, NULL, NULL },
1246 /* sub dissector table of ICBAState interface */
1247 static dcerpc_sub_dissector ICBAState_dissectors[] = {
1248 { 0, "QueryInterface", NULL, NULL },
1249 { 1, "AddRef", NULL, NULL },
1250 { 2, "Release", NULL, NULL },
1252 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1253 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1254 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1255 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1257 { 7, "get_State", dissect_dcom_simple_rqst, dissect_ICBAState_get_State_resp },
1258 { 8, "Activate", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
1259 { 9, "Deactivate", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
1260 {10, "Reset", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
1261 {11, "AdviseState", dissect_Advise_rqst, dissect_Advise_resp },
1262 {12, "UnadviseState", dissect_Unadvise_rqst, dissect_dcom_simple_resp },
1263 { 0, NULL, NULL, NULL },
1267 /* sub dissector table of ICBAStateEvent interface */
1268 static dcerpc_sub_dissector ICBAStateEvent_dissectors[] = {
1269 { 0, "QueryInterface", NULL, NULL },
1270 { 1, "AddRef", NULL, NULL },
1271 { 2, "Release", NULL, NULL },
1273 { 3, "OnStateChanged", dissect_ICBAStateEvent_OnStateChanged_rqst, dissect_dcom_simple_resp },
1274 { 0, NULL, NULL, NULL },
1278 /* sub dissector table of ICBATime interface */
1279 static dcerpc_sub_dissector ICBATime_dissectors[] = {
1280 { 0, "QueryInterface", NULL, NULL },
1281 { 1, "AddRef", NULL, NULL },
1282 { 2, "Release", NULL, NULL },
1284 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1285 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1286 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1287 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1289 { 7, "get_Time", dissect_dcom_simple_rqst, dissect_ICBATime_get_Time_resp },
1290 { 8, "put_Time", dissect_ICBATime_put_Time_rqst, dissect_dcom_simple_resp },
1291 { 0, NULL, NULL, NULL },
1295 /* sub dissector table of ICBAGroupError interface */
1296 static dcerpc_sub_dissector ICBAGroupError_dissectors[] = {
1297 { 0, "QueryInterface", NULL, NULL },
1298 { 1, "AddRef", NULL, NULL },
1299 { 2, "Release", NULL, NULL },
1301 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1302 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1303 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1304 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1306 { 7, "GroupError", dissect_dcom_simple_rqst, dissect_ICBAGroupError_GroupError_resp },
1307 { 8, "AdviseGroupError", dissect_Advise_rqst, dissect_Advise_resp },
1308 { 9, "UnadviseGroupError", dissect_Unadvise_rqst, dissect_dcom_simple_resp },
1309 { 0, NULL, NULL, NULL },
1313 /* sub dissector table of ICBAGroupErrorEvent interface */
1314 static dcerpc_sub_dissector ICBAGroupErrorEvent_dissectors[] = {
1315 { 0, "QueryInterface", NULL, NULL },
1316 { 1, "AddRef", NULL, NULL },
1317 { 2, "Release", NULL, NULL },
1319 { 3, "OnGroupErrorChanged", dissect_ICBAGroupError_OnGroupErrorChanged_rqst, dissect_dcom_simple_resp },
1320 { 0, NULL, NULL, NULL },
1324 /* sub dissector table of ICBARTAuto interface */
1325 static dcerpc_sub_dissector ICBARTAuto_dissectors[] = {
1326 { 0, "QueryInterface", NULL, NULL },
1327 { 1, "AddRef", NULL, NULL },
1328 { 2, "Release", NULL, NULL },
1330 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1331 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1332 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1333 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1335 { 7, "get_Name", dissect_dcom_simple_rqst, dissect_RTAuto_get_Name_resp },
1336 { 8, "Revision", dissect_dcom_simple_rqst, dissect_Revision_resp },
1339 { 9, "ComponentInfo", dissect_dcom_simple_rqst, dissect_ComponentInfo_resp },
1340 { 0, NULL, NULL, NULL },
1344 /* the interface ICBASystemProperties will NOT be seen on the ethernet */
1345 /* sub dissector table of ICBASystemProperties interface (stage 2 only) */
1346 /* (usually not called over network, no dissecting needed) */
1347 static dcerpc_sub_dissector ICBASystemProperties_dissectors[] = {
1348 { 0, "QueryInterface", NULL, NULL },
1349 { 1, "AddRef", NULL, NULL },
1350 { 2, "Release", NULL, NULL },
1352 { 3, "GetTypeInfoCount", dissect_dcom_simple_rqst, dissect_IDispatch_GetTypeInfoCount_resp },
1353 { 4, "GetTypeInfo", dissect_IDispatch_GetTypeInfo_rqst, dissect_IDispatch_GetTypeInfo_resp },
1354 { 5, "GetIDsOfNames", dissect_IDispatch_GetIDsOfNames_rqst, dissect_IDispatch_GetIDsOfNames_resp },
1355 { 6, "Invoke", dissect_IDispatch_Invoke_rqst, dissect_IDispatch_Invoke_resp },
1357 { 7, "StateCollection", dissect_dcom_simple_rqst, NULL },
1358 { 8, "StampCollection", dissect_dcom_simple_rqst, NULL },
1359 { 0, NULL, NULL, NULL },
1363 static void cba_reinit( void) {
1368 /* register protocol */
1370 proto_register_dcom_cba (void)
1372 static hf_register_info hf_cba_browse_array[] = {
1373 { &hf_cba_browse_count,
1374 { "Count", "cba.browse.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1375 { &hf_cba_browse_offset,
1376 { "Offset", "cba.browse.offset", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1377 { &hf_cba_browse_max_return,
1378 { "MaxReturn", "cba.browse.max_return", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1379 { &hf_cba_browse_item,
1380 { "ItemNames", "cba.browse.item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1381 { &hf_cba_browse_data_type,
1382 { "DataTypes", "cba.browse.data_type", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1383 { &hf_cba_browse_access_right,
1384 { "AccessRights", "cba.browse.access_right", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1385 { &hf_cba_browse_selector,
1386 { "Selector", "cba.browse.selector", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1387 { &hf_cba_browse_info1,
1388 { "Info1", "cba.browse.info1", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1389 { &hf_cba_browse_info2,
1390 { "Info2", "cba.browse.info2", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1394 static hf_register_info hf_cba_pdev_array[] = {
1395 { &hf_cba_revision_major,
1396 { "Major", "cba.revision_major", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1397 { &hf_cba_revision_minor,
1398 { "Minor", "cba.revision_minor", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1399 { &hf_cba_revision_service_pack,
1400 { "ServicePack", "cba.revision_service_pack", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1401 { &hf_cba_revision_build,
1402 { "Build", "cba_revision_build", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1404 { "Producer", "cba.producer", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1406 { "Product", "cba.product", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1407 { &hf_cba_multi_app,
1408 { "MultiApp", "cba.multi_app", FT_UINT16, BASE_HEX, VALS(dcom_boolean_vals), 0x0, NULL, HFILL }},
1409 { &hf_cba_profinet_dcom_stack,
1410 { "PROFInetDCOMStack", "cba.profinet_dcom_stack", FT_UINT16, BASE_HEX, VALS(dcom_boolean_vals), 0x0, NULL, HFILL }},
1411 { &hf_cba_pdev_stamp,
1412 { "PDevStamp", "cba.pdev_stamp", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1413 { &hf_cba_save_ldev_name,
1414 { "LDevName", "cba.save_ldev_name", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1415 { &hf_cba_save_result,
1416 { "PartialResult", "cba.save_result", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1419 static hf_register_info hf_cba_ldev_array[] = {
1421 { "Name", "cba.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1422 { &hf_cba_component_id,
1423 { "ComponentID", "cba.component_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1424 { &hf_cba_component_version,
1425 { "Version", "cba.component_version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1426 { &hf_cba_pbaddress,
1427 { "PROFIBUS Address", "cba.pbaddress", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1428 { &hf_cba_pbaddress_system_id,
1429 { "SystemID", "cba.pbaddress.system_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1430 { &hf_cba_pbaddress_address,
1431 { "Address", "cba.pbaddress.address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1434 static hf_register_info hf_cba_array[] = {
1436 { "Operation", "cba.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1437 { &hf_cba_production_date,
1438 { "ProductionDate", "cba.production_date", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1440 { "Time", "cba.time", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1441 { &hf_cba_serial_no,
1442 { "SerialNo", "cba.serial_no", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1444 { "State", "cba.state", FT_UINT16, BASE_HEX, VALS(cba_state_vals), 0x0, NULL, HFILL }},
1445 { &hf_cba_new_state,
1446 { "NewState", "cba.state_new", FT_UINT16, BASE_HEX, VALS(cba_state_vals), 0x0, NULL, HFILL }},
1447 { &hf_cba_old_state,
1448 { "OldState", "cba.state_old", FT_UINT16, BASE_HEX, VALS(cba_state_vals), 0x0, NULL, HFILL }},
1450 { "Cookie", "cba.cookie", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1451 { &hf_cba_grouperror,
1452 { "GroupError", "cba.grouperror", FT_UINT16, BASE_HEX, VALS(cba_grouperror_vals), 0x0, NULL, HFILL }},
1453 { &hf_cba_new_grouperror,
1454 { "NewGroupError", "cba.grouperror_new", FT_UINT16, BASE_HEX, VALS(cba_grouperror_vals), 0x0, NULL, HFILL }},
1455 { &hf_cba_old_grouperror,
1456 { "OldGroupError", "cba.grouperror_old", FT_UINT16, BASE_HEX, VALS(cba_grouperror_vals), 0x0, NULL, HFILL }},
1459 static gint *ett_cba[] = {
1460 &ett_ICBAPhysicalDevice,
1462 &ett_ICBAPhysicalDevicePC,
1463 &ett_ICBAPhysicalDevicePCEvent,
1465 &ett_ICBALogicalDevice,
1467 &ett_ICBAStateEvent,
1469 &ett_ICBAGroupError,
1470 &ett_ICBAGroupErrorEvent,
1472 &ett_ICBASystemProperties,
1476 proto_register_subtree_array (ett_cba, array_length (ett_cba));
1478 proto_ICBAPhysicalDevice = proto_register_protocol ("ICBAPhysicalDevice", "ICBAPDev", "cba_pdev");
1479 proto_register_field_array(proto_ICBAPhysicalDevice, hf_cba_pdev_array, array_length(hf_cba_pdev_array));
1481 proto_ICBAPhysicalDevice2 = proto_register_protocol ("ICBAPhysicalDevice2", "ICBAPDev2", "cba_pdev2");
1483 proto_ICBABrowse = proto_register_protocol ("ICBABrowse", "ICBABrowse", "cba_browse");
1484 proto_register_field_array(proto_ICBABrowse, hf_cba_array, array_length(hf_cba_array));
1485 proto_register_field_array(proto_ICBABrowse, hf_cba_browse_array, array_length(hf_cba_browse_array));
1487 proto_ICBABrowse2 = proto_register_protocol ("ICBABrowse2", "ICBABrowse2", "cba_browse2");
1489 proto_ICBAPhysicalDevicePC = proto_register_protocol ("ICBAPhysicalDevicePC", "ICBAPDevPC", "cba_pdev_pc");
1491 proto_ICBAPhysicalDevicePCEvent = proto_register_protocol ("ICBAPhysicalDevicePCEvent", "ICBAPDevPCEvent", "cba_pdev_pc_event");
1493 proto_ICBAPersist = proto_register_protocol ("ICBAPersist", "ICBAPersist", "cba_persist");
1495 proto_ICBAPersist2 = proto_register_protocol ("ICBAPersist2", "ICBAPersist2", "cba_persist2");
1497 proto_ICBALogicalDevice = proto_register_protocol ("ICBALogicalDevice", "ICBALDev", "cba_ldev");
1498 proto_register_field_array(proto_ICBAPhysicalDevice, hf_cba_ldev_array, array_length(hf_cba_ldev_array));
1500 proto_ICBALogicalDevice2 = proto_register_protocol ("ICBALogicalDevice2", "ICBALDev2", "cba_ldev2");
1502 proto_ICBAState = proto_register_protocol ("ICBAState", "ICBAState", "cba_state");
1504 proto_ICBAStateEvent = proto_register_protocol ("ICBAStateEvent", "ICBAStateEvent", "cba_state_event");
1506 proto_ICBATime = proto_register_protocol ("ICBATime", "ICBATime", "cba_time");
1508 proto_ICBAGroupError = proto_register_protocol ("ICBAGroupError", "ICBAGErr", "cba_grouperror");
1510 proto_ICBAGroupErrorEvent = proto_register_protocol ("ICBAGroupErrorEvent", "ICBAGErrEvent", "cba_grouperror_event");
1512 proto_ICBARTAuto = proto_register_protocol ("ICBARTAuto", "ICBARTAuto", "cba_rtauto");
1514 proto_ICBARTAuto2 = proto_register_protocol ("ICBARTAuto2", "ICBARTAuto2", "cba_rtauto2");
1516 proto_ICBASystemProperties = proto_register_protocol ("ICBASystemProperties", "ICBASysProp", "cba_sysprop");
1518 register_init_routine(cba_reinit);
1522 /* handoff protocol */
1524 proto_reg_handoff_dcom_cba (void)
1526 /* Register the CBA class ID */
1527 guids_add_uuid(&uuid_coclass_CBAPhysicalDevice, "CBA");
1529 /* Register the interfaces */
1530 dcerpc_init_uuid(proto_ICBAPhysicalDevice, ett_ICBAPhysicalDevice,
1531 &uuid_ICBAPhysicalDevice, ver_ICBAPhysicalDevice,
1532 ICBAPhysicalDevice_dissectors, hf_cba_opnum);
1534 dcerpc_init_uuid(proto_ICBAPhysicalDevice2, ett_ICBAPhysicalDevice,
1535 &uuid_ICBAPhysicalDevice2, ver_ICBAPhysicalDevice2,
1536 ICBAPhysicalDevice_dissectors, hf_cba_opnum);
1538 dcerpc_init_uuid(proto_ICBABrowse, ett_ICBABrowse,
1539 &uuid_ICBABrowse, ver_ICBABrowse,
1540 ICBABrowse_dissectors, hf_cba_opnum);
1542 dcerpc_init_uuid(proto_ICBABrowse2, ett_ICBABrowse,
1543 &uuid_ICBABrowse2, ver_ICBABrowse2,
1544 ICBABrowse_dissectors, hf_cba_opnum);
1546 dcerpc_init_uuid(proto_ICBAPhysicalDevicePC, ett_ICBAPhysicalDevicePC,
1547 &uuid_ICBAPhysicalDevicePC, ver_ICBAPhysicalDevicePC,
1548 ICBAPhysicalDevicePC_dissectors, hf_cba_opnum);
1550 dcerpc_init_uuid(proto_ICBAPhysicalDevicePCEvent, ett_ICBAPhysicalDevicePCEvent,
1551 &uuid_ICBAPhysicalDevicePCEvent, ver_ICBAPhysicalDevicePCEvent,
1552 ICBAPhysicalDevicePCEvent_dissectors, hf_cba_opnum);
1554 dcerpc_init_uuid(proto_ICBAPersist, ett_ICBAPersist,
1555 &uuid_ICBAPersist, ver_ICBAPersist,
1556 ICBAPersist_dissectors, hf_cba_opnum);
1558 dcerpc_init_uuid(proto_ICBAPersist2, ett_ICBAPersist,
1559 &uuid_ICBAPersist2, ver_ICBAPersist2,
1560 ICBAPersist_dissectors, hf_cba_opnum);
1562 dcerpc_init_uuid(proto_ICBALogicalDevice, ett_ICBALogicalDevice,
1563 &uuid_ICBALogicalDevice, ver_ICBALogicalDevice,
1564 ICBALogicalDevice_dissectors, hf_cba_opnum);
1566 dcerpc_init_uuid(proto_ICBALogicalDevice2, ett_ICBALogicalDevice,
1567 &uuid_ICBALogicalDevice2, ver_ICBALogicalDevice2,
1568 ICBALogicalDevice_dissectors, hf_cba_opnum);
1570 dcerpc_init_uuid(proto_ICBAState, ett_ICBAState,
1571 &uuid_ICBAState, ver_ICBAState,
1572 ICBAState_dissectors, hf_cba_opnum);
1574 dcerpc_init_uuid(proto_ICBAStateEvent, ett_ICBAStateEvent,
1575 &uuid_ICBAStateEvent, ver_ICBAStateEvent,
1576 ICBAStateEvent_dissectors, hf_cba_opnum);
1578 dcerpc_init_uuid(proto_ICBATime, ett_ICBATime,
1579 &uuid_ICBATime, ver_ICBATime,
1580 ICBATime_dissectors, hf_cba_opnum);
1582 dcerpc_init_uuid(proto_ICBAGroupError, ett_ICBAGroupError,
1583 &uuid_ICBAGroupError, ver_ICBAGroupError,
1584 ICBAGroupError_dissectors, hf_cba_opnum);
1586 dcerpc_init_uuid(proto_ICBAGroupErrorEvent, ett_ICBAGroupErrorEvent,
1587 &uuid_ICBAGroupErrorEvent, ver_ICBAGroupErrorEvent,
1588 ICBAGroupErrorEvent_dissectors, hf_cba_opnum);
1590 dcerpc_init_uuid(proto_ICBARTAuto, ett_ICBARTAuto,
1591 &uuid_ICBARTAuto, ver_ICBARTAuto,
1592 ICBARTAuto_dissectors, hf_cba_opnum);
1594 dcerpc_init_uuid(proto_ICBARTAuto2, ett_ICBARTAuto,
1595 &uuid_ICBARTAuto2, ver_ICBARTAuto2,
1596 ICBARTAuto_dissectors, hf_cba_opnum);
1598 dcerpc_init_uuid(proto_ICBASystemProperties, ett_ICBASystemProperties,
1599 &uuid_ICBASystemProperties, ver_ICBASystemProperties,
1600 ICBASystemProperties_dissectors, hf_cba_opnum);