1 /* packet-dcom-cba-acco.c
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.
29 #ifdef HAVE_SYS_TYPES_H
30 #include <sys/types.h>
36 #include <epan/packet.h>
37 #include <epan/expert.h>
38 #include <epan/emem.h>
39 #include <epan/addr_resolv.h>
40 #include <epan/dissectors/packet-dcerpc.h>
41 #include <epan/dissectors/packet-dcom.h>
42 #include "packet-dcom-cba-acco.h"
44 static int hf_cba_acco_opnum = -1;
46 static int hf_cba_acco_ping_factor = -1;
48 static int hf_cba_acco_count = -1;
50 static int hf_cba_acco_item = -1;
51 static int hf_cba_acco_data = -1;
52 static int hf_cba_acco_qc = -1;
53 static int hf_cba_acco_time_stamp = -1;
55 static int hf_cba_acco_conn_qos_type = -1;
56 static int hf_cba_acco_conn_qos_value = -1;
57 static int hf_cba_acco_conn_state = -1;
58 static int hf_cba_acco_conn_cons_id = -1;
59 static int hf_cba_acco_conn_version = -1;
60 static int hf_cba_acco_conn_prov_id = -1;
61 static int hf_cba_acco_conn_provider = -1;
62 static int hf_cba_acco_conn_consumer = -1;
63 static int hf_cba_acco_conn_provider_item = -1;
64 static int hf_cba_acco_conn_consumer_item = -1;
65 static int hf_cba_acco_conn_substitute = -1;
66 static int hf_cba_acco_conn_epsilon = -1;
67 static int hf_cba_acco_conn_persist = -1;
69 static int hf_cba_acco_cb_length = -1;
70 static int hf_cba_acco_cb_conn_data = -1;
71 static int hf_cba_acco_cb_version = -1;
72 static int hf_cba_acco_cb_flags = -1;
73 static int hf_cba_acco_cb_count = -1;
74 static int hf_cba_acco_cb_item = -1;
75 static int hf_cba_acco_cb_item_hole = -1;
76 static int hf_cba_acco_cb_item_length = -1;
77 static int hf_cba_acco_cb_item_data = -1;
79 static int hf_cba_connect_in = -1;
80 static int hf_cba_disconnect_in = -1;
81 static int hf_cba_connectcr_in = -1;
82 static int hf_cba_disconnectcr_in = -1;
83 static int hf_cba_disconnectme_in = -1;
84 static int hf_cba_data_first_in = -1;
85 static int hf_cba_data_last_in = -1;
87 static int hf_cba_acco_server_pICBAAccoCallback = -1;
89 static int hf_cba_acco_server_first_connect = -1;
91 static int hf_cba_acco_serversrt_prov_mac = -1;
92 static int hf_cba_acco_serversrt_cons_mac = -1;
94 static int hf_cba_acco_serversrt_cr_id = -1;
95 static int hf_cba_acco_serversrt_cr_length = -1;
96 static int hf_cba_acco_serversrt_cr_flags = -1;
97 static int hf_cba_acco_serversrt_cr_flags_timestamped = -1;
98 static int hf_cba_acco_serversrt_cr_flags_reconfigure = -1;
99 static int hf_cba_acco_serversrt_record_length = -1;
100 static int hf_cba_acco_serversrt_action = -1;
101 static int hf_cba_acco_serversrt_last_connect = -1;
103 static int hf_cba_getprovconnout = -1;
105 static int hf_cba_type_desc_len = -1;
107 static int hf_cba_connectincr = -1;
108 static int hf_cba_connectoutcr = -1;
109 static int hf_cba_connectin = -1;
110 static int hf_cba_connectout = -1;
111 static int hf_cba_getconnectionout = -1;
112 static int hf_cba_readitemout = -1;
113 static int hf_cba_writeitemin = -1;
114 static int hf_cba_addconnectionin = -1;
115 static int hf_cba_addconnectionout = -1;
116 static int hf_cba_getidout = -1;
118 static int hf_cba_getconsconnout = -1;
119 static int hf_cba_diagconsconnout = -1;
120 static int hf_cba_acco_conn_error_state = -1;
122 static int hf_cba_acco_info_max = -1;
123 static int hf_cba_acco_info_curr = -1;
125 static int hf_cba_acco_cdb_cookie = -1;
127 static int hf_cba_acco_rtauto = -1;
129 static int hf_cba_acco_prov_crid = -1;
131 static int hf_cba_acco_diag_req = -1;
132 static int hf_cba_acco_diag_in_length = -1;
133 static int hf_cba_acco_diag_out_length = -1;
134 static int hf_cba_acco_diag_data = -1;
135 static int hf_cba_acco_dcom_call = -1;
136 static int hf_cba_acco_srt_call = -1;
138 gint ett_cba_connectincr = -1;
139 gint ett_cba_connectoutcr = -1;
140 gint ett_cba_connectin = -1;
141 gint ett_cba_connectout = -1;
142 gint ett_cba_getprovconnout = -1;
143 gint ett_cba_addconnectionin = -1;
144 gint ett_cba_addconnectionout = -1;
145 gint ett_cba_getidout = -1;
146 gint ett_cba_getconnectionout = -1;
147 gint ett_cba_readitemout = -1;
148 gint ett_cba_writeitemin = -1;
149 gint ett_cba_acco_serversrt_cr_flags = -1;
150 gint ett_cba_frame_info = -1;
151 gint ett_cba_conn_info = -1;
153 static int proto_ICBAAccoMgt = -1;
154 static gint ett_ICBAAccoMgt = -1;
155 static e_uuid_t uuid_ICBAAccoMgt = { 0xcba00041, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
156 static guint16 ver_ICBAAccoMgt = 0;
158 static int proto_ICBAAccoMgt2 = -1;
159 static e_uuid_t uuid_ICBAAccoMgt2 = { 0xcba00046, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
160 static guint16 ver_ICBAAccoMgt2 = 0;
162 static int proto_ICBAAccoCallback = -1;
163 static gint ett_ICBAAccoCallback = -1;
164 static gint ett_ICBAAccoCallback_Buffer = -1;
165 static gint ett_ICBAAccoCallback_Item = -1;
166 static e_uuid_t uuid_ICBAAccoCallback = { 0xcba00042, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
167 static guint16 ver_ICBAAccoCallback = 0;
169 static int proto_ICBAAccoCallback2 = -1;
170 static e_uuid_t uuid_ICBAAccoCallback2 = { 0xcba00047, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
171 static guint16 ver_ICBAAccoCallback2 = 0;
173 static int proto_ICBAAccoServer = -1;
174 static gint ett_ICBAAccoServer = -1;
175 static e_uuid_t uuid_ICBAAccoServer = { 0xcba00043, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
176 static guint16 ver_ICBAAccoServer = 0;
178 static int proto_ICBAAccoServer2 = -1;
179 static e_uuid_t uuid_ICBAAccoServer2 = { 0xcba00048, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
180 static guint16 ver_ICBAAccoServer2 = 0;
182 static int proto_ICBAAccoServerSRT = -1;
183 static gint ett_ICBAAccoServerSRT = -1;
184 static e_uuid_t uuid_ICBAAccoServerSRT = { 0xcba00045, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
185 static guint16 ver_ICBAAccoServerSRT = 0;
187 static int proto_ICBAAccoSync = -1;
188 static gint ett_ICBAAccoSync = -1;
189 static e_uuid_t uuid_ICBAAccoSync = { 0xcba00044, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
190 static guint16 ver_ICBAAccoSync = 0;
194 static const value_string cba_acco_qc_vals[] = {
195 { 0x1c, "BadOutOfService" },
196 { 0x44, "UncertainLastUsableValue" },
197 { 0x48, "UncertainSubstituteSet" },
198 { 0x50, "UncertainSensorNotAccurate" },
199 { 0x80, "GoodNonCascOk" },
204 static const value_string cba_qos_type_vals[] = {
206 { 0x01, "Acyclic seconds" }, /* obsolete */
207 { 0x02, "Acyclic status" },
208 { 0x03, "Acyclic HMI" },
209 { 0x20, "Constant" },
210 { 0x30, "Cyclic Real-Time" },
215 static const value_string cba_persist_vals[] = {
216 { 0x00, "Volatile" },
217 { 0x01, "PendingPersistent" },
218 { 0x02, "Persistent" },
223 static const value_string cba_acco_conn_state_vals[] = {
229 static const value_string cba_acco_serversrt_action_vals[] = {
230 { 0x00, "Activate" },
231 { 0x01, "Deactivate" },
236 static const value_string cba_acco_serversrt_last_connect_vals[] = {
237 { 0x00, "CR not complete" },
238 { 0x01, "CR complete" },
242 static const value_string cba_acco_diag_req_vals[] = {
243 { 0x0000, "Function directory" },
244 { 0x1000, "DevCat statistic" },
245 { 0x2000, "Reset statistic" },
246 { 0x3000, "Consumer Comm. Events" },
247 { 0x4000, "Provider Comm. Events" },
251 static const true_false_string cba_acco_call_flags = {
252 "Consumer calls Provider (TRUE)",
253 "Provider calls Consumer (FALSE)"
256 static const value_string cba_qos_type_short_vals[] = {
258 { 0x01, "DCOM(sec)" }, /* obsolete */
267 typedef struct cba_frame_s {
268 cba_ldev_t *consparent;
269 cba_ldev_t *provparent;
271 guint packet_connect;
272 guint packet_disconnect;
273 guint packet_disconnectme;
278 const guint8 consmac[6];
287 typedef struct cba_connection_s {
288 cba_ldev_t *consparentacco;
289 cba_ldev_t *provparentacco;
290 cba_frame_t *parentframe;
291 guint packet_connect;
292 guint packet_disconnect;
293 guint packet_disconnectme;
300 const gchar *provitem;
306 guint16 frame_offset;
310 typedef struct server_frame_call_s {
312 cba_frame_t **frames;
313 } server_frame_call_t;
316 typedef struct server_connect_call_s {
319 cba_connection_t **conns;
320 } server_connect_call_t;
322 typedef struct server_disconnectme_call_s {
325 } server_disconnectme_call_t;
330 /* as we are a plugin, we cannot get this from libwireshark! */
331 const true_false_string acco_flags_set_truth = { "Set", "Not set" };
335 cba_connection_dump(cba_connection_t *conn, const char *role)
337 if(conn->qostype != 0x30) {
338 g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Data#%5u-#%5u",
340 conn->packet_connect,
341 conn->consid, conn->provid, conn->provitem,
342 conn->typedesclen != 0 ? val_to_str(conn->typedesc[0], dcom_variant_type_vals, "Unknown (0x%08x)") : "-",
343 val_to_str(conn->qostype, cba_qos_type_short_vals, "0x%x"), conn->qosvalue,
344 conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"),
345 conn->packet_first, conn->packet_last);
347 g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Off:%u",
349 conn->packet_connect,
350 conn->consid, conn->provid, conn->provitem,
351 conn->typedesclen != 0 ? val_to_str(conn->typedesc[0], dcom_variant_type_vals, "Unknown (0x%08x)") : "-",
352 val_to_str(conn->qostype, cba_qos_type_short_vals, "0x%x"), conn->qosvalue,
353 conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"),
360 cba_object_dump(void)
373 for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) {
375 g_warning("PDev #%5u: %s IFs:%u", pdev->first_packet, ip_to_str(pdev->ip),
376 pdev->object ? g_list_length(pdev->object->interfaces) : 0);
378 for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) {
380 g_warning(" LDev#%5u: \"%s\" LDevIFs:%u AccoIFs:%u", ldev->first_packet, ldev->name,
381 ldev->ldev_object ? g_list_length(ldev->ldev_object->interfaces) : 0,
382 ldev->acco_object ? g_list_length(ldev->acco_object->interfaces) : 0);
383 for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
384 frame = frames->data;
385 g_warning(" ConsFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u",
386 frame->packet_connect, frame->conscrid, frame->provcrid, frame->length,
387 frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"),
388 frame->packet_first, frame->packet_last);
389 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
390 cba_connection_dump(conns->data, "ConsConn");
393 for(frames = ldev->provframes; frames != NULL; frames = g_list_next(frames)) {
394 frame = frames->data;
395 g_warning(" ProvFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u",
396 frame->packet_connect, frame->conscrid, frame->provcrid, frame->length,
397 frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"),
398 frame->packet_first, frame->packet_last);
399 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
400 cba_connection_dump(conns->data, "ProvConn");
403 for(conns = ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
404 cba_connection_dump(conns->data, "ConsConn");
406 for(conns = ldev->provconns; conns != NULL; conns = g_list_next(conns)) {
407 cba_connection_dump(conns->data, "ProvConn");
416 cba_pdev_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid)
419 dcom_interface_t *interf;
422 interf = dcom_interface_find(pinfo, ip, ipid);
424 pdev = interf->parent->private_data;
426 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "pdev_find: no pdev for IP:%s IPID:%s",
427 ip_to_str(ip), guids_resolve_uuid_to_str(ipid));
430 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "pdev_find: unknown interface of IP:%s IPID:%s",
431 ip_to_str(ip), guids_resolve_uuid_to_str(ipid));
440 cba_pdev_add(packet_info *pinfo, const guint8 *ip)
447 for(cba_iter = cba_pdevs; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
448 pdev = cba_iter->data;
449 if(memcmp(pdev->ip, ip, 4) == 0) {
454 /* not found, create a new */
455 pdev = se_alloc(sizeof(cba_pdev_t));
456 memcpy( (void *) (pdev->ip), ip, 4);
457 pdev->first_packet = pinfo->fd->num;
460 cba_pdevs = g_list_append(cba_pdevs, pdev);
467 cba_pdev_link(packet_info *pinfo _U_, cba_pdev_t *pdev, dcom_interface_t *pdev_interf)
470 /* "crosslink" pdev interface and it's object */
471 pdev->object = pdev_interf->parent;
472 pdev_interf->private_data = pdev;
473 if(pdev_interf->parent) {
474 pdev_interf->parent->private_data = pdev;
480 cba_ldev_link(packet_info *pinfo _U_, cba_ldev_t *ldev, dcom_interface_t *ldev_interf)
483 /* "crosslink" interface and it's object */
484 ldev->ldev_object = ldev_interf->parent;
485 ldev_interf->private_data = ldev;
486 if(ldev_interf->parent) {
487 ldev_interf->parent->private_data = ldev;
493 cba_ldev_link_acco(packet_info *pinfo _U_, cba_ldev_t *ldev, dcom_interface_t *acco_interf)
496 /* "crosslink" interface and it's object */
497 ldev->acco_object = acco_interf->parent;
498 acco_interf->private_data = ldev;
499 if(acco_interf->parent) {
500 acco_interf->parent->private_data = ldev;
506 cba_ldev_add(packet_info *pinfo, cba_pdev_t *pdev, const char *name)
513 for(cba_iter = pdev->ldevs; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
514 ldev = cba_iter->data;
515 if(strcmp(ldev->name, name) == 0) {
520 /* not found, create a new */
521 ldev = se_alloc(sizeof(cba_ldev_t));
522 ldev->name = se_strdup(name);
523 ldev->first_packet = pinfo->fd->num;
524 ldev->ldev_object = NULL;
525 ldev->acco_object = NULL;
528 ldev->provframes = NULL;
529 ldev->consframes = NULL;
530 ldev->provconns = NULL;
531 ldev->consconns = NULL;
533 pdev->ldevs = g_list_append(pdev->ldevs, ldev);
540 cba_ldev_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid) {
541 /*dcerpc_info *info = (dcerpc_info *)pinfo->private_data;*/
542 dcom_interface_t *interf;
546 interf = dcom_interface_find(pinfo, ip, ipid);
548 ldev = interf->private_data;
551 ldev = interf->parent->private_data;
554 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "Unknown LDev of %s",
558 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "Unknown IPID of %s",
568 cba_acco_add(packet_info *pinfo, const char *acco)
577 ip_str = g_strdup(acco);
578 delim = strchr(ip_str, '!');
585 if(!get_host_ipaddr(ip_str, &ip)) {
591 pdev = cba_pdev_add(pinfo, (guint8 *) &ip);
594 ldev = cba_ldev_add(pinfo, pdev, delim);
603 cba_packet_in_range(packet_info *pinfo, guint packet_connect, guint packet_disconnect, guint packet_disconnectme)
606 if(packet_connect == 0) {
607 g_warning("cba_packet_in_range#%u: packet_connect not set?", pinfo->fd->num);
610 if(packet_connect == 0 || pinfo->fd->num < packet_connect) {
613 if(packet_disconnect != 0 && pinfo->fd->num > packet_disconnect) {
616 if(packet_disconnectme != 0 && pinfo->fd->num > packet_disconnectme) {
625 cba_frame_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_frame_t *frame)
628 proto_item *sub_item;
629 proto_tree *sub_tree;
632 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "Cons:\"%s\" CCRID:0x%x Prov:\"%s\" PCRID:0x%x QoS:%s/%ums Len:%u",
633 frame->consparent ? frame->consparent->name : "", frame->conscrid,
634 frame->provparent ? frame->provparent->name : "", frame->provcrid,
635 val_to_str(frame->qostype, cba_qos_type_short_vals, "%u"), frame->qosvalue, frame->length);
636 sub_tree = proto_item_add_subtree(sub_item, ett_cba_frame_info);
637 PROTO_ITEM_SET_GENERATED(sub_item);
639 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type, tvb, 0, 0, frame->qostype);
640 PROTO_ITEM_SET_GENERATED(item);
641 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_value, tvb, 0, 0, frame->qosvalue);
642 PROTO_ITEM_SET_GENERATED(item);
643 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_cr_id, tvb, 0, 0, frame->conscrid);
644 PROTO_ITEM_SET_GENERATED(item);
645 item = proto_tree_add_uint(sub_tree, hf_cba_acco_prov_crid, tvb, 0, 0, frame->provcrid);
646 PROTO_ITEM_SET_GENERATED(item);
647 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_cr_length, tvb, 0, 0, frame->length);
648 PROTO_ITEM_SET_GENERATED(item);
650 if(frame->consparent != NULL) {
651 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_consumer, tvb, 0, 0, frame->consparent->name);
652 PROTO_ITEM_SET_GENERATED(item);
654 if(frame->provparent != NULL) {
655 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider, tvb, 0, 0, frame->provparent->name);
656 PROTO_ITEM_SET_GENERATED(item);
659 item = proto_tree_add_uint(sub_tree, hf_cba_connectcr_in,
660 tvb, 0, 0, frame->packet_connect);
661 PROTO_ITEM_SET_GENERATED(item);
662 item = proto_tree_add_uint(sub_tree, hf_cba_data_first_in,
663 tvb, 0, 0, frame->packet_first);
664 PROTO_ITEM_SET_GENERATED(item);
665 item = proto_tree_add_uint(sub_tree, hf_cba_data_last_in,
666 tvb, 0, 0, frame->packet_last);
667 PROTO_ITEM_SET_GENERATED(item);
668 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectcr_in,
669 tvb, 0, 0, frame->packet_disconnect);
670 PROTO_ITEM_SET_GENERATED(item);
671 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectme_in,
672 tvb, 0, 0, frame->packet_disconnectme);
673 PROTO_ITEM_SET_GENERATED(item);
679 cba_frame_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev,
680 guint16 qostype, guint16 qosvalue, const guint8 *consmac, guint16 conscrid, guint16 length)
686 for(cba_iter = cons_ldev->consframes; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
687 frame = cba_iter->data;
688 if( frame->conscrid == conscrid &&
689 memcmp(frame->consmac, consmac, 6) == 0 &&
690 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
695 frame = se_alloc(sizeof(cba_frame_t));
697 frame->consparent = cons_ldev;
698 frame->provparent = prov_ldev;
700 frame->packet_connect = pinfo->fd->num;
701 frame->packet_disconnect = 0;
702 frame->packet_disconnectme = 0;
703 frame->packet_first = 0;
704 frame->packet_last = 0;
706 frame->length = length;
707 memcpy( (guint8 *) (frame->consmac), consmac, sizeof(frame->consmac));
708 frame->conscrid = conscrid;
709 frame->qostype = qostype;
710 frame->qosvalue = qosvalue;
716 frame->conncrret = -1;
718 cons_ldev->consframes = g_list_append(cons_ldev->consframes, frame);
719 prov_ldev->provframes = g_list_append(prov_ldev->provframes, frame);
726 cba_frame_disconnect(packet_info *pinfo, cba_frame_t *frame)
729 if(frame->packet_disconnect == 0) {
730 frame->packet_disconnect = pinfo->fd->num;
733 if(frame->packet_disconnect != pinfo->fd->num) {
734 g_warning("cba_frame_disconnect#%u: frame already disconnected in #%u",
735 pinfo->fd->num, frame->packet_disconnect);
741 cba_frame_disconnectme(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev)
747 for(frames = cons_ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
748 frame = frames->data;
750 if( frame->provparent == prov_ldev &&
751 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
753 cba_frame_info(tvb, pinfo, tree, frame);
755 if(frame->packet_disconnectme == 0) {
756 frame->packet_disconnectme = pinfo->fd->num;
759 if(frame->packet_disconnectme != pinfo->fd->num) {
760 g_warning("cba_frame_disconnectme#%u: frame already disconnectme'd in #%u",
761 pinfo->fd->num, frame->packet_disconnectme);
769 cba_frame_find_by_cons(packet_info *pinfo, const guint8 *consmac, guint16 conscrid)
780 for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) {
784 for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) {
788 for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
789 frame = frames->data;
791 if( frame->conscrid == conscrid &&
792 memcmp(frame->consmac, consmac, 6) == 0 &&
793 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
805 cba_frame_find_by_provcrid(packet_info *pinfo, cba_ldev_t *prov_ldev, guint32 provcrid)
811 if(prov_ldev == NULL) {
815 for(frames = prov_ldev->provframes; frames != NULL; frames = g_list_next(frames)) {
816 frame = frames->data;
818 if( frame->provcrid == provcrid &&
819 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
824 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
825 "Unknown provider frame ProvCRID");
832 cba_frame_incoming_data(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_frame_t *frame)
834 if(frame->packet_first == 0) {
835 frame->packet_first = pinfo->fd->num;
838 if( pinfo->fd->num > frame->packet_last &&
839 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
840 frame->packet_last = pinfo->fd->num;
846 cba_connection_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_connection_t *conn)
849 proto_item *sub_item;
850 proto_tree *sub_tree;
853 if(conn->qostype != 0x30) {
854 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x QoS:%s/%ums",
855 conn->provitem, conn->provid, conn->consid,
856 val_to_str(conn->qostype, cba_qos_type_short_vals, "%u"), conn->qosvalue);
858 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x Len:%u",
859 conn->provitem, conn->provid, conn->consid, conn->length);
861 sub_tree = proto_item_add_subtree(sub_item, ett_cba_conn_info);
862 PROTO_ITEM_SET_GENERATED(sub_item);
864 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider_item, tvb, 0, 0 /* len */, conn->provitem);
865 PROTO_ITEM_SET_GENERATED(item);
866 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_prov_id, tvb, 0, 0 /* len */, conn->provid);
867 PROTO_ITEM_SET_GENERATED(item);
868 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_cons_id, tvb, 0, 0 /* len */, conn->consid);
869 PROTO_ITEM_SET_GENERATED(item);
870 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_record_length, tvb, 0, 0 /* len */, conn->length);
871 PROTO_ITEM_SET_GENERATED(item);
873 if(conn->qostype != 0x30) {
874 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type,
875 tvb, 0, 0, conn->qostype);
876 PROTO_ITEM_SET_GENERATED(item);
877 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_value,
878 tvb, 0, 0, conn->qosvalue);
879 PROTO_ITEM_SET_GENERATED(item);
880 item = proto_tree_add_uint(sub_tree, hf_cba_connect_in,
881 tvb, 0, 0, conn->packet_connect);
882 PROTO_ITEM_SET_GENERATED(item);
883 item = proto_tree_add_uint(sub_tree, hf_cba_data_first_in,
884 tvb, 0, 0, conn->packet_first);
885 PROTO_ITEM_SET_GENERATED(item);
886 item = proto_tree_add_uint(sub_tree, hf_cba_data_last_in,
887 tvb, 0, 0, conn->packet_last);
888 PROTO_ITEM_SET_GENERATED(item);
889 item = proto_tree_add_uint(sub_tree, hf_cba_disconnect_in,
890 tvb, 0, 0, conn->packet_disconnect);
891 PROTO_ITEM_SET_GENERATED(item);
892 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectme_in,
893 tvb, 0, 0, conn->packet_disconnectme);
894 PROTO_ITEM_SET_GENERATED(item);
900 static cba_connection_t *
901 cba_connection_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev, cba_frame_t *cons_frame,
902 guint16 qostype, guint16 qosvalue, const char *provitem, guint32 consid, guint16 length,
903 guint16 *typedesc, guint16 typedesclen)
906 cba_connection_t *conn;
909 /* find connection */
910 if(cons_frame != NULL) {
911 /* SRT: search in frame */
912 for(cba_iter = cons_frame->conns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
913 conn = cba_iter->data;
914 if(conn->consid == consid) {
919 /* DCOM: search in ldev */
920 for(cba_iter = cons_ldev->consconns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
921 conn = cba_iter->data;
922 if( conn->consid == consid &&
923 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
929 conn = se_alloc(sizeof(cba_connection_t));
931 conn->consparentacco = cons_ldev;
932 conn->provparentacco = prov_ldev;
933 conn->parentframe = cons_frame;
935 conn->packet_connect = pinfo->fd->num;
936 conn->packet_disconnect = 0;
937 conn->packet_disconnectme = 0;
938 conn->packet_first = 0;
939 conn->packet_last = 0;
941 conn->consid = consid;
942 conn->provitem = se_strdup(provitem);
943 conn->typedesclen = typedesclen;
944 conn->typedesc = typedesc;
945 conn->qostype = qostype;
946 conn->qosvalue = qosvalue;
947 conn->length = length;
952 if(cons_frame != NULL) {
953 conn->frame_offset = cons_frame->offset;
954 conn->length = length;
955 cons_frame->offset += length;
956 cons_frame->conns = g_list_append(cons_frame->conns, conn);
958 conn->frame_offset = 0;
959 cons_ldev->consconns = g_list_append(cons_ldev->consconns, conn);
960 prov_ldev->provconns = g_list_append(prov_ldev->provconns, conn);
968 cba_connection_disconnect(packet_info *pinfo, cba_connection_t *conn)
970 /* XXX - detect multiple disconnects? */
971 if(conn->packet_disconnect == 0) {
972 conn->packet_disconnect = pinfo->fd->num;
975 if(conn->packet_disconnect != pinfo->fd->num) {
976 g_warning("connection_disconnect#%u: already disconnected",
977 conn->packet_disconnect);
983 cba_connection_disconnectme(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev)
986 cba_connection_t *conn;
989 for(conns = cons_ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
992 if( conn->provparentacco == prov_ldev &&
993 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
995 cba_connection_info(tvb, pinfo, tree, conn);
997 if(conn->packet_disconnectme == 0) {
998 conn->packet_disconnectme = pinfo->fd->num;
1001 if(conn->packet_disconnectme != pinfo->fd->num) {
1002 g_warning("connection_disconnectme#%u: already disconnectme'd",
1003 conn->packet_disconnectme);
1010 static cba_connection_t *
1011 cba_connection_find_by_provid(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_ldev_t *prov_ldev, guint32 provid)
1014 cba_connection_t *conn;
1017 for(cba_iter = prov_ldev->provconns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
1018 conn = cba_iter->data;
1019 if( conn->provid == provid &&
1020 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
1029 cba_connection_incoming_data(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_connection_t *conn)
1031 if(conn->packet_first == 0) {
1032 conn->packet_first = pinfo->fd->num;
1035 if( pinfo->fd->num > conn->packet_last &&
1036 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
1037 conn->packet_last = pinfo->fd->num;
1042 /* dissect a response containing an array of hresults (e.g: ICBAAccoMgt::RemoveConnections) */
1044 dissect_HResultArray_resp(tvbuff_t *tvb, int offset,
1045 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1049 guint32 u32ArraySize = 0;
1054 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1056 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1060 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1064 u32Tmp = u32ArraySize;
1066 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1067 &u32HResult, u32Idx);
1072 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1075 if (check_col(pinfo->cinfo, COL_INFO)) {
1076 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1078 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1086 dissect_ICBAAccoServer_SetActivation_resp(tvbuff_t *tvb, int offset,
1087 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1091 guint32 u32ArraySize = 0;
1097 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1099 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1100 PROTO_ITEM_SET_GENERATED(item);
1101 pinfo->profinet_type = 1;
1103 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1107 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1111 u32Tmp = u32ArraySize;
1113 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1114 &u32HResult, u32Idx);
1119 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1122 if (check_col(pinfo->cinfo, COL_INFO)) {
1123 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1125 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1133 dissect_ICBAAccoServerSRT_Disconnect_resp(tvbuff_t *tvb, int offset,
1134 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1138 guint32 u32ArraySize = 0;
1144 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1146 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1147 PROTO_ITEM_SET_GENERATED(item);
1148 pinfo->profinet_type = 3;
1150 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1154 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1158 u32Tmp = u32ArraySize;
1160 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1161 &u32HResult, u32Idx);
1166 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1169 if (check_col(pinfo->cinfo, COL_INFO)) {
1170 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1172 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1180 dissect_ICBAAccoServerSRT_SetActivation_resp(tvbuff_t *tvb, int offset,
1181 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1185 guint32 u32ArraySize = 0;
1191 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1193 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1194 PROTO_ITEM_SET_GENERATED(item);
1195 pinfo->profinet_type = 3;
1197 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1201 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1205 u32Tmp = u32ArraySize;
1207 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1208 &u32HResult, u32Idx);
1213 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1216 if (check_col(pinfo->cinfo, COL_INFO)) {
1217 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1219 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1227 dissect_ICBAAccoServer_Connect_rqst(tvbuff_t *tvb, int offset,
1228 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1231 guint16 u16QoSValue;
1234 guint32 u32ArraySize;
1236 guint32 u32VariableOffset;
1237 proto_item *sub_item;
1238 proto_tree *sub_tree;
1239 guint32 u32SubStart;
1243 gchar szItem[1000] = { 0 };
1244 guint32 u32MaxItemLen = sizeof(szItem);
1245 gchar szCons[1000] = { 0 };
1246 guint32 u32MaxConsLen = sizeof(szCons);
1249 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1250 dcom_interface_t *cons_interf;
1251 cba_ldev_t *cons_ldev;
1252 cba_ldev_t *prov_ldev;
1253 cba_connection_t *conn;
1254 server_connect_call_t *call;
1257 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1259 /* get corresponding provider ldev */
1260 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1262 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1263 PROTO_ITEM_SET_GENERATED(item);
1264 pinfo->profinet_type = 2;
1266 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1267 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
1269 /* find the consumer ldev by it's name */
1270 cons_ldev = cba_acco_add(pinfo, szCons);
1272 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1273 hf_cba_acco_conn_qos_type, &u16QoSType);
1274 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1275 hf_cba_acco_conn_qos_value, &u16QoSValue);
1276 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
1277 hf_cba_acco_conn_state, &u8State);
1279 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
1280 if(cons_interf == NULL) {
1281 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1282 "Server_Connect: consumer interface invalid");
1285 /* "crosslink" consumer interface and it's object */
1286 if(cons_interf != NULL && cons_ldev != NULL) {
1287 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
1290 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1291 hf_cba_acco_count, &u32Count);
1293 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1296 /* link connections infos to the call */
1297 if(prov_ldev != NULL && cons_ldev != NULL) {
1298 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1299 call->conn_count = 0;
1301 call->conns = (cba_connection_t **) (call+1);
1302 info->call_data->private_data = call;
1307 u32VariableOffset = offset + u32ArraySize*16;
1309 /* array of CONNECTINs */
1311 while (u32ArraySize--) {
1312 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, FALSE);
1313 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
1314 u32SubStart = offset;
1317 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1320 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1321 hf_cba_acco_conn_provider_item, szItem, u32MaxItemLen);
1325 offset = dissect_dcom_VARTYPE(tvb, offset, pinfo, sub_tree, drep,
1329 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1332 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1333 hf_cba_acco_conn_epsilon);
1336 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1337 hf_cba_acco_conn_cons_id, &u32ConsID);
1339 /* add to object database */
1340 if(prov_ldev != NULL && cons_ldev != NULL) {
1341 conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL,
1342 u16QoSType, u16QoSValue, szItem, u32ConsID, 0,
1343 /* XXX - VarType must be translated to new type description if it includes an array (0x2000) */
1344 se_memdup(&u16VarType, 2), 1);
1346 cba_connection_info(tvb, pinfo, sub_tree, conn);
1351 /* add to current call */
1354 call->conns[u32Idx-1] = conn;
1357 /* update subtree header */
1358 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", VarType=%s",
1359 u32Idx, u32ConsID, szItem,
1360 val_to_str(u16VarType, dcom_variant_type_vals, "Unknown (0x%04x)") );
1361 proto_item_set_len(sub_item, offset - u32SubStart);
1366 if (check_col(pinfo->cinfo, COL_INFO)) {
1367 col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count);
1370 return u32VariableOffset;
1374 dissect_ICBAAccoServer2_Connect2_rqst(tvbuff_t *tvb, int offset,
1375 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1378 guint16 u16QoSValue;
1381 guint32 u32ArraySize;
1383 guint32 u32VariableOffset;
1384 proto_item *sub_item;
1385 proto_tree *sub_tree;
1386 guint32 u32SubStart;
1390 gchar szItem[1000] = { 0 };
1391 guint32 u32MaxItemLen = sizeof(szItem);
1392 gchar szCons[1000] = { 0 };
1393 guint32 u32MaxConsLen = sizeof(szCons);
1395 guint16 u16TypeDescLen;
1396 guint32 u32ArraySize2;
1398 guint16 u16VarType2 = -1;
1400 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1401 dcom_interface_t *cons_interf;
1402 cba_ldev_t *prov_ldev;
1403 cba_ldev_t *cons_ldev;
1404 cba_connection_t *conn;
1405 server_connect_call_t *call = NULL;
1406 guint16 typedesclen = 0;
1407 guint16 *typedesc = NULL;
1410 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1412 /* get corresponding provider ldev */
1413 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1415 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1416 PROTO_ITEM_SET_GENERATED(item);
1417 pinfo->profinet_type = 2;
1419 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1420 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
1422 /* find the consumer ldev by it's name */
1423 cons_ldev = cba_acco_add(pinfo, szCons);
1425 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1426 hf_cba_acco_conn_qos_type, &u16QoSType);
1427 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1428 hf_cba_acco_conn_qos_value, &u16QoSValue);
1429 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
1430 hf_cba_acco_conn_state, &u8State);
1432 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, &u32Pointer);
1435 offset = dissect_dcom_MInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
1436 if(cons_interf == NULL) {
1437 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1438 "Server2_Connect2: consumer interface invalid");
1441 /* GetConnectionData do it this way */
1445 /* "crosslink" consumer interface and it's object */
1446 if(cons_interf != NULL && cons_ldev != NULL) {
1447 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
1450 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1451 hf_cba_acco_count, &u32Count);
1453 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1456 /* link connection infos to the call */
1457 if(prov_ldev != NULL && cons_ldev != NULL) {
1458 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1459 call->conn_count = 0;
1461 call->conns = (cba_connection_t **) (call+1);
1462 info->call_data->private_data = call;
1467 u32VariableOffset = offset + u32ArraySize*20;
1469 /* array of CONNECTINs */
1471 while (u32ArraySize--) {
1472 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, FALSE);
1473 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
1474 u32SubStart = offset;
1477 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1480 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1481 hf_cba_acco_conn_provider_item, szItem, u32MaxItemLen);
1485 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
1486 hf_cba_type_desc_len, &u16TypeDescLen);
1488 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1492 u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1495 /* limit the allocation to a reasonable size */
1496 if(u32ArraySize2 < 1000) {
1497 typedesc = se_alloc0(u32ArraySize2 * 2);
1498 typedesclen = u32ArraySize2;
1504 /* extended type description will build an array here */
1506 while (u32ArraySize2--) {
1507 /* ToBeDone: some of the type description values are counts */
1508 u32VariableOffset = dissect_dcom_VARTYPE(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1511 if(typedesc != NULL && u32Idx2 <= typedesclen) {
1512 typedesc[u32Idx2-1] = u16VarType;
1515 /* remember first VarType only */
1517 u16VarType2 = u16VarType;
1524 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1527 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1528 hf_cba_acco_conn_epsilon);
1531 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1532 hf_cba_acco_conn_cons_id, &u32ConsID);
1534 /* add to object database */
1535 if(prov_ldev != NULL && cons_ldev != NULL) {
1536 conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL,
1537 u16QoSType, u16QoSValue, szItem, u32ConsID, 0,
1538 typedesc, typedesclen);
1540 cba_connection_info(tvb, pinfo, sub_tree, conn);
1545 /* add to current call */
1548 call->conns[u32Idx-1] = conn;
1551 /* update subtree header */
1552 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", TypeDesc=%s",
1553 u32Idx, u32ConsID, szItem,
1554 val_to_str(u16VarType2, dcom_variant_type_vals, "Unknown (0x%04x)") );
1555 proto_item_set_len(sub_item, offset - u32SubStart);
1560 if (check_col(pinfo->cinfo, COL_INFO)) {
1561 col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count);
1564 return u32VariableOffset;
1569 dissect_ICBAAccoServer_Connect_resp(tvbuff_t *tvb, int offset,
1570 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1572 guint8 u8FirstConnect;
1574 guint32 u32ArraySize = 0;
1578 proto_item *sub_item;
1579 proto_tree *sub_tree;
1580 guint32 u32SubStart;
1582 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1583 server_connect_call_t *call = info->call_data->private_data;
1584 cba_connection_t *conn;
1587 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1590 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1591 "No request info, response data ignored");
1594 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1595 PROTO_ITEM_SET_GENERATED(item);
1596 pinfo->profinet_type = 1;
1598 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
1599 hf_cba_acco_server_first_connect, &u8FirstConnect);
1601 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1605 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1608 /* array of CONNECTOUTs */
1609 while(u32ArraySize--) {
1610 sub_item = proto_tree_add_item(tree, hf_cba_connectout, tvb, offset, 8, FALSE);
1611 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectout);
1612 u32SubStart = offset;
1614 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1615 hf_cba_acco_conn_prov_id, &u32ProvID);
1617 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
1618 &u32HResult, u32Idx);
1620 /* put response data into the connection */
1621 if(call && u32Idx <= call->conn_count) {
1622 conn = call->conns[u32Idx-1];
1623 conn->provid = u32ProvID;
1624 conn->connret = u32HResult;
1626 cba_connection_info(tvb, pinfo, sub_tree, conn);
1629 proto_item_append_text(sub_item, "[%u]: ProvID=0x%x %s",
1631 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1632 proto_item_set_len(sub_item, offset - u32SubStart);
1638 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1641 /* this might be a global HRESULT */
1642 while(call && u32Idx <= call->conn_count) {
1643 conn = call->conns[u32Idx-1];
1645 conn->connret = u32HResult;
1649 if (check_col(pinfo->cinfo, COL_INFO)) {
1650 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u -> %s",
1651 (u8FirstConnect) ? "First" : "NotFirst",
1653 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1661 dissect_ICBAAccoServer_Disconnect_rqst(tvbuff_t *tvb, int offset,
1662 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1665 guint32 u32ArraySize;
1669 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1670 cba_ldev_t *prov_ldev;
1671 cba_connection_t *conn;
1672 server_connect_call_t *call;
1675 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1677 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1678 PROTO_ITEM_SET_GENERATED(item);
1679 pinfo->profinet_type = 2;
1681 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1682 hf_cba_acco_count, &u32Count);
1684 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1687 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1689 /* link connection infos to the call */
1690 if(prov_ldev != NULL) {
1691 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1692 call->conn_count = 0;
1694 call->conns = (cba_connection_t **) (call+1);
1695 info->call_data->private_data = call;
1701 while (u32ArraySize--) {
1702 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
1703 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
1705 /* add to current call */
1707 conn = cba_connection_find_by_provid(tvb, pinfo, tree, prov_ldev, u32ProvID);
1709 call->conns[u32Idx-1] = conn;
1715 /* update column info now */
1716 if (check_col(pinfo->cinfo, COL_INFO)) {
1717 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
1725 dissect_ICBAAccoServer_Disconnect_resp(tvbuff_t *tvb, int offset,
1726 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1730 guint32 u32ArraySize = 0;
1734 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1735 server_connect_call_t *call = info->call_data->private_data;
1736 cba_connection_t *conn;
1739 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1742 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1743 "No request info, response data ignored");
1746 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1747 PROTO_ITEM_SET_GENERATED(item);
1748 pinfo->profinet_type = 1;
1750 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1754 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1758 u32Tmp = u32ArraySize;
1760 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1761 &u32HResult, u32Idx);
1763 /* mark this connection as disconnected */
1764 if(call && u32Idx <= call->conn_count) {
1765 conn = call->conns[u32Idx-1];
1767 cba_connection_disconnect(pinfo, conn);
1775 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1778 if (check_col(pinfo->cinfo, COL_INFO)) {
1779 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1781 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1789 dissect_ICBAAccoServerSRT_Disconnect_rqst(tvbuff_t *tvb, int offset,
1790 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1793 guint32 u32ArraySize;
1799 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1801 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
1802 PROTO_ITEM_SET_GENERATED(item);
1803 pinfo->profinet_type = 4;
1805 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1806 hf_cba_acco_count, &u32Count);
1808 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1812 while (u32ArraySize--) {
1813 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
1814 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
1818 /* update column info now */
1819 if (check_col(pinfo->cinfo, COL_INFO)) {
1820 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
1828 dissect_ICBAAccoServer_DisconnectMe_rqst(tvbuff_t *tvb, int offset,
1829 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1832 guint32 u32MaxStr = sizeof(szStr);
1834 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1835 cba_ldev_t *prov_ldev;
1836 cba_ldev_t *cons_ldev;
1837 server_disconnectme_call_t *call;
1840 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1842 /* get corresponding provider ldev */
1843 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1845 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1846 PROTO_ITEM_SET_GENERATED(item);
1847 pinfo->profinet_type = 2;
1849 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1850 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
1852 /* find the consumer ldev by it's name */
1853 cons_ldev = cba_acco_add(pinfo, szStr);
1855 if(prov_ldev != NULL && cons_ldev != NULL) {
1856 call = se_alloc(sizeof(server_disconnectme_call_t));
1857 call->cons = cons_ldev;
1858 call->prov = prov_ldev;
1859 info->call_data->private_data = call;
1862 /* update column info now */
1863 if (check_col(pinfo->cinfo, COL_INFO)) {
1864 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
1872 dissect_ICBAAccoServer_DisconnectMe_resp(tvbuff_t *tvb, int offset,
1873 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1877 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1878 server_disconnectme_call_t *call;
1881 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1883 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1884 PROTO_ITEM_SET_GENERATED(item);
1885 pinfo->profinet_type = 1;
1887 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1890 call = info->call_data->private_data;
1892 cba_connection_disconnectme(tvb, pinfo, tree, call->cons, call->prov);
1895 if (check_col(pinfo->cinfo, COL_INFO)) {
1896 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1897 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1905 dissect_ICBAAccoServerSRT_DisconnectMe_rqst(tvbuff_t *tvb, int offset,
1906 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1909 guint32 u32MaxStr = sizeof(szStr);
1911 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1912 cba_ldev_t *prov_ldev;
1913 cba_ldev_t *cons_ldev;
1914 server_disconnectme_call_t *call;
1917 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1919 /* get corresponding provider ldev */
1920 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1922 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
1923 PROTO_ITEM_SET_GENERATED(item);
1924 pinfo->profinet_type = 4;
1926 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1927 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
1929 /* find the consumer ldev by it's name */
1930 cons_ldev = cba_acco_add(pinfo, szStr);
1932 if(prov_ldev != NULL && cons_ldev != NULL) {
1933 call = se_alloc(sizeof(server_disconnectme_call_t));
1934 call->cons = cons_ldev;
1935 call->prov = prov_ldev;
1936 info->call_data->private_data = call;
1939 /* update column info now */
1940 if (check_col(pinfo->cinfo, COL_INFO)) {
1941 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
1949 dissect_ICBAAccoServerSRT_DisconnectMe_resp(tvbuff_t *tvb, int offset,
1950 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1954 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1955 server_disconnectme_call_t *call;
1958 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1960 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1961 PROTO_ITEM_SET_GENERATED(item);
1962 pinfo->profinet_type = 3;
1964 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1967 call = info->call_data->private_data;
1969 cba_frame_disconnectme(tvb, pinfo, tree, call->cons, call->prov);
1972 if (check_col(pinfo->cinfo, COL_INFO)) {
1973 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1974 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1982 dissect_ICBAAccoServer_Ping_resp(tvbuff_t *tvb, int offset,
1983 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1989 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1991 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1992 PROTO_ITEM_SET_GENERATED(item);
1993 pinfo->profinet_type = 1;
1995 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1998 if (check_col(pinfo->cinfo, COL_INFO)) {
1999 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2000 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2008 dissect_ICBAAccoServer_SetActivation_rqst(tvbuff_t *tvb, int offset,
2009 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2013 guint32 u32ArraySize;
2019 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2021 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
2022 PROTO_ITEM_SET_GENERATED(item);
2023 pinfo->profinet_type = 2;
2025 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2026 hf_cba_acco_conn_state, &u8State);
2028 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2029 hf_cba_acco_count, &u32Count);
2031 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2035 while (u32ArraySize--) {
2036 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2037 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2041 /* update column info now */
2042 if (check_col(pinfo->cinfo, COL_INFO)) {
2043 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2051 dissect_ICBAAccoServerSRT_SetActivation_rqst(tvbuff_t *tvb, int offset,
2052 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2056 guint32 u32ArraySize;
2062 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2064 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2065 PROTO_ITEM_SET_GENERATED(item);
2066 pinfo->profinet_type = 4;
2068 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2069 hf_cba_acco_conn_state, &u8State);
2071 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2072 hf_cba_acco_count, &u32Count);
2074 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2078 while (u32ArraySize--) {
2079 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2080 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2084 /* update column info now */
2085 if (check_col(pinfo->cinfo, COL_INFO)) {
2086 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2094 dissect_ICBAAccoServer_Ping_rqst(tvbuff_t *tvb, int offset,
2095 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2098 guint32 u32MaxStr = sizeof(szStr);
2102 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2104 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
2105 PROTO_ITEM_SET_GENERATED(item);
2106 pinfo->profinet_type = 2;
2108 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
2109 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
2111 /* update column info now */
2112 if (check_col(pinfo->cinfo, COL_INFO)) {
2113 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
2121 dissect_ICBAAccoServerSRT_ConnectCR_rqst(tvbuff_t *tvb, int offset,
2122 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2124 gchar szCons[1000] = { 0 };
2125 guint32 u32MaxConsLen = sizeof(szCons);
2127 guint16 u16QoSValue;
2128 guint8 u8ConsMac[6];
2130 guint16 u16CRLength;
2133 guint32 u32ArraySize;
2135 proto_item *item = NULL;
2136 proto_tree *flags_tree = NULL;
2137 proto_item *sub_item;
2138 proto_tree *sub_tree;
2139 guint32 u32SubStart;
2140 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2141 dcom_interface_t *cons_interf;
2142 cba_ldev_t *prov_ldev;
2143 cba_ldev_t *cons_ldev;
2145 server_frame_call_t *call;
2148 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2150 /* get corresponding provider ldev */
2151 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2153 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2154 PROTO_ITEM_SET_GENERATED(item);
2155 pinfo->profinet_type = 4;
2158 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
2159 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
2161 /* find the consumer ldev by it's name */
2162 cons_ldev = cba_acco_add(pinfo, szCons);
2164 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
2165 hf_cba_acco_conn_qos_type, &u16QoSType);
2166 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
2167 hf_cba_acco_conn_qos_value, &u16QoSValue);
2169 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
2170 if(cons_interf == NULL) {
2171 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2172 "ServerSRT_ConnectCR: consumer interface invalid");
2175 /* "crosslink" consumer interface and it's object */
2176 if(cons_interf != NULL && cons_ldev != NULL) {
2177 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
2180 /* ConsumerMAC (big-endian, 1byte-aligned) */
2181 tvb_memcpy(tvb, u8ConsMac, offset, 6);
2183 proto_tree_add_ether(tree, hf_cba_acco_serversrt_cons_mac, tvb,
2184 offset, 6, u8ConsMac);
2187 /* add flags subtree */
2188 offset = dissect_dcom_DWORD(tvb, offset, pinfo, NULL /*tree*/, drep,
2189 0 /* hfindex */, &u32Flags);
2191 item = proto_tree_add_uint_format_value(tree, hf_cba_acco_serversrt_cr_flags,
2192 tvb, offset, 4, u32Flags,
2193 "0x%02x (%s, %s)", u32Flags,
2194 (u32Flags & 0x2) ? "Reconfigure" : "not Reconfigure",
2195 (u32Flags & 0x1) ? "Timestamped" : "not Timestamped");
2196 flags_tree = proto_item_add_subtree(item, ett_cba_acco_serversrt_cr_flags);
2197 proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_reconfigure, tvb, offset, 4, u32Flags);
2198 proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_timestamped, tvb, offset, 4, u32Flags);
2201 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2202 hf_cba_acco_count, &u32Count);
2204 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2207 /* link frame infos to the call */
2208 if(prov_ldev != NULL && cons_ldev != NULL && u32ArraySize < 100) {
2209 call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *));
2210 call->frame_count = 0;
2211 call->frames = (cba_frame_t **) (call+1);
2212 info->call_data->private_data = call;
2218 while (u32ArraySize--) {
2219 /* array of CONNECTINCRs */
2220 sub_item = proto_tree_add_item(tree, hf_cba_connectincr, tvb, offset, 0, FALSE);
2221 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectincr);
2222 u32SubStart = offset;
2224 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2225 hf_cba_acco_serversrt_cr_id, &u16CRID);
2227 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2228 hf_cba_acco_serversrt_cr_length, &u16CRLength);
2230 /* add to object database */
2231 if(prov_ldev != NULL && cons_ldev != NULL) {
2232 frame = cba_frame_connect(pinfo, cons_ldev, prov_ldev, u16QoSType, u16QoSValue, u8ConsMac, u16CRID, u16CRLength);
2234 cba_frame_info(tvb, pinfo, sub_tree, frame);
2239 /* add to current call */
2241 call->frame_count++;
2242 call->frames[u32Idx-1] = frame;
2245 /* update subtree header */
2246 proto_item_append_text(sub_item, "[%u]: CRID=0x%x, CRLength=%u",
2247 u32Idx, u16CRID, u16CRLength);
2248 proto_item_set_len(sub_item, offset - u32SubStart);
2254 /* update column info now */
2255 if (check_col(pinfo->cinfo, COL_INFO)) {
2256 col_append_fstr(pinfo->cinfo, COL_INFO, ": %sConsCRID=0x%x Len=%u QoS=%u",
2257 (u32Flags & 0x2) ? "Reco " : "", u16CRID, u16CRLength, u16QoSValue);
2265 dissect_ICBAAccoServerSRT_ConnectCR_resp(tvbuff_t *tvb, int offset,
2266 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2268 guint8 u8FirstConnect;
2269 guint8 u8ProvMac[6];
2270 guint32 u32ProvCRID = 0;
2272 guint32 u32ArraySize;
2275 proto_item *sub_item;
2276 proto_tree *sub_tree;
2277 guint32 u32SubStart;
2279 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2280 server_frame_call_t *call = info->call_data->private_data;
2284 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2287 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2288 "No request info, response data ignored");
2291 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2292 PROTO_ITEM_SET_GENERATED(item);
2293 pinfo->profinet_type = 3;
2295 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2296 hf_cba_acco_server_first_connect, &u8FirstConnect);
2298 /* ProviderMAC (big-endian, 1byte-aligned) */
2299 tvb_memcpy(tvb, u8ProvMac, offset, 6);
2301 proto_tree_add_ether(tree, hf_cba_acco_serversrt_prov_mac, tvb,
2302 offset, 6, u8ProvMac);
2306 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2310 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2313 while (u32ArraySize--) {
2314 /* array of CONNECTOUTCRs */
2315 sub_item = proto_tree_add_item(tree, hf_cba_connectoutcr, tvb, offset, 0, FALSE);
2316 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectoutcr);
2317 u32SubStart = offset;
2319 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2320 hf_cba_acco_prov_crid, &u32ProvCRID);
2322 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2325 /* put response data into the frame */
2326 if(call && u32Idx <= call->frame_count) {
2327 frame = call->frames[u32Idx-1];
2328 frame->provcrid = u32ProvCRID;
2329 frame->conncrret = u32HResult;
2331 cba_frame_info(tvb, pinfo, sub_tree, frame);
2334 /* update subtree header */
2335 proto_item_append_text(sub_item, "[%u]: ProvCRID=0x%x, %s",
2336 u32Idx, u32ProvCRID,
2337 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2338 proto_item_set_len(sub_item, offset - u32SubStart);
2344 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2347 /* this might be a global HRESULT */
2348 while(call && u32Idx <= call->frame_count) {
2349 frame = call->frames[u32Idx-1];
2350 frame->provcrid = 0;
2351 frame->conncrret = u32HResult;
2355 if (check_col(pinfo->cinfo, COL_INFO)) {
2356 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s PCRID=0x%x -> %s",
2357 (u8FirstConnect) ? "FirstCR" : "NotFirstCR",
2359 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2367 dissect_ICBAAccoServerSRT_DisconnectCR_rqst(tvbuff_t *tvb, int offset,
2368 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2371 guint32 u32ArraySize;
2373 guint32 u32ProvCRID;
2375 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2376 cba_ldev_t *prov_ldev;
2378 server_frame_call_t *call;
2381 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2383 /* get corresponding provider ldev */
2384 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2386 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2387 PROTO_ITEM_SET_GENERATED(item);
2388 pinfo->profinet_type = 4;
2390 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2391 hf_cba_acco_count, &u32Count);
2393 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2396 /* link frame infos to the call */
2397 if(prov_ldev != NULL) {
2398 call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *));
2399 call->frame_count = 0;
2400 call->frames = (cba_frame_t **) (call+1);
2401 info->call_data->private_data = call;
2407 while (u32ArraySize--) {
2408 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2409 hf_cba_acco_prov_crid, &u32ProvCRID, u32Idx);
2411 /* find frame and add it to current call */
2413 frame = cba_frame_find_by_provcrid(pinfo, prov_ldev, u32ProvCRID);
2414 call->frame_count++;
2415 call->frames[u32Idx-1] = frame;
2421 /* update column info now */
2422 if (check_col(pinfo->cinfo, COL_INFO)) {
2423 col_append_fstr(pinfo->cinfo, COL_INFO, ": PCRID=0x%x",
2432 dissect_ICBAAccoServerSRT_DisconnectCR_resp(tvbuff_t *tvb, int offset,
2433 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2437 guint32 u32ArraySize = 0;
2441 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2442 server_frame_call_t *call = info->call_data->private_data;
2446 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2448 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2449 PROTO_ITEM_SET_GENERATED(item);
2450 pinfo->profinet_type = 3;
2452 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2456 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2460 u32Tmp = u32ArraySize;
2462 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
2463 &u32HResult, u32Idx);
2464 /* put response data into the frame */
2465 if(call && u32Idx <= call->frame_count) {
2466 frame = call->frames[u32Idx-1];
2468 cba_frame_disconnect(pinfo, frame);
2476 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2479 if (check_col(pinfo->cinfo, COL_INFO)) {
2480 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2481 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2489 dissect_ICBAAccoServerSRT_Connect_rqst(tvbuff_t *tvb, int offset,
2490 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2492 guint32 u32ProvCRID;
2494 guint8 u8LastConnect;
2496 guint32 u32ArraySize;
2497 guint32 u32VariableOffset;
2499 proto_item *sub_item;
2500 proto_tree *sub_tree;
2501 guint32 u32SubStart;
2503 gchar szProvItem[1000] = { 0 };
2504 guint32 u32MaxProvItemLen = sizeof(szProvItem);
2505 guint16 u16TypeDescLen;
2506 guint32 u32ArraySize2;
2508 guint16 u16VarType2 = -1;
2511 guint16 u16RecordLength;
2513 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2514 cba_ldev_t *prov_ldev;
2515 cba_frame_t *frame = NULL;
2516 cba_connection_t *conn;
2517 guint16 typedesclen = 0;
2518 guint16 *typedesc = NULL;
2519 server_connect_call_t *call;
2522 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2524 /* get corresponding provider ldev */
2525 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2527 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2528 PROTO_ITEM_SET_GENERATED(item);
2529 pinfo->profinet_type = 4;
2531 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2532 hf_cba_acco_prov_crid, &u32ProvCRID);
2534 frame = cba_frame_find_by_provcrid(pinfo, prov_ldev, u32ProvCRID);
2537 cba_frame_info(tvb, pinfo, tree, frame);
2540 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
2541 hf_cba_acco_conn_state, &u8State);
2543 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
2544 hf_cba_acco_serversrt_last_connect, &u8LastConnect);
2547 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2548 hf_cba_acco_count, &u32Count);
2550 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2553 /* link connections infos to the call */
2555 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
2556 call->conn_count = 0;
2557 call->frame = frame;
2558 call->conns = (cba_connection_t **) (call+1);
2559 info->call_data->private_data = call;
2564 u32VariableOffset = offset + u32ArraySize*20;
2567 while (u32ArraySize--) {
2568 /* array of CONNECTINs */
2569 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, FALSE);
2570 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
2571 u32SubStart = offset;
2574 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2577 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2578 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
2582 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2583 hf_cba_type_desc_len, &u16TypeDescLen);
2585 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2589 u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2592 typedesc = se_alloc0(u32ArraySize2 * 2);
2593 typedesclen = u32ArraySize2;
2595 /* extended type description will build an array here */
2597 while (u32ArraySize2--) {
2598 /* ToBeDone: some of the type description values are counts */
2599 u32VariableOffset = dissect_dcom_VARTYPE(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2602 if(u32Idx2 <= typedesclen) {
2603 typedesc[u32Idx2-1] = u16VarType;
2606 /* remember first VarType only */
2608 u16VarType2 = u16VarType;
2615 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2616 hf_cba_acco_conn_cons_id, &u32ConsID);
2619 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2620 hf_cba_acco_serversrt_record_length, &u16RecordLength);
2622 /* add to object database */
2624 conn = cba_connection_connect(pinfo, frame->consparent, frame->provparent, frame,
2625 frame->qostype, frame->qosvalue, szProvItem, u32ConsID, u16RecordLength,
2626 typedesc, typedesclen);
2628 cba_connection_info(tvb, pinfo, sub_tree, conn);
2633 /* add to current call */
2636 call->conns[u32Idx-1] = conn;
2639 /* update subtree header */
2640 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", TypeDesc=%s",
2641 u32Idx, u32ConsID, szProvItem,
2642 val_to_str(u16VarType2, dcom_variant_type_vals, "Unknown (0x%04x)") );
2643 proto_item_set_len(sub_item, offset - u32SubStart);
2649 /* update column info now */
2650 if (check_col(pinfo->cinfo, COL_INFO)) {
2651 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u PCRID=0x%x",
2652 (u8LastConnect) ? "LastOfCR" : "",
2657 return u32VariableOffset;
2662 dissect_ICBAAccoServerSRT_Connect_resp(tvbuff_t *tvb, int offset,
2663 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2666 guint32 u32ArraySize;
2668 proto_item *sub_item;
2669 proto_tree *sub_tree;
2670 guint32 u32SubStart;
2674 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2675 server_connect_call_t *call = info->call_data->private_data;
2676 cba_connection_t *conn;
2679 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2682 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2683 "No request info, response data ignored");
2686 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2687 PROTO_ITEM_SET_GENERATED(item);
2688 pinfo->profinet_type = 3;
2690 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2693 if(call && call->frame != NULL) {
2694 cba_frame_info(tvb, pinfo, tree, call->frame);
2698 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2701 /* array of CONNECTOUTs */
2702 while(u32ArraySize--) {
2703 sub_item = proto_tree_add_item(tree, hf_cba_connectout, tvb, offset, 8, FALSE);
2704 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectout);
2705 u32SubStart = offset;
2707 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2708 hf_cba_acco_conn_prov_id, &u32ProvID);
2710 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2711 &u32HResult, u32Idx);
2713 /* put response data into the frame */
2714 if(call && u32Idx <= call->conn_count) {
2715 conn = call->conns[u32Idx-1];
2716 conn->provid = u32ProvID;
2717 conn->connret = u32HResult;
2719 cba_connection_info(tvb, pinfo, sub_tree, conn);
2722 proto_item_append_text(sub_item, "[%u]: ProvID=0x%x %s",
2724 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2725 proto_item_set_len(sub_item, offset - u32SubStart);
2731 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2734 /* this might be a global HRESULT */
2735 while(call && u32Idx <= call->conn_count) {
2736 conn = call->conns[u32Idx-1];
2738 conn->connret = u32HResult;
2742 if (check_col(pinfo->cinfo, COL_INFO)) {
2743 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
2745 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2753 dissect_Server_GetProvIDs_resp(tvbuff_t *tvb, int offset,
2754 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2758 guint32 u32ArraySize;
2764 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2766 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2767 hf_cba_acco_count, &u32Count);
2769 if (check_col(pinfo->cinfo, COL_INFO)) {
2771 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ProvID=", u32Count);
2773 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2777 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2780 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2784 while (u32ArraySize--) {
2785 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo,
2787 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2789 if (check_col(pinfo->cinfo, COL_INFO)) {
2791 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ProvID);
2792 } else if (u32Idx < 10) {
2793 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ProvID);
2794 } else if (u32Idx == 10) {
2795 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
2803 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2806 if (check_col(pinfo->cinfo, COL_INFO)) {
2807 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2808 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2816 dissect_Server_GetProvConnections_rqst(tvbuff_t *tvb, int offset,
2817 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2820 guint32 u32ArraySize;
2825 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2827 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2828 hf_cba_acco_count, &u32Count);
2830 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2834 while (u32ArraySize--) {
2835 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2836 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2840 /* update column info now */
2841 if (check_col(pinfo->cinfo, COL_INFO)) {
2842 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2850 dissect_Server_GetProvConnections_resp(tvbuff_t *tvb, int offset,
2851 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2854 guint32 u32TmpCount;
2856 guint32 u32VariableOffset;
2858 proto_item *sub_item;
2859 proto_tree *sub_tree;
2860 guint32 u32SubStart;
2861 gchar szCons[1000] = { 0 };
2862 guint32 u32MaxConsLen = sizeof(szCons);
2863 gchar szProvItem[1000] = { 0 };
2864 guint32 u32MaxProvItemLen = sizeof(szProvItem);
2867 guint16 u16QoSValue;
2872 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2874 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2877 u32VariableOffset = offset;
2880 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2881 hf_cba_acco_count, &u32Count);
2883 u32VariableOffset = offset + u32Count*28;
2885 /* array fixed part (including pointers to variable part) */
2886 u32TmpCount = u32Count;
2888 while (u32TmpCount--) {
2889 sub_item = proto_tree_add_item(tree, hf_cba_getprovconnout, tvb, offset, 0, FALSE);
2890 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getprovconnout);
2891 u32SubStart = offset;
2894 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2897 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2898 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
2900 /* wszProviderItem */
2901 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2904 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2905 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
2908 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2909 hf_cba_acco_conn_cons_id, &u32ConsID);
2912 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2915 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2916 hf_cba_acco_conn_epsilon);
2920 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2921 hf_cba_acco_conn_qos_type, &u16QoSType);
2923 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2924 hf_cba_acco_conn_qos_value, &u16QoSValue);
2926 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
2927 hf_cba_acco_conn_state, &u8State);
2929 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2930 &u32HResult, u32Idx);
2932 proto_item_append_text(sub_item, "[%u]: %s",
2934 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2935 proto_item_set_len(sub_item, offset - u32SubStart);
2941 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
2944 if (check_col(pinfo->cinfo, COL_INFO)) {
2945 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2946 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2949 return u32VariableOffset;
2953 #define CBA_MRSH_VERSION_DCOM 0x1
2954 #define CBA_MRSH_VERSION_SRT_WITH_CONSID 0x10
2955 #define CBA_MRSH_VERSION_SRT_WITHOUT_CONSID 0x11
2959 dissect_CBA_Connection_Data(tvbuff_t *tvb,
2960 packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_frame_t *frame)
2964 guint16 u16CountFix;
2968 proto_item *sub_item;
2969 proto_tree *sub_tree;
2970 proto_item *conn_data_item = NULL;
2971 proto_tree *conn_data_tree = NULL;
2972 proto_item *item = NULL;
2980 gboolean qc_reported = FALSE;
2982 int qc_uncertain = 0;
2985 cba_connection_t *conn;
2989 /*** ALL data in this buffer is NOT aligned and always little endian ordered ***/
2992 conn_data_item = proto_tree_add_item(tree, hf_cba_acco_cb_conn_data, tvb, offset, 0, FALSE);
2993 conn_data_tree = proto_item_add_subtree(conn_data_item, ett_ICBAAccoCallback_Buffer);
2996 /* add buffer header */
2997 u8Version = tvb_get_guint8 (tvb, offset);
2998 if (conn_data_tree) {
2999 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_version, tvb, offset, 1, TRUE);
3003 u8Flags = tvb_get_guint8 (tvb, offset);
3004 if (conn_data_tree) {
3005 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_flags, tvb, offset, 1, TRUE);
3009 u16Count = tvb_get_letohs (tvb, offset);
3010 if (conn_data_tree) {
3011 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_count, tvb, offset, 2, TRUE);
3014 u16CountFix = u16Count;
3016 /* show meta information */
3018 cba_frame_info(tvb, pinfo, conn_data_tree, frame);
3020 if(cons_ldev && cons_ldev->name) {
3021 item = proto_tree_add_string(conn_data_tree, hf_cba_acco_conn_consumer, tvb, offset, 0, cons_ldev->name);
3022 PROTO_ITEM_SET_GENERATED(item);
3026 /* update column info now */
3028 if (check_col(pinfo->cinfo, COL_INFO))
3029 col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u", u16Count);
3032 /* is this an OnDataChanged buffer format (version), we know? */
3033 if (u8Version != CBA_MRSH_VERSION_DCOM &&
3034 u8Version != CBA_MRSH_VERSION_SRT_WITH_CONSID &&
3035 u8Version != CBA_MRSH_VERSION_SRT_WITHOUT_CONSID)
3040 /* Timestamps are currently unused -> flags must be zero */
3047 while (u16Count--) {
3048 /* find next record header */
3049 u16Len = tvb_get_letohs (tvb, offset);
3051 /* trapped inside an empty hole? -> try to find next record header */
3053 (u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID ||
3054 u8Version == CBA_MRSH_VERSION_SRT_WITHOUT_CONSID))
3057 offset_hole = offset;
3058 /* length smaller or larger than possible -> must be a hole */
3059 while (u16Len == 0) {
3061 u16Len = tvb_get_letohs(tvb, offset);
3062 /* this is a bit tricky here! we know: */
3063 /* u16Len must be greater than 3 (min. size of header itself) */
3064 /* u16Len must be a lot smaller than 0x300 (max. size of frame) */
3065 /* -> if we found a length larger than 0x300, */
3066 /* this must be actually the high byte, so do one more step */
3067 if (u16Len > 0x300) {
3071 proto_tree_add_none_format(conn_data_tree, hf_cba_acco_cb_item_hole, tvb,
3072 offset_hole, offset - offset_hole,
3073 "Hole(--): -------------, offset=%2u, length=%2u",
3074 offset_hole, offset - offset_hole);
3077 /* add callback-item subtree */
3078 sub_item = proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_item, tvb, offset, 0, FALSE);
3079 sub_tree = proto_item_add_subtree(sub_item, ett_ICBAAccoCallback_Item);
3081 item_offset = offset;
3083 /* add item header fields */
3085 proto_tree_add_item(sub_tree, hf_cba_acco_cb_item_length, tvb, offset, 2, TRUE);
3090 if (u8Version == CBA_MRSH_VERSION_DCOM ||
3091 u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID)
3093 u32ID = tvb_get_letohl (tvb, offset);
3095 proto_tree_add_item(sub_tree, hf_cba_acco_conn_cons_id, tvb, offset, 4, TRUE);
3103 u8QC = tvb_get_guint8 (tvb, offset);
3105 item = proto_tree_add_item(sub_tree, hf_cba_acco_qc, tvb, offset, 1, TRUE);
3110 if( u8QC != 0x80 && /* GoodNonCascOk */
3111 u8QC != 0x1C && /* BadOutOfService (usually permanent, so don't report for every frame) */
3113 expert_add_info_format(pinfo, item, PI_RESPONSE_CODE, PI_CHAT, "%s QC: %s",
3114 u8Version == CBA_MRSH_VERSION_DCOM ? "DCOM" : "SRT",
3115 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"));
3130 /* user data length is item length without headers */
3131 u16DataLen = u16Len - u16HdrLen;
3133 /* append text to subtree header */
3134 if (u8Version == CBA_MRSH_VERSION_DCOM ||
3135 u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID)
3137 proto_item_append_text(sub_item,
3138 "[%2u]: ConsID=0x%08x, offset=%2u, length=%2u (user-length=%2u), QC=%s (0x%02x)",
3139 u32ItemIdx, u32ID, offset - u16HdrLen, u16Len, u16DataLen,
3140 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"), u8QC );
3142 proto_item_append_text(sub_item,
3143 "[%2u]: ConsID=-, offset=%2u, length=%2u (user-length=%2u), QC=%s (0x%02x)",
3144 u32ItemIdx, offset - u16HdrLen, u16Len, u16DataLen,
3145 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"), u8QC );
3147 proto_item_set_len(sub_item, u16Len);
3149 /* hexdump of user data */
3150 proto_tree_add_bytes(sub_tree, hf_cba_acco_cb_item_data, tvb, offset, u16DataLen,
3151 tvb_get_ptr(tvb, offset, u16DataLen));
3152 offset += u16DataLen;
3154 if(frame != NULL ) {
3155 /* find offset in SRT */
3156 /* XXX - expensive! */
3157 cba_frame_incoming_data(tvb, pinfo, sub_tree, frame);
3158 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
3160 if(conn->frame_offset == item_offset) {
3161 cba_connection_info(tvb, pinfo, sub_tree, conn);
3166 /* find consID in ldev */
3167 /* XXX - expensive! */
3168 if(cons_ldev != NULL) {
3169 for(conns = cons_ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
3171 if(conn->consid == u32ID) {
3172 cba_connection_info(tvb, pinfo, sub_tree, conn);
3173 cba_connection_incoming_data(tvb, pinfo, sub_tree, conn);
3183 if (u8Version == 1) {
3184 proto_item_append_text(conn_data_item,
3185 ": Version=0x%x (DCOM), Flags=0x%x, Count=%u",
3186 u8Version, u8Flags, u16CountFix);
3188 proto_item_append_text(conn_data_item,
3189 ": Version=0x%x (SRT), Flags=0x%x, Count=%u, Items=%u, Holes=%u",
3190 u8Version, u8Flags, u16CountFix, u32ItemIdx-1, u32HoleIdx-1);
3192 proto_item_set_len(conn_data_item, offset);
3194 if (check_col(pinfo->cinfo, COL_INFO))
3195 col_append_fstr(pinfo->cinfo, COL_INFO, ", QC (G:%u,U:%u,B:%u)",
3196 qc_good, qc_uncertain, qc_bad);
3203 dissect_CBA_Connection_Data_heur(tvbuff_t *tvb,
3204 packet_info *pinfo, proto_tree *tree)
3211 /* the tvb will NOT contain the frame_id here! */
3212 u16FrameID = GPOINTER_TO_UINT(pinfo->private_data);
3214 /* frame id must be in valid range (cyclic Real-Time, class=1 or class=2) */
3215 if (u16FrameID < 0x8000 || u16FrameID >= 0xfb00) {
3219 u8Version = tvb_get_guint8 (tvb, 0);
3220 u8Flags = tvb_get_guint8 (tvb, 1);
3222 /* version and flags must be ok */
3223 if(u8Version != 0x11 || u8Flags != 0x00) {
3227 if (check_col(pinfo->cinfo, COL_PROTOCOL))
3228 col_add_str(pinfo->cinfo, COL_PROTOCOL, "PN-CBA");
3230 frame = cba_frame_find_by_cons(pinfo, pinfo->dl_dst.data, u16FrameID);
3232 dissect_CBA_Connection_Data(tvb, pinfo, tree, frame ? frame->consparent : NULL, frame);
3239 dissect_ICBAAccoCallback_OnDataChanged_rqst(tvbuff_t *tvb, int offset,
3240 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3243 guint32 u32ArraySize;
3246 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3247 cba_ldev_t *cons_ldev;
3250 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3252 /* get corresponding provider ldev */
3253 cons_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
3255 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
3256 PROTO_ITEM_SET_GENERATED(item);
3257 pinfo->profinet_type = 1;
3260 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3261 hf_cba_acco_cb_length, &u32Length);
3264 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3267 /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
3268 /* dissect PROFINET component data (without header) */
3269 next_tvb = tvb_new_subset_remaining(tvb, offset);
3271 offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, cons_ldev, NULL /* frame */);
3274 /* tvb_free(next_tvb);*/
3281 dissect_ICBAAccoCallback_OnDataChanged_resp(tvbuff_t *tvb, int offset,
3282 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3288 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3290 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
3291 PROTO_ITEM_SET_GENERATED(item);
3292 pinfo->profinet_type = 2;
3294 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3297 if (check_col(pinfo->cinfo, COL_INFO)) {
3298 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3299 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3307 dissect_ICBAAccoCallback_Gnip_rqst(tvbuff_t *tvb, int offset,
3308 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3313 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3315 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
3316 PROTO_ITEM_SET_GENERATED(item);
3317 pinfo->profinet_type = 3;
3324 dissect_ICBAAccoCallback_Gnip_resp(tvbuff_t *tvb, int offset,
3325 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3331 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3333 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
3334 PROTO_ITEM_SET_GENERATED(item);
3335 pinfo->profinet_type = 4;
3337 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3340 if (check_col(pinfo->cinfo, COL_INFO)) {
3341 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3342 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3350 dissect_ICBAAccoServer2_GetConnectionData_rqst(tvbuff_t *tvb, int offset,
3351 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3354 guint32 u32MaxStr = sizeof(szStr);
3356 cba_ldev_t *cons_ldev;
3357 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3361 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3363 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
3364 PROTO_ITEM_SET_GENERATED(item);
3365 pinfo->profinet_type = 2;
3367 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
3368 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
3370 cons_ldev = cba_acco_add(pinfo, szStr);
3372 /* link ldev to the call */
3373 if(cons_ldev != NULL) {
3374 call = se_alloc(sizeof(cba_ldev_t *));
3376 info->call_data->private_data = call;
3379 /* update column info now */
3380 if (check_col(pinfo->cinfo, COL_INFO)) {
3381 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
3389 dissect_ICBAAccoServer2_GetConnectionData_resp(tvbuff_t *tvb, int offset,
3390 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3393 guint32 u32ArraySize;
3398 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3399 cba_ldev_t **call = info->call_data->private_data;
3400 cba_ldev_t *cons_ldev = (call!=NULL) ? *call : NULL;
3403 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3405 if(cons_ldev == NULL) {
3406 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
3407 "No request info, response data ignored");
3410 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
3411 PROTO_ITEM_SET_GENERATED(item);
3412 pinfo->profinet_type = 1;
3415 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3416 hf_cba_acco_cb_length, &u32Length);
3418 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3422 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3425 /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
3426 /* dissect PROFINET component data (without header) */
3427 next_tvb = tvb_new_subset_remaining(tvb, offset);
3429 offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, (call != NULL) ? *call : NULL, NULL /* frame */);
3432 /* tvb_free(next_tvb);*/
3435 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3438 /* update column info now */
3439 if (check_col(pinfo->cinfo, COL_INFO)) {
3440 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3441 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3449 dissect_ICBAAccoMgt_AddConnections_rqst(tvbuff_t *tvb, int offset,
3450 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3452 gchar szConsumer[1000] = { 0 };
3453 guint32 u32MaxConsLen = sizeof(szConsumer);
3455 guint16 u16QoSValue;
3458 guint32 u32ArraySize;
3460 guint16 u16Persistence;
3461 gchar szConsItem[1000] = { 0 };
3462 guint32 u32MaxConsItemLen = sizeof(szConsItem);
3463 gchar szProvItem[1000] = { 0 };
3464 guint32 u32MaxProvItemLen = sizeof(szProvItem);
3465 guint32 u32VariableOffset;
3466 proto_item *sub_item;
3467 proto_tree *sub_tree;
3468 guint32 u32SubStart;
3472 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3474 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
3475 hf_cba_acco_conn_provider, szConsumer, u32MaxConsLen);
3476 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
3477 hf_cba_acco_conn_qos_type, &u16QoSType);
3478 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
3479 hf_cba_acco_conn_qos_value, &u16QoSValue);
3480 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
3481 hf_cba_acco_conn_state, &u8State);
3483 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3484 hf_cba_acco_count, &u32Count);
3486 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3489 u32VariableOffset = offset + u32ArraySize * 20;
3492 while (u32ArraySize--) {
3493 sub_item = proto_tree_add_item(tree, hf_cba_addconnectionin, tvb, offset, 0, FALSE);
3494 sub_tree = proto_item_add_subtree(sub_item, ett_cba_addconnectionin);
3495 u32SubStart = offset;
3497 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3500 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3501 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
3503 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3506 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3507 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
3509 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3510 hf_cba_acco_conn_persist, &u16Persistence);
3512 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3515 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3516 hf_cba_acco_conn_substitute);
3518 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3521 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3522 hf_cba_acco_conn_epsilon);
3524 proto_item_append_text(sub_item, "[%u]: ConsItem=\"%s\" ProvItem=\"%s\" %s Pers=%u",
3525 u32Idx, szConsItem, szProvItem,
3526 val_to_str(u16Persistence, cba_persist_vals, "Unknown (0x%02x)"), u16Persistence);
3527 proto_item_set_len(sub_item, offset - u32SubStart);
3532 /* update column info now */
3533 if (check_col(pinfo->cinfo, COL_INFO)) {
3534 col_append_fstr(pinfo->cinfo, COL_INFO, ": Prov=\"%s\" State=%s Cnt=%u",
3536 val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"),
3540 return u32VariableOffset;
3545 dissect_ICBAAccoMgt_AddConnections_resp(tvbuff_t *tvb, int offset,
3546 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3549 guint32 u32ArraySize = 0;
3551 guint16 u16ConnVersion;
3552 guint32 u32HResult = 0;
3553 guint32 u32Count = 0;
3555 proto_item *sub_item;
3556 proto_tree *sub_tree;
3557 guint32 u32SubStart;
3560 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3562 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3566 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3569 u32Count = u32ArraySize;
3571 while (u32ArraySize--) {
3572 sub_item = proto_tree_add_item(tree, hf_cba_addconnectionout, tvb, offset, 0, FALSE);
3573 sub_tree = proto_item_add_subtree(sub_item, ett_cba_addconnectionout);
3574 u32SubStart = offset;
3576 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3577 hf_cba_acco_conn_cons_id, &u32ConsID);
3579 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3580 hf_cba_acco_conn_version, &u16ConnVersion);
3582 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3583 &u32HResult, u32Idx);
3585 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x Version=%u %s",
3586 u32Idx, u32ConsID, u16ConnVersion,
3587 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3588 proto_item_set_len(sub_item, offset - u32SubStart);
3593 /* update column info now */
3594 if (check_col(pinfo->cinfo, COL_INFO)) {
3595 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3599 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3602 /* update column info now */
3603 if (check_col(pinfo->cinfo, COL_INFO)) {
3604 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3605 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3613 dissect_ICBAAccoMgt_RemoveConnections_rqst(tvbuff_t *tvb, int offset,
3614 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3617 guint32 u32ArraySize;
3622 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3624 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3625 hf_cba_acco_count, &u32Count);
3627 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3631 while (u32ArraySize--) {
3632 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3633 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3637 /* update column info now */
3638 if (check_col(pinfo->cinfo, COL_INFO)) {
3639 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3647 dissect_ICBAAccoMgt_SetActivationState_rqst(tvbuff_t *tvb, int offset,
3648 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3652 guint32 u32ArraySize;
3657 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3659 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
3660 hf_cba_acco_conn_state, &u8State);
3662 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3663 hf_cba_acco_count, &u32Count);
3665 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3669 while (u32ArraySize--) {
3670 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3671 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3675 /* update column info now */
3676 if (check_col(pinfo->cinfo, COL_INFO)) {
3677 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3685 dissect_ICBAAccoMgt_GetInfo_resp(tvbuff_t *tvb, int offset,
3686 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3693 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3695 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3696 hf_cba_acco_info_max, &u32Max);
3698 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3699 hf_cba_acco_info_curr, &u32CurCnt);
3701 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3704 if (check_col(pinfo->cinfo, COL_INFO))
3705 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u/%u -> %s",
3707 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3714 dissect_ICBAAccoMgt_GetIDs_resp(tvbuff_t *tvb, int offset,
3715 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3719 guint32 u32ArraySize;
3725 proto_item *sub_item;
3726 proto_tree *sub_tree;
3727 guint32 u32SubStart;
3730 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3732 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3733 hf_cba_acco_count, &u32Count);
3735 if (check_col(pinfo->cinfo, COL_INFO)) {
3737 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count);
3739 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3743 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3746 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3750 while (u32ArraySize--) {
3751 sub_item = proto_tree_add_item(tree, hf_cba_getidout, tvb, offset, 0, FALSE);
3752 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getidout);
3753 u32SubStart = offset;
3755 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3756 hf_cba_acco_conn_cons_id, &u32ConsID);
3757 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3758 hf_cba_acco_conn_state, &u8State);
3759 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3760 hf_cba_acco_conn_version, &u16Version);
3761 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3762 &u32HResult, u32Idx);
3764 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x State=%s Version=%u %s",
3766 val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"),
3768 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3769 proto_item_set_len(sub_item, offset - u32SubStart);
3771 if (check_col(pinfo->cinfo, COL_INFO)) {
3773 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID);
3774 } else if (u32Idx < 10) {
3775 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID);
3776 } else if (u32Idx == 10) {
3777 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
3785 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3788 if (check_col(pinfo->cinfo, COL_INFO)) {
3789 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3790 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3798 dissect_ICBAAccoMgt2_GetConsIDs_resp(tvbuff_t *tvb, int offset,
3799 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3803 guint32 u32ArraySize;
3809 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3811 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3812 hf_cba_acco_count, &u32Count);
3814 if (check_col(pinfo->cinfo, COL_INFO)) {
3816 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count);
3818 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3822 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3825 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3829 while (u32ArraySize--) {
3830 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo,
3832 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3834 if (check_col(pinfo->cinfo, COL_INFO)) {
3836 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID);
3837 } else if (u32Idx < 10) {
3838 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID);
3839 } else if (u32Idx == 10) {
3840 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
3848 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3851 if (check_col(pinfo->cinfo, COL_INFO)) {
3852 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3853 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3861 dissect_ICBAAccoMgt2_GetConsConnections_resp(tvbuff_t *tvb, int offset,
3862 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3865 guint32 u32TmpCount;
3870 guint16 u16QoSValue;
3872 guint16 u16Persistence;
3873 proto_item *sub_item;
3874 proto_tree *sub_tree;
3875 guint32 u32SubStart;
3877 guint32 u32VariableOffset;
3878 gchar szProv[1000] = { 0 };
3879 guint32 u32MaxProvLen = sizeof(szProv);
3880 gchar szProvItem[1000] = { 0 };
3881 guint32 u32MaxProvItemLen = sizeof(szProvItem);
3882 gchar szConsItem[1000] = { 0 };
3883 guint32 u32MaxConsItemLen = sizeof(szConsItem);
3886 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3888 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3891 u32VariableOffset = offset;
3894 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3895 hf_cba_acco_count, &u32Count);
3897 u32VariableOffset = offset + u32Count*32;
3899 /* array fixed part (including pointers to variable part) */
3900 u32TmpCount = u32Count;
3902 while (u32TmpCount--) {
3903 sub_item = proto_tree_add_item(tree, hf_cba_getconsconnout, tvb, offset, 0, FALSE);
3904 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
3905 u32SubStart = offset;
3907 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3910 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3911 hf_cba_acco_conn_provider, szProv, u32MaxProvLen);
3913 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3916 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3917 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
3919 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3922 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3923 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
3925 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3928 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3929 hf_cba_acco_conn_substitute);
3931 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3934 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3935 hf_cba_acco_conn_epsilon);
3938 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3939 hf_cba_acco_conn_qos_type, &u16QoSType);
3940 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3941 hf_cba_acco_conn_qos_value, &u16QoSValue);
3942 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3943 hf_cba_acco_conn_state, &u8State);
3944 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3945 hf_cba_acco_conn_persist, &u16Persistence);
3946 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3947 &u32HResult, u32Idx);
3949 proto_item_append_text(sub_item, "[%u]: %s",
3951 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3952 proto_item_set_len(sub_item, offset - u32SubStart);
3958 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
3961 if (check_col(pinfo->cinfo, COL_INFO)) {
3962 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3963 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3966 return u32VariableOffset;
3971 dissect_ICBAAccoMgt2_DiagConsConnections_resp(tvbuff_t *tvb, int offset,
3972 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3975 guint32 u32TmpCount;
3979 guint16 u16Persistence;
3980 guint16 u16ConnVersion;
3981 proto_item *sub_item;
3982 proto_tree *sub_tree;
3983 proto_item *state_item;
3984 guint32 u32SubStart;
3986 guint32 u32VariableOffset;
3987 guint32 u32ConnErrorState;
3990 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3992 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3995 u32VariableOffset = offset;
3998 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3999 hf_cba_acco_count, &u32Count);
4001 u32VariableOffset = offset + u32Count*16;
4003 /* array fixed part (including pointers to variable part) */
4004 u32TmpCount = u32Count;
4006 while (u32TmpCount--) {
4007 sub_item = proto_tree_add_item(tree, hf_cba_diagconsconnout, tvb, offset, 0, FALSE);
4008 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
4009 u32SubStart = offset;
4011 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
4012 hf_cba_acco_conn_state, &u8State);
4013 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4014 hf_cba_acco_conn_persist, &u16Persistence);
4015 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4016 hf_cba_acco_conn_version, &u16ConnVersion);
4017 /* connection state */
4018 /* offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
4019 hf_cba_acco_conn_error_state, &u32ConnErrorState);*/
4020 offset = dissect_dcom_HRESULT_item(tvb, offset, pinfo, sub_tree, drep,
4021 &u32ConnErrorState, hf_cba_acco_conn_error_state, &state_item);
4022 proto_item_set_text(state_item, "ConnErrorState: %s (0x%x)",
4023 val_to_str(u32ConnErrorState, dcom_hresult_vals, "Unknown (0x%08x)"),
4026 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4027 &u32HResult, u32Idx);
4029 proto_item_append_text(sub_item, "[%u]: %s",
4031 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4032 proto_item_set_len(sub_item, offset - u32SubStart);
4038 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4041 if (check_col(pinfo->cinfo, COL_INFO)) {
4042 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
4043 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4046 return u32VariableOffset;
4051 dissect_ICBAAccoMgt_GetConnections_rqst(tvbuff_t *tvb, int offset,
4052 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4056 guint32 u32ArraySize;
4060 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4062 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4063 hf_cba_acco_count, &u32Count);
4065 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4069 while (u32ArraySize--){
4070 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
4071 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
4080 dissect_ICBAAccoMgt_GetConnections_resp(tvbuff_t *tvb, int offset,
4081 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4084 guint32 u32TmpCount;
4089 guint16 u16QoSValue;
4091 guint16 u16Persistence;
4092 guint16 u16ConnVersion;
4093 proto_item *sub_item;
4094 proto_tree *sub_tree;
4095 guint32 u32SubStart;
4097 guint32 u32VariableOffset;
4098 gchar szProv[1000] = { 0 };
4099 guint32 u32MaxProvLen = sizeof(szProv);
4100 gchar szProvItem[1000] = { 0 };
4101 guint32 u32MaxProvItemLen = sizeof(szProvItem);
4102 gchar szConsItem[1000] = { 0 };
4103 guint32 u32MaxConsItemLen = sizeof(szConsItem);
4106 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4108 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4111 u32VariableOffset = offset;
4114 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4115 hf_cba_acco_count, &u32Count);
4117 u32VariableOffset = offset + u32Count*36;
4119 /* array fixed part (including pointers to variable part) */
4120 u32TmpCount = u32Count;
4122 while (u32TmpCount--) {
4123 sub_item = proto_tree_add_item(tree, hf_cba_getconnectionout, tvb, offset, 0, FALSE);
4124 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
4125 u32SubStart = offset;
4127 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4130 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4131 hf_cba_acco_conn_provider, szProv, u32MaxProvLen);
4133 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4136 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4137 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
4139 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4142 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4143 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
4145 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4148 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4149 hf_cba_acco_conn_substitute);
4151 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4154 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4155 hf_cba_acco_conn_epsilon);
4158 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4159 hf_cba_acco_conn_qos_type, &u16QoSType);
4160 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4161 hf_cba_acco_conn_qos_value, &u16QoSValue);
4162 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
4163 hf_cba_acco_conn_state, &u8State);
4164 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4165 hf_cba_acco_conn_persist, &u16Persistence);
4166 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4167 hf_cba_acco_conn_version, &u16ConnVersion);
4168 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4169 &u32HResult, u32Idx);
4171 proto_item_append_text(sub_item, "[%u]: %s",
4173 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4174 proto_item_set_len(sub_item, offset - u32SubStart);
4180 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4183 if (check_col(pinfo->cinfo, COL_INFO)) {
4184 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
4185 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4188 return u32VariableOffset;
4193 dissect_ICBAAccoMgt_ReviseQoS_rqst(tvbuff_t *tvb, int offset,
4194 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4197 guint16 u16QoSValue;
4199 guint32 u32MaxStr = sizeof(szStr);
4202 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4204 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
4205 hf_cba_acco_rtauto, szStr, u32MaxStr);
4207 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4208 hf_cba_acco_conn_qos_type, &u16QoSType);
4210 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4211 hf_cba_acco_conn_qos_value, &u16QoSValue);
4213 if (check_col(pinfo->cinfo, COL_INFO)) {
4214 col_append_fstr(pinfo->cinfo, COL_INFO, ": RTAuto=\"%s\" QoSType=%s QoSValue=%u",
4216 val_to_str(u16QoSType, cba_qos_type_vals, "Unknown (0x%04x)"),
4225 dissect_ICBAAccoMgt_ReviseQoS_resp(tvbuff_t *tvb, int offset,
4226 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4228 guint16 u16QoSValue;
4232 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4234 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4235 hf_cba_acco_conn_qos_value, &u16QoSValue);
4237 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4240 if (check_col(pinfo->cinfo, COL_INFO))
4241 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s",
4243 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4250 dissect_ICBAAccoMgt_get_PingFactor_resp(tvbuff_t *tvb, int offset,
4251 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4257 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4259 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4260 hf_cba_acco_ping_factor, &u16PF);
4262 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4265 if (check_col(pinfo->cinfo, COL_INFO))
4266 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s",
4268 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4275 dissect_ICBAAccoMgt_put_PingFactor_rqst(tvbuff_t *tvb, int offset,
4276 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4281 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4283 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4284 hf_cba_acco_ping_factor, &u16PF);
4286 if (check_col(pinfo->cinfo, COL_INFO))
4287 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", u16PF);
4295 dissect_ICBAAccoMgt_get_CDBCookie_resp(tvbuff_t *tvb, int offset,
4296 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4302 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4304 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4305 hf_cba_acco_cdb_cookie, &u32Cookie);
4307 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4310 if (check_col(pinfo->cinfo, COL_INFO)) {
4311 col_append_fstr(pinfo->cinfo, COL_INFO, ": CDBCookie=0x%x -> %s",
4313 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4321 dissect_ICBAAccoMgt_GetDiagnosis_rqst(tvbuff_t *tvb, int offset,
4322 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4325 guint32 u32InLength;
4326 guint32 u32ArraySize;
4329 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4331 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4332 hf_cba_acco_diag_req, &u32Request);
4334 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4335 hf_cba_acco_diag_in_length, &u32InLength);
4337 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4340 if(u32ArraySize != 0) {
4341 proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32InLength, FALSE);
4344 if (check_col(pinfo->cinfo, COL_INFO)) {
4345 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s: %u bytes",
4346 val_to_str(u32Request, cba_acco_diag_req_vals, "Unknown request (0x%08x)"),
4355 dissect_ICBAAccoMgt_GetDiagnosis_resp(tvbuff_t *tvb, int offset,
4356 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4358 guint32 u32OutLength;
4361 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4363 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4364 hf_cba_acco_diag_out_length, &u32OutLength);
4366 if(u32OutLength != 0) {
4367 proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32OutLength, FALSE);
4370 if (check_col(pinfo->cinfo, COL_INFO)) {
4371 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u bytes",
4380 dissect_ICBAAccoSync_ReadItems_rqst(tvbuff_t *tvb, int offset,
4381 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4385 guint32 u32MaxStr = sizeof(szStr);
4387 guint32 u32ArraySize;
4388 guint32 u32VariableOffset;
4392 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4394 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4395 hf_cba_acco_count, &u32Count);
4397 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4400 u32VariableOffset = offset + u32ArraySize*4;
4403 while (u32ArraySize--) {
4404 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4407 u32VariableOffset = dissect_dcom_indexed_LPWSTR(tvb, u32VariableOffset, pinfo, tree, drep,
4408 hf_cba_acco_item, szStr, u32MaxStr, u32Idx);
4414 if (check_col(pinfo->cinfo, COL_INFO)) {
4415 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4418 return u32VariableOffset;
4425 dissect_ICBAAccoSync_ReadItems_resp(tvbuff_t *tvb, int offset,
4426 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4430 guint32 u32ArraySize;
4433 proto_item *sub_item;
4434 proto_tree *sub_tree;
4435 guint32 u32SubStart;
4436 guint32 u32VariableOffset;
4440 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4442 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4444 u32VariableOffset = offset;
4447 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4450 u32VariableOffset = offset + u32ArraySize * 20;
4452 u32Tmp = u32ArraySize;
4454 sub_item = proto_tree_add_item(tree, hf_cba_readitemout, tvb, offset, 0, FALSE);
4455 sub_tree = proto_item_add_subtree(sub_item, ett_cba_readitemout);
4456 u32SubStart = offset;
4458 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4461 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep, hf_cba_acco_data);
4464 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4465 hf_cba_acco_qc, &u16QC);
4466 offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
4467 hf_cba_acco_time_stamp, NULL);
4469 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4470 &u32HResult, u32Idx);
4472 proto_item_append_text(sub_item, "[%u]: QC=%s (0x%02x) %s",
4474 val_to_str(u16QC, cba_acco_qc_vals, "Unknown"),
4476 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4477 proto_item_set_len(sub_item, offset - u32SubStart);
4483 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4486 if (check_col(pinfo->cinfo, COL_INFO)) {
4487 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
4489 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4492 return u32VariableOffset;
4497 dissect_ICBAAccoSync_WriteItems_rqst(tvbuff_t *tvb, int offset,
4498 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4501 guint32 u32ArraySize;
4503 guint32 u32MaxStr = sizeof(szStr);
4505 guint32 u32VariableOffset;
4506 proto_item *sub_item;
4507 proto_tree *sub_tree;
4508 guint32 u32SubStart;
4512 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4514 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4515 hf_cba_acco_count, &u32Count);
4517 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4520 u32VariableOffset = offset + u32ArraySize * 8;
4522 while(u32ArraySize--) {
4523 sub_item = proto_tree_add_item(tree, hf_cba_writeitemin, tvb, offset, 0, FALSE);
4524 sub_tree = proto_item_add_subtree(sub_item, ett_cba_writeitemin);
4525 u32SubStart = offset;
4527 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4530 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4531 hf_cba_acco_item, szStr, u32MaxStr);
4533 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4536 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4540 proto_item_append_text(sub_item, "[%u]: Item=\"%s\"", u32Idx, szStr);
4541 proto_item_set_len(sub_item, offset - u32SubStart);
4546 if (check_col(pinfo->cinfo, COL_INFO)) {
4547 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4550 return u32VariableOffset;
4556 dissect_ICBAAccoSync_WriteItemsQCD_rqst(tvbuff_t *tvb, int offset,
4557 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4560 guint32 u32ArraySize;
4562 guint32 u32MaxStr = sizeof(szStr);
4564 guint32 u32VariableOffset;
4565 proto_item *sub_item;
4566 proto_tree *sub_tree;
4567 guint32 u32SubStart;
4571 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4573 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4574 hf_cba_acco_count, &u32Count);
4576 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4579 u32VariableOffset = offset + u32ArraySize * 20;
4581 while(u32ArraySize--) {
4582 sub_item = proto_tree_add_item(tree, hf_cba_writeitemin, tvb, offset, 0, FALSE);
4583 sub_tree = proto_item_add_subtree(sub_item, ett_cba_writeitemin);
4584 u32SubStart = offset;
4586 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4589 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4590 hf_cba_acco_item, szStr, u32MaxStr);
4593 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4596 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4600 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4601 hf_cba_acco_qc, &u16QC);
4603 offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
4604 hf_cba_acco_time_stamp, NULL);
4606 proto_item_append_text(sub_item, "[%u]: Item=\"%s\" QC=%s (0x%02x)",
4608 val_to_str(u16QC, cba_acco_qc_vals, "Unknown"), u16QC);
4610 proto_item_set_len(sub_item, offset - u32SubStart);
4614 if (check_col(pinfo->cinfo, COL_INFO)) {
4615 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4618 return u32VariableOffset;
4626 /* sub dissector table of ICBAAccoMgt / ICBAAccoMgt2 interface */
4627 static dcerpc_sub_dissector ICBAAccoMgt_dissectors[] = {
4628 { 0, "QueryInterface", NULL, NULL},
4629 { 1, "AddRef", NULL, NULL },
4630 { 2, "Release", NULL, NULL },
4632 { 3, "AddConnections", dissect_ICBAAccoMgt_AddConnections_rqst, dissect_ICBAAccoMgt_AddConnections_resp },
4633 { 4, "RemoveConnections", dissect_ICBAAccoMgt_RemoveConnections_rqst, dissect_HResultArray_resp },
4634 { 5, "ClearConnections", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
4635 { 6, "SetActivationState", dissect_ICBAAccoMgt_SetActivationState_rqst, dissect_HResultArray_resp },
4636 { 7, "GetInfo", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_GetInfo_resp },
4637 { 8, "GetIDs", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_GetIDs_resp },
4638 { 9, "GetConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt_GetConnections_resp },
4639 {10, "ReviseQoS", dissect_ICBAAccoMgt_ReviseQoS_rqst, dissect_ICBAAccoMgt_ReviseQoS_resp },
4640 {11, "get_PingFactor", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_get_PingFactor_resp },
4641 {12, "put_PingFactor", dissect_ICBAAccoMgt_put_PingFactor_rqst, dissect_dcom_simple_resp },
4642 {13, "get_CDBCookie", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_get_CDBCookie_resp },
4644 {14, "GetConsIDs", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt2_GetConsIDs_resp },
4645 {15, "GetConsConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt2_GetConsConnections_resp },
4646 {16, "DiagConsConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt2_DiagConsConnections_resp },
4647 {17, "GetProvIDs", dissect_dcom_simple_rqst, dissect_Server_GetProvIDs_resp },
4648 {18, "GetProvConnections", dissect_Server_GetProvConnections_rqst, dissect_Server_GetProvConnections_resp },
4649 {19, "GetDiagnosis", dissect_ICBAAccoMgt_GetDiagnosis_rqst, dissect_ICBAAccoMgt_GetDiagnosis_resp },
4650 { 0, NULL, NULL, NULL },
4654 /* sub dissector table of ICBAAccoCallback interface */
4655 static dcerpc_sub_dissector ICBAAccoCallback_dissectors[] = {
4656 { 0, "QueryInterface", NULL, NULL },
4657 { 1, "AddRef", NULL, NULL },
4658 { 2, "Release", NULL, NULL },
4660 { 3, "OnDataChanged", dissect_ICBAAccoCallback_OnDataChanged_rqst, dissect_ICBAAccoCallback_OnDataChanged_resp },
4662 { 4, "Gnip", dissect_ICBAAccoCallback_Gnip_rqst, dissect_ICBAAccoCallback_Gnip_resp },
4663 { 0, NULL, NULL, NULL },
4667 /* sub dissector table of ICBAAccoServer interface */
4668 static dcerpc_sub_dissector ICBAAccoServer_dissectors[] = {
4669 { 0, "QueryInterface", NULL, NULL },
4670 { 1, "AddRef", NULL, NULL },
4671 { 2, "Release", NULL, NULL },
4673 { 3, "Connect", dissect_ICBAAccoServer_Connect_rqst, dissect_ICBAAccoServer_Connect_resp },
4674 { 4, "Disconnect", dissect_ICBAAccoServer_Disconnect_rqst, dissect_ICBAAccoServer_Disconnect_resp },
4675 { 5, "DisconnectMe", dissect_ICBAAccoServer_DisconnectMe_rqst, dissect_ICBAAccoServer_DisconnectMe_resp },
4676 { 6, "SetActivation", dissect_ICBAAccoServer_SetActivation_rqst, dissect_ICBAAccoServer_SetActivation_resp },
4677 { 7, "Ping", dissect_ICBAAccoServer_Ping_rqst, dissect_ICBAAccoServer_Ping_resp },
4679 { 8, "Connect2", dissect_ICBAAccoServer2_Connect2_rqst, dissect_ICBAAccoServer_Connect_resp },
4680 { 9, "GetConnectionData", dissect_ICBAAccoServer2_GetConnectionData_rqst, dissect_ICBAAccoServer2_GetConnectionData_resp },
4681 { 0, NULL, NULL, NULL },
4685 /* sub dissector table of ICBAAccoServerSRT interface (stage 2 only) */
4686 static dcerpc_sub_dissector ICBAAccoServerSRT_dissectors[] = {
4687 { 0, "QueryInterface", NULL, NULL },
4688 { 1, "AddRef", NULL, NULL },
4689 { 2, "Release", NULL, NULL },
4691 { 3, "ConnectCR", dissect_ICBAAccoServerSRT_ConnectCR_rqst, dissect_ICBAAccoServerSRT_ConnectCR_resp },
4692 { 4, "DisconnectCR", dissect_ICBAAccoServerSRT_DisconnectCR_rqst, dissect_ICBAAccoServerSRT_DisconnectCR_resp },
4693 { 5, "Connect", dissect_ICBAAccoServerSRT_Connect_rqst, dissect_ICBAAccoServerSRT_Connect_resp },
4694 { 6, "Disconnect", dissect_ICBAAccoServerSRT_Disconnect_rqst, dissect_ICBAAccoServerSRT_Disconnect_resp },
4695 { 7, "DisconnectMe", dissect_ICBAAccoServerSRT_DisconnectMe_rqst, dissect_ICBAAccoServerSRT_DisconnectMe_resp },
4696 { 8, "SetActivation", dissect_ICBAAccoServerSRT_SetActivation_rqst, dissect_ICBAAccoServerSRT_SetActivation_resp },
4697 { 0, NULL, NULL, NULL },
4701 /* sub dissector table of ICBAAccoSync interface */
4702 static dcerpc_sub_dissector ICBAAccoSync_dissectors[] = {
4703 { 0, "QueryInterface", NULL, NULL },
4704 { 1, "AddRef", NULL, NULL },
4705 { 2, "Release", NULL, NULL },
4707 { 3, "ReadItems", dissect_ICBAAccoSync_ReadItems_rqst, dissect_ICBAAccoSync_ReadItems_resp },
4708 { 4, "WriteItems", dissect_ICBAAccoSync_WriteItems_rqst, dissect_HResultArray_resp },
4709 { 5, "WriteItemsQCD", dissect_ICBAAccoSync_WriteItemsQCD_rqst, dissect_HResultArray_resp },
4710 { 0, NULL, NULL, NULL },
4714 /* register protocol */
4716 proto_register_dcom_cba_acco (void)
4718 static gint *ett3[3];
4719 static gint *ett4[4];
4720 static gint *ett5[5];
4723 static hf_register_info hf_cba_acco_array[] = {
4724 { &hf_cba_acco_opnum,
4725 { "Operation", "cba.acco.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4726 { &hf_cba_acco_ping_factor,
4727 { "PingFactor", "cba.acco.ping_factor", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4728 { &hf_cba_acco_count,
4729 { "Count", "cba.acco.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4730 { &hf_cba_acco_info_max,
4731 { "Max", "cba.acco.info_max", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4732 { &hf_cba_acco_info_curr,
4733 { "Current", "cba.acco.info_curr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4734 { &hf_cba_acco_rtauto,
4735 { "RTAuto", "cba.acco.rtauto", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4736 { &hf_cba_acco_item,
4737 { "Item", "cba.acco.item", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4738 { &hf_cba_acco_data,
4739 { "Data", "cba.acco.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4741 { "QualityCode", "cba.acco.qc", FT_UINT8, BASE_HEX, VALS(cba_acco_qc_vals), 0x0, NULL, HFILL }},
4742 { &hf_cba_acco_time_stamp,
4743 { "TimeStamp", "cba.acco.time_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4744 { &hf_cba_readitemout,
4745 { "ReadItemOut", "cba.acco.readitemout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4746 { &hf_cba_writeitemin,
4747 { "WriteItemIn", "cba.acco.writeitemin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4748 { &hf_cba_acco_cdb_cookie,
4749 { "CDBCookie", "cba.acco.cdb_cookie", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4750 /* dcom_hresult_vals from packet-dcom.h doesn't work here, as length is unknown! */
4751 { &hf_cba_acco_conn_error_state,
4752 { "ConnErrorState", "cba.acco.conn_error_state", FT_UINT32, BASE_HEX, NULL /*VALS(dcom_hresult_vals)*/, 0x0, NULL, HFILL }},
4753 { &hf_cba_acco_diag_req,
4754 { "Request", "cba.acco.diag_req", FT_UINT32, BASE_HEX, VALS(cba_acco_diag_req_vals), 0x0, NULL, HFILL }},
4755 { &hf_cba_acco_diag_in_length,
4756 { "InLength", "cba.acco.diag_in_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4757 { &hf_cba_acco_diag_out_length,
4758 { "OutLength", "cba.acco.diag_out_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4759 { &hf_cba_acco_diag_data,
4760 { "Data", "cba.acco.diag_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4761 { &hf_cba_acco_dcom_call,
4762 { "DcomRuntime", "cba.acco.dcom", FT_BOOLEAN, BASE_NONE, TFS(&cba_acco_call_flags), 0x0, "This is a DCOM runtime context", HFILL }},
4763 { &hf_cba_acco_srt_call,
4764 { "SrtRuntime", "cba.acco.srt", FT_BOOLEAN, BASE_NONE, TFS(&cba_acco_call_flags), 0x0, "This is an SRT runtime context", HFILL }}
4768 static hf_register_info hf_cba_acco_server[] = {
4769 { &hf_cba_acco_server_pICBAAccoCallback,
4770 { "pICBAAccoCallback", "cba.acco.server_pICBAAccoCallback", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4771 { &hf_cba_acco_server_first_connect,
4772 { "FirstConnect", "cba.acco.server_first_connect", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4773 { &hf_cba_getprovconnout,
4774 { "GETPROVCONNOUT", "cba.acco.getprovconnout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4775 { &hf_cba_acco_serversrt_prov_mac,
4776 { "ProviderMAC", "cba.acco.serversrt_prov_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4777 { &hf_cba_acco_serversrt_cons_mac,
4778 { "ConsumerMAC", "cba.acco.serversrt_cons_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4779 { &hf_cba_acco_serversrt_cr_id,
4780 { "ConsumerCRID", "cba.acco.serversrt_cr_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4781 { &hf_cba_acco_serversrt_cr_length,
4782 { "CRLength", "cba.acco.serversrt_cr_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4783 { &hf_cba_acco_serversrt_cr_flags,
4784 { "Flags", "cba.acco.serversrt_cr_flags", FT_UINT32, BASE_HEX, 0, 0x0, NULL, HFILL }},
4785 { &hf_cba_acco_serversrt_cr_flags_timestamped,
4786 { "Timestamped", "cba.acco.serversrt_cr_flags_timestamped", FT_BOOLEAN, 32, TFS (&acco_flags_set_truth), 0x1, NULL, HFILL }},
4787 { &hf_cba_acco_serversrt_cr_flags_reconfigure,
4788 { "Reconfigure", "cba.acco.serversrt_cr_flags_reconfigure", FT_BOOLEAN, 32, TFS (&acco_flags_set_truth), 0x2, NULL, HFILL }},
4789 { &hf_cba_type_desc_len,
4790 { "TypeDescLen", "cba.acco.type_desc_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4791 { &hf_cba_acco_serversrt_record_length,
4792 { "RecordLength", "cba.acco.serversrt_record_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4793 { &hf_cba_acco_serversrt_action,
4794 { "Action", "cba.acco.serversrt_action", FT_UINT32, BASE_DEC, VALS(cba_acco_serversrt_action_vals), 0x0, NULL, HFILL }},
4795 { &hf_cba_acco_serversrt_last_connect,
4796 { "LastConnect", "cba.acco.serversrt_last_connect", FT_UINT8, BASE_DEC, VALS(cba_acco_serversrt_last_connect_vals), 0x0, NULL, HFILL }},
4799 static hf_register_info hf_cba_connectcr_array[] = {
4800 { &hf_cba_acco_prov_crid,
4801 { "ProviderCRID", "cba.acco.prov_crid", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4804 static hf_register_info hf_cba_connect_array[] = {
4805 { &hf_cba_addconnectionin,
4806 { "ADDCONNECTIONIN", "cba.acco.addconnectionin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4807 { &hf_cba_addconnectionout,
4808 { "ADDCONNECTIONOUT", "cba.acco.addconnectionout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4810 { "GETIDOUT", "cba.acco.getidout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4811 { &hf_cba_getconnectionout,
4812 { "GETCONNECTIONOUT", "cba.acco.getconnectionout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4813 { &hf_cba_getconsconnout,
4814 { "GETCONSCONNOUT", "cba.acco.getconsconnout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4815 { &hf_cba_diagconsconnout,
4816 { "DIAGCONSCONNOUT", "cba.acco.diagconsconnout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4817 { &hf_cba_connectincr,
4818 { "CONNECTINCR", "cba.acco.connectincr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4819 { &hf_cba_connectoutcr,
4820 { "CONNECTOUTCR", "cba.acco.connectoutcr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4821 { &hf_cba_connectin,
4822 { "CONNECTIN", "cba.acco.connectin", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4823 { &hf_cba_connectout,
4824 { "CONNECTOUT", "cba.acco.connectout", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4825 { &hf_cba_acco_conn_prov_id,
4826 { "ProviderID", "cba.acco.conn_prov_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4827 { &hf_cba_acco_conn_cons_id,
4828 { "ConsumerID", "cba.acco.conn_cons_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4829 { &hf_cba_acco_conn_version,
4830 { "ConnVersion", "cba.acco.conn_version", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4831 { &hf_cba_acco_conn_consumer,
4832 { "Consumer", "cba.acco.conn_consumer", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4833 { &hf_cba_acco_conn_qos_type,
4834 { "QoSType", "cba.acco.conn_qos_type", FT_UINT16, BASE_HEX, VALS(cba_qos_type_vals), 0x0, NULL, HFILL }},
4835 { &hf_cba_acco_conn_qos_value,
4836 { "QoSValue", "cba.acco.conn_qos_value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4837 { &hf_cba_acco_conn_state,
4838 { "State", "cba.acco.conn_state", FT_UINT8, BASE_HEX, VALS(cba_acco_conn_state_vals), 0x0, NULL, HFILL }},
4839 { &hf_cba_acco_conn_provider,
4840 { "Provider", "cba.acco.conn_provider", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4841 { &hf_cba_acco_conn_provider_item,
4842 { "ProviderItem", "cba.acco.conn_provider_item", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4843 { &hf_cba_acco_conn_consumer_item,
4844 { "ConsumerItem", "cba.acco.conn_consumer_item", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4845 { &hf_cba_acco_conn_persist,
4846 { "Persistence", "cba.acco.conn_persist", FT_UINT16, BASE_HEX, VALS(cba_persist_vals), 0x0, NULL, HFILL }},
4847 { &hf_cba_acco_conn_epsilon,
4848 { "Epsilon", "cba.acco.conn_epsilon", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4849 { &hf_cba_acco_conn_substitute,
4850 { "Substitute", "cba.acco.conn_substitute", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4853 static hf_register_info hf_cba_acco_cb[] = {
4854 { &hf_cba_acco_cb_length,
4855 { "Length", "cba.acco.cb_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4856 { &hf_cba_acco_cb_version,
4857 { "Version", "cba.acco.cb_version", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4858 { &hf_cba_acco_cb_flags,
4859 { "Flags", "cba.acco.cb_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4860 { &hf_cba_acco_cb_count,
4861 { "Count", "cba.acco.cb_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4862 { &hf_cba_acco_cb_conn_data,
4863 { "CBA Connection data", "cba.acco.cb_conn_data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4864 { &hf_cba_acco_cb_item,
4865 { "Item", "cba.acco.cb_item", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4866 { &hf_cba_acco_cb_item_hole,
4867 { "Hole", "cba.acco.cb_item_hole", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4868 { &hf_cba_acco_cb_item_length,
4869 { "Length", "cba.acco.cb_item_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4870 { &hf_cba_acco_cb_item_data,
4871 { "Data(Hex)", "cba.acco.cb_item_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4872 { &hf_cba_connect_in,
4873 { "Connect in frame", "cba.connect_in", FT_FRAMENUM, BASE_NONE,
4874 NULL, 0, "This connection Connect was in the packet with this number", HFILL }},
4875 { &hf_cba_disconnect_in,
4876 { "Disconnect in frame", "cba.disconnect_in", FT_FRAMENUM, BASE_NONE,
4877 NULL, 0, "This connection Disconnect was in the packet with this number", HFILL }},
4878 { &hf_cba_connectcr_in,
4879 { "ConnectCR in frame", "cba.connect_in", FT_FRAMENUM, BASE_NONE,
4880 NULL, 0, "This frame ConnectCR was in the packet with this number", HFILL }},
4881 { &hf_cba_disconnectcr_in,
4882 { "DisconnectCR in frame", "cba.disconnect_in", FT_FRAMENUM, BASE_NONE,
4883 NULL, 0, "This frame DisconnectCR was in the packet with this number", HFILL }},
4884 { &hf_cba_disconnectme_in,
4885 { "DisconnectMe in frame", "cba.disconnectme_in", FT_FRAMENUM, BASE_NONE,
4886 NULL, 0, "This connection/frame DisconnectMe was in the packet with this number", HFILL }},
4887 { &hf_cba_data_first_in,
4888 { "First data in frame", "cba.data_first_in", FT_FRAMENUM, BASE_NONE,
4889 NULL, 0, "The first data of this connection/frame in the packet with this number", HFILL }},
4890 { &hf_cba_data_last_in,
4891 { "Last data in frame", "cba.data_last_in", FT_FRAMENUM, BASE_NONE,
4892 NULL, 0, "The last data of this connection/frame in the packet with this number", HFILL }},
4895 ett5[0] = &ett_ICBAAccoMgt;
4896 ett5[1] = &ett_cba_addconnectionin;
4897 ett5[2] = &ett_cba_addconnectionout;
4898 ett5[3] = &ett_cba_getidout;
4899 ett5[4] = &ett_cba_getconnectionout;
4900 proto_ICBAAccoMgt = proto_register_protocol ("ICBAAccoMgt", "ICBAAccoMgt", "cba_acco_mgt");
4901 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_acco_array, array_length(hf_cba_acco_array));
4902 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_connect_array, array_length(hf_cba_connect_array));
4903 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_connectcr_array, array_length(hf_cba_connectcr_array));
4904 proto_register_subtree_array (ett5, array_length (ett5));
4906 proto_ICBAAccoMgt2 = proto_register_protocol ("ICBAAccoMgt2", "ICBAAccoMgt2", "cba_acco_mgt2");
4908 ett3[0] = &ett_ICBAAccoCallback;
4909 ett3[1] = &ett_ICBAAccoCallback_Item;
4910 ett3[2] = &ett_ICBAAccoCallback_Buffer;
4911 proto_ICBAAccoCallback = proto_register_protocol ("ICBAAccoCallback", "ICBAAccoCB", "cba_acco_cb");
4912 proto_register_field_array(proto_ICBAAccoCallback, hf_cba_acco_cb, array_length(hf_cba_acco_cb));
4913 proto_register_subtree_array (ett3, array_length (ett3));
4915 proto_ICBAAccoCallback2 = proto_register_protocol ("ICBAAccoCallback2", "ICBAAccoCB2", "cba_acco_cb2");
4917 ett4[0] = &ett_ICBAAccoServer;
4918 ett4[1] = &ett_cba_connectin;
4919 ett4[2] = &ett_cba_connectout;
4920 ett4[3] = &ett_cba_getprovconnout;
4921 proto_ICBAAccoServer = proto_register_protocol ("ICBAAccoServer", "ICBAAccoServ", "cba_acco_server");
4922 proto_register_field_array(proto_ICBAAccoServer, hf_cba_acco_server, array_length(hf_cba_acco_server));
4923 proto_register_subtree_array (ett4, array_length (ett4));
4925 proto_ICBAAccoServer2 = proto_register_protocol ("ICBAAccoServer2", "ICBAAccoServ2", "cba_acco_server2");
4927 ett4[0] = &ett_ICBAAccoServerSRT;
4928 ett4[1] = &ett_cba_acco_serversrt_cr_flags;
4929 ett4[2] = &ett_cba_connectincr;
4930 ett4[3] = &ett_cba_connectoutcr;
4931 proto_ICBAAccoServerSRT = proto_register_protocol ("ICBAAccoServerSRT", "ICBAAccoServSRT", "cba_acco_server_srt");
4932 proto_register_subtree_array (ett4, array_length (ett4));
4934 ett5[0] = &ett_ICBAAccoSync;
4935 ett5[1] = &ett_cba_readitemout;
4936 ett5[2] = &ett_cba_writeitemin;
4937 ett5[3] = &ett_cba_frame_info;
4938 ett5[4] = &ett_cba_conn_info;
4939 proto_ICBAAccoSync = proto_register_protocol ("ICBAAccoSync", "ICBAAccoSync", "cba_acco_sync");
4940 proto_register_subtree_array (ett5, array_length (ett5));
4944 /* handoff protocol */
4946 proto_reg_handoff_dcom_cba_acco (void)
4948 /* Register the interfaces */
4949 dcerpc_init_uuid(proto_ICBAAccoMgt, ett_ICBAAccoMgt,
4950 &uuid_ICBAAccoMgt, ver_ICBAAccoMgt, ICBAAccoMgt_dissectors, hf_cba_acco_opnum);
4952 dcerpc_init_uuid(proto_ICBAAccoMgt2, ett_ICBAAccoMgt,
4953 &uuid_ICBAAccoMgt2, ver_ICBAAccoMgt2, ICBAAccoMgt_dissectors, hf_cba_acco_opnum);
4955 dcerpc_init_uuid(proto_ICBAAccoCallback, ett_ICBAAccoCallback,
4956 &uuid_ICBAAccoCallback, ver_ICBAAccoCallback, ICBAAccoCallback_dissectors, hf_cba_acco_opnum);
4958 dcerpc_init_uuid(proto_ICBAAccoCallback2, ett_ICBAAccoCallback,
4959 &uuid_ICBAAccoCallback2, ver_ICBAAccoCallback2, ICBAAccoCallback_dissectors, hf_cba_acco_opnum);
4961 dcerpc_init_uuid(proto_ICBAAccoServer, ett_ICBAAccoServer,
4962 &uuid_ICBAAccoServer, ver_ICBAAccoServer, ICBAAccoServer_dissectors, hf_cba_acco_opnum);
4964 dcerpc_init_uuid(proto_ICBAAccoServer2, ett_ICBAAccoServer,
4965 &uuid_ICBAAccoServer2, ver_ICBAAccoServer2, ICBAAccoServer_dissectors, hf_cba_acco_opnum);
4967 dcerpc_init_uuid(proto_ICBAAccoServerSRT, ett_ICBAAccoServerSRT,
4968 &uuid_ICBAAccoServerSRT, ver_ICBAAccoServerSRT, ICBAAccoServerSRT_dissectors, hf_cba_acco_opnum);
4970 dcerpc_init_uuid(proto_ICBAAccoSync, ett_ICBAAccoSync,
4971 &uuid_ICBAAccoSync, ver_ICBAAccoSync, ICBAAccoSync_dissectors, hf_cba_acco_opnum);
4974 heur_dissector_add("pn_rt", dissect_CBA_Connection_Data_heur, proto_ICBAAccoServer);