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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include <epan/expert.h>
32 #include <epan/emem.h>
33 #include <epan/addr_resolv.h>
34 #include <epan/dissectors/packet-dcerpc.h>
35 #include <epan/dissectors/packet-dcom.h>
36 #include "packet-dcom-cba-acco.h"
38 static int hf_cba_acco_opnum = -1;
40 static int hf_cba_acco_ping_factor = -1;
42 static int hf_cba_acco_count = -1;
44 static int hf_cba_acco_item = -1;
45 static int hf_cba_acco_data = -1;
46 static int hf_cba_acco_qc = -1;
47 static int hf_cba_acco_time_stamp = -1;
49 static int hf_cba_acco_conn_qos_type = -1;
50 static int hf_cba_acco_conn_qos_value = -1;
51 static int hf_cba_acco_conn_state = -1;
52 static int hf_cba_acco_conn_cons_id = -1;
53 static int hf_cba_acco_conn_version = -1;
54 static int hf_cba_acco_conn_prov_id = -1;
55 static int hf_cba_acco_conn_provider = -1;
56 static int hf_cba_acco_conn_consumer = -1;
57 static int hf_cba_acco_conn_provider_item = -1;
58 static int hf_cba_acco_conn_consumer_item = -1;
59 static int hf_cba_acco_conn_substitute = -1;
60 static int hf_cba_acco_conn_epsilon = -1;
61 static int hf_cba_acco_conn_persist = -1;
63 static int hf_cba_acco_cb_length = -1;
64 static int hf_cba_acco_cb_conn_data = -1;
65 static int hf_cba_acco_cb_version = -1;
66 static int hf_cba_acco_cb_flags = -1;
67 static int hf_cba_acco_cb_count = -1;
68 static int hf_cba_acco_cb_item = -1;
69 static int hf_cba_acco_cb_item_hole = -1;
70 static int hf_cba_acco_cb_item_length = -1;
71 static int hf_cba_acco_cb_item_data = -1;
73 static int hf_cba_connect_in = -1;
74 static int hf_cba_disconnect_in = -1;
75 static int hf_cba_connectcr_in = -1;
76 static int hf_cba_disconnectcr_in = -1;
77 static int hf_cba_disconnectme_in = -1;
78 static int hf_cba_data_first_in = -1;
79 static int hf_cba_data_last_in = -1;
81 /* static int hf_cba_acco_server_pICBAAccoCallback = -1; */
83 static int hf_cba_acco_server_first_connect = -1;
85 static int hf_cba_acco_serversrt_prov_mac = -1;
86 static int hf_cba_acco_serversrt_cons_mac = -1;
88 static int hf_cba_acco_serversrt_cr_id = -1;
89 static int hf_cba_acco_serversrt_cr_length = -1;
90 static int hf_cba_acco_serversrt_cr_flags = -1;
91 static int hf_cba_acco_serversrt_cr_flags_timestamped = -1;
92 static int hf_cba_acco_serversrt_cr_flags_reconfigure = -1;
93 static int hf_cba_acco_serversrt_record_length = -1;
94 /* static int hf_cba_acco_serversrt_action = -1; */
95 static int hf_cba_acco_serversrt_last_connect = -1;
97 static int hf_cba_getprovconnout = -1;
99 static int hf_cba_type_desc_len = -1;
101 static int hf_cba_connectincr = -1;
102 static int hf_cba_connectoutcr = -1;
103 static int hf_cba_connectin = -1;
104 static int hf_cba_connectout = -1;
105 static int hf_cba_getconnectionout = -1;
106 static int hf_cba_readitemout = -1;
107 static int hf_cba_writeitemin = -1;
108 static int hf_cba_addconnectionin = -1;
109 static int hf_cba_addconnectionout = -1;
110 static int hf_cba_getidout = -1;
112 static int hf_cba_getconsconnout = -1;
113 static int hf_cba_diagconsconnout = -1;
114 static int hf_cba_acco_conn_error_state = -1;
116 static int hf_cba_acco_info_max = -1;
117 static int hf_cba_acco_info_curr = -1;
119 static int hf_cba_acco_cdb_cookie = -1;
121 static int hf_cba_acco_rtauto = -1;
123 static int hf_cba_acco_prov_crid = -1;
125 static int hf_cba_acco_diag_req = -1;
126 static int hf_cba_acco_diag_in_length = -1;
127 static int hf_cba_acco_diag_out_length = -1;
128 static int hf_cba_acco_diag_data = -1;
129 static int hf_cba_acco_dcom_call = -1;
130 static int hf_cba_acco_srt_call = -1;
132 gint ett_cba_connectincr = -1;
133 gint ett_cba_connectoutcr = -1;
134 gint ett_cba_connectin = -1;
135 gint ett_cba_connectout = -1;
136 gint ett_cba_getprovconnout = -1;
137 gint ett_cba_addconnectionin = -1;
138 gint ett_cba_addconnectionout = -1;
139 gint ett_cba_getidout = -1;
140 gint ett_cba_getconnectionout = -1;
141 gint ett_cba_readitemout = -1;
142 gint ett_cba_writeitemin = -1;
143 gint ett_cba_acco_serversrt_cr_flags = -1;
144 gint ett_cba_frame_info = -1;
145 gint ett_cba_conn_info = -1;
147 static int proto_ICBAAccoMgt = -1;
148 static gint ett_ICBAAccoMgt = -1;
149 static e_uuid_t uuid_ICBAAccoMgt = { 0xcba00041, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
150 static guint16 ver_ICBAAccoMgt = 0;
152 static int proto_ICBAAccoMgt2 = -1;
153 static e_uuid_t uuid_ICBAAccoMgt2 = { 0xcba00046, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
154 static guint16 ver_ICBAAccoMgt2 = 0;
156 static int proto_ICBAAccoCallback = -1;
157 static gint ett_ICBAAccoCallback = -1;
158 static gint ett_ICBAAccoCallback_Buffer = -1;
159 static gint ett_ICBAAccoCallback_Item = -1;
160 static e_uuid_t uuid_ICBAAccoCallback = { 0xcba00042, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
161 static guint16 ver_ICBAAccoCallback = 0;
163 static int proto_ICBAAccoCallback2 = -1;
164 static e_uuid_t uuid_ICBAAccoCallback2 = { 0xcba00047, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
165 static guint16 ver_ICBAAccoCallback2 = 0;
167 static int proto_ICBAAccoServer = -1;
168 static gint ett_ICBAAccoServer = -1;
169 static e_uuid_t uuid_ICBAAccoServer = { 0xcba00043, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
170 static guint16 ver_ICBAAccoServer = 0;
172 static int proto_ICBAAccoServer2 = -1;
173 static e_uuid_t uuid_ICBAAccoServer2 = { 0xcba00048, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
174 static guint16 ver_ICBAAccoServer2 = 0;
176 static int proto_ICBAAccoServerSRT = -1;
177 static gint ett_ICBAAccoServerSRT = -1;
178 static e_uuid_t uuid_ICBAAccoServerSRT = { 0xcba00045, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
179 static guint16 ver_ICBAAccoServerSRT = 0;
181 static int proto_ICBAAccoSync = -1;
182 static gint ett_ICBAAccoSync = -1;
183 static e_uuid_t uuid_ICBAAccoSync = { 0xcba00044, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
184 static guint16 ver_ICBAAccoSync = 0;
188 static const value_string cba_acco_qc_vals[] = {
189 { 0x1c, "BadOutOfService" },
190 { 0x44, "UncertainLastUsableValue" },
191 { 0x48, "UncertainSubstituteSet" },
192 { 0x50, "UncertainSensorNotAccurate" },
193 { 0x80, "GoodNonCascOk" },
198 static const value_string cba_qos_type_vals[] = {
200 { 0x01, "Acyclic seconds" }, /* obsolete */
201 { 0x02, "Acyclic status" },
202 { 0x03, "Acyclic HMI" },
203 { 0x20, "Constant" },
204 { 0x30, "Cyclic Real-Time" },
209 static const value_string cba_persist_vals[] = {
210 { 0x00, "Volatile" },
211 { 0x01, "PendingPersistent" },
212 { 0x02, "Persistent" },
217 static const value_string cba_acco_conn_state_vals[] = {
223 static const value_string cba_acco_serversrt_action_vals[] = {
224 { 0x00, "Activate" },
225 { 0x01, "Deactivate" },
230 static const value_string cba_acco_serversrt_last_connect_vals[] = {
231 { 0x00, "CR not complete" },
232 { 0x01, "CR complete" },
236 static const value_string cba_acco_diag_req_vals[] = {
237 { 0x0000, "Function directory" },
238 { 0x1000, "DevCat statistic" },
239 { 0x2000, "Reset statistic" },
240 { 0x3000, "Consumer Comm. Events" },
241 { 0x4000, "Provider Comm. Events" },
245 static const true_false_string cba_acco_call_flags = {
246 "Consumer calls Provider (TRUE)",
247 "Provider calls Consumer (FALSE)"
250 static const value_string cba_qos_type_short_vals[] = {
252 { 0x01, "DCOM(sec)" }, /* obsolete */
261 typedef struct cba_frame_s {
262 cba_ldev_t *consparent;
263 cba_ldev_t *provparent;
265 guint packet_connect;
266 guint packet_disconnect;
267 guint packet_disconnectme;
272 const guint8 consmac[6];
281 typedef struct cba_connection_s {
282 cba_ldev_t *consparentacco;
283 cba_ldev_t *provparentacco;
284 cba_frame_t *parentframe;
285 guint packet_connect;
286 guint packet_disconnect;
287 guint packet_disconnectme;
294 const gchar *provitem;
300 guint16 frame_offset;
304 typedef struct server_frame_call_s {
306 cba_frame_t **frames;
307 } server_frame_call_t;
310 typedef struct server_connect_call_s {
313 cba_connection_t **conns;
314 } server_connect_call_t;
316 typedef struct server_disconnectme_call_s {
319 } server_disconnectme_call_t;
324 /* as we are a plugin, we cannot get this from libwireshark! */
325 const true_false_string acco_flags_set_truth = { "Set", "Not set" };
329 cba_connection_dump(cba_connection_t *conn, const char *role)
331 if (conn->qostype != 0x30) {
332 g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Data#%5u-#%5u",
334 conn->packet_connect,
335 conn->consid, conn->provid, conn->provitem,
336 conn->typedesclen != 0 ? val_to_str(conn->typedesc[0], dcom_variant_type_vals, "Unknown (0x%08x)") : "-",
337 val_to_str(conn->qostype, cba_qos_type_short_vals, "0x%x"), conn->qosvalue,
338 conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"),
339 conn->packet_first, conn->packet_last);
341 g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Off:%u",
343 conn->packet_connect,
344 conn->consid, conn->provid, conn->provitem,
345 conn->typedesclen != 0 ? val_to_str(conn->typedesc[0], dcom_variant_type_vals, "Unknown (0x%08x)") : "-",
346 val_to_str(conn->qostype, cba_qos_type_short_vals, "0x%x"), conn->qosvalue,
347 conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"),
354 cba_object_dump(void)
365 for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) {
367 g_warning("PDev #%5u: %s IFs:%u", pdev->first_packet, ip_to_str(pdev->ip),
368 pdev->object ? g_list_length(pdev->object->interfaces) : 0);
370 for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) {
372 g_warning(" LDev#%5u: \"%s\" LDevIFs:%u AccoIFs:%u", ldev->first_packet, ldev->name,
373 ldev->ldev_object ? g_list_length(ldev->ldev_object->interfaces) : 0,
374 ldev->acco_object ? g_list_length(ldev->acco_object->interfaces) : 0);
375 for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
376 frame = frames->data;
377 g_warning(" ConsFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u",
378 frame->packet_connect, frame->conscrid, frame->provcrid, frame->length,
379 frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"),
380 frame->packet_first, frame->packet_last);
381 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
382 cba_connection_dump(conns->data, "ConsConn");
385 for(frames = ldev->provframes; frames != NULL; frames = g_list_next(frames)) {
386 frame = frames->data;
387 g_warning(" ProvFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u",
388 frame->packet_connect, frame->conscrid, frame->provcrid, frame->length,
389 frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"),
390 frame->packet_first, frame->packet_last);
391 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
392 cba_connection_dump(conns->data, "ProvConn");
395 for(conns = ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
396 cba_connection_dump(conns->data, "ConsConn");
398 for(conns = ldev->provconns; conns != NULL; conns = g_list_next(conns)) {
399 cba_connection_dump(conns->data, "ProvConn");
408 cba_pdev_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid)
411 dcom_interface_t *interf;
414 interf = dcom_interface_find(pinfo, ip, ipid);
415 if (interf != NULL) {
416 pdev = interf->parent->private_data;
418 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "pdev_find: no pdev for IP:%s IPID:%s",
419 ip_to_str(ip), guids_resolve_uuid_to_str(ipid));
422 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "pdev_find: unknown interface of IP:%s IPID:%s",
423 ip_to_str(ip), guids_resolve_uuid_to_str(ipid));
432 cba_pdev_add(packet_info *pinfo, const guint8 *ip)
439 for(cba_iter = cba_pdevs; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
440 pdev = cba_iter->data;
441 if (memcmp(pdev->ip, ip, 4) == 0) {
446 /* not found, create a new */
447 pdev = se_alloc(sizeof(cba_pdev_t));
448 memcpy( (void *) (pdev->ip), ip, 4);
449 pdev->first_packet = pinfo->fd->num;
452 cba_pdevs = g_list_append(cba_pdevs, pdev);
459 cba_pdev_link(packet_info *pinfo _U_, cba_pdev_t *pdev, dcom_interface_t *pdev_interf)
462 /* "crosslink" pdev interface and it's object */
463 pdev->object = pdev_interf->parent;
464 pdev_interf->private_data = pdev;
465 if (pdev_interf->parent) {
466 pdev_interf->parent->private_data = pdev;
472 cba_ldev_link(packet_info *pinfo _U_, cba_ldev_t *ldev, dcom_interface_t *ldev_interf)
475 /* "crosslink" interface and it's object */
476 ldev->ldev_object = ldev_interf->parent;
477 ldev_interf->private_data = ldev;
478 if (ldev_interf->parent) {
479 ldev_interf->parent->private_data = ldev;
485 cba_ldev_link_acco(packet_info *pinfo _U_, cba_ldev_t *ldev, dcom_interface_t *acco_interf)
488 /* "crosslink" interface and it's object */
489 ldev->acco_object = acco_interf->parent;
490 acco_interf->private_data = ldev;
491 if (acco_interf->parent) {
492 acco_interf->parent->private_data = ldev;
498 cba_ldev_add(packet_info *pinfo, cba_pdev_t *pdev, const char *name)
505 for(cba_iter = pdev->ldevs; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
506 ldev = cba_iter->data;
507 if (strcmp(ldev->name, name) == 0) {
512 /* not found, create a new */
513 ldev = se_alloc(sizeof(cba_ldev_t));
514 ldev->name = se_strdup(name);
515 ldev->first_packet = pinfo->fd->num;
516 ldev->ldev_object = NULL;
517 ldev->acco_object = NULL;
520 ldev->provframes = NULL;
521 ldev->consframes = NULL;
522 ldev->provconns = NULL;
523 ldev->consconns = NULL;
525 pdev->ldevs = g_list_append(pdev->ldevs, ldev);
532 cba_ldev_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid) {
533 /*dcerpc_info *info = (dcerpc_info *)pinfo->private_data;*/
534 dcom_interface_t *interf;
538 interf = dcom_interface_find(pinfo, ip, ipid);
539 if (interf != NULL) {
540 ldev = interf->private_data;
543 ldev = interf->parent->private_data;
546 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "Unknown LDev of %s",
550 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "Unknown IPID of %s",
560 cba_acco_add(packet_info *pinfo, const char *acco)
569 ip_str = g_strdup(acco);
570 delim = strchr(ip_str, '!');
577 if (!get_host_ipaddr(ip_str, &ip)) {
582 pdev = cba_pdev_add(pinfo, (guint8 *) &ip);
585 ldev = cba_ldev_add(pinfo, pdev, delim);
594 cba_packet_in_range(packet_info *pinfo, guint packet_connect, guint packet_disconnect, guint packet_disconnectme)
597 if (packet_connect == 0) {
598 g_warning("cba_packet_in_range#%u: packet_connect not set?", pinfo->fd->num);
601 if (packet_connect == 0 || pinfo->fd->num < packet_connect) {
604 if (packet_disconnect != 0 && pinfo->fd->num > packet_disconnect) {
607 if (packet_disconnectme != 0 && pinfo->fd->num > packet_disconnectme) {
616 cba_frame_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_frame_t *frame)
620 proto_item *sub_item;
621 proto_tree *sub_tree;
623 sub_item = proto_tree_add_text(tree, tvb, 0, 0,
624 "Cons:\"%s\" CCRID:0x%x Prov:\"%s\" PCRID:0x%x QoS:%s/%ums Len:%u",
625 frame->consparent ? frame->consparent->name : "", frame->conscrid,
626 frame->provparent ? frame->provparent->name : "", frame->provcrid,
627 val_to_str(frame->qostype, cba_qos_type_short_vals, "%u"),
628 frame->qosvalue, frame->length);
629 sub_tree = proto_item_add_subtree(sub_item, ett_cba_frame_info);
630 PROTO_ITEM_SET_GENERATED(sub_item);
632 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type, tvb, 0, 0, frame->qostype);
633 PROTO_ITEM_SET_GENERATED(item);
634 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_value, tvb, 0, 0, frame->qosvalue);
635 PROTO_ITEM_SET_GENERATED(item);
636 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_cr_id, tvb, 0, 0, frame->conscrid);
637 PROTO_ITEM_SET_GENERATED(item);
638 item = proto_tree_add_uint(sub_tree, hf_cba_acco_prov_crid, tvb, 0, 0, frame->provcrid);
639 PROTO_ITEM_SET_GENERATED(item);
640 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_cr_length, tvb, 0, 0, frame->length);
641 PROTO_ITEM_SET_GENERATED(item);
643 if (frame->consparent != NULL) {
644 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_consumer, tvb, 0, 0, frame->consparent->name);
645 PROTO_ITEM_SET_GENERATED(item);
647 if (frame->provparent != NULL) {
648 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider, tvb, 0, 0, frame->provparent->name);
649 PROTO_ITEM_SET_GENERATED(item);
652 item = proto_tree_add_uint(sub_tree, hf_cba_connectcr_in,
653 tvb, 0, 0, frame->packet_connect);
654 PROTO_ITEM_SET_GENERATED(item);
655 item = proto_tree_add_uint(sub_tree, hf_cba_data_first_in,
656 tvb, 0, 0, frame->packet_first);
657 PROTO_ITEM_SET_GENERATED(item);
658 item = proto_tree_add_uint(sub_tree, hf_cba_data_last_in,
659 tvb, 0, 0, frame->packet_last);
660 PROTO_ITEM_SET_GENERATED(item);
661 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectcr_in,
662 tvb, 0, 0, frame->packet_disconnect);
663 PROTO_ITEM_SET_GENERATED(item);
664 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectme_in,
665 tvb, 0, 0, frame->packet_disconnectme);
666 PROTO_ITEM_SET_GENERATED(item);
672 cba_frame_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev,
673 guint16 qostype, guint16 qosvalue, const guint8 *consmac, guint16 conscrid, guint16 length)
679 for(cba_iter = cons_ldev->consframes; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
680 frame = cba_iter->data;
681 if ( frame->conscrid == conscrid &&
682 memcmp(frame->consmac, consmac, 6) == 0 &&
683 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
688 frame = se_alloc(sizeof(cba_frame_t));
690 frame->consparent = cons_ldev;
691 frame->provparent = prov_ldev;
693 frame->packet_connect = pinfo->fd->num;
694 frame->packet_disconnect = 0;
695 frame->packet_disconnectme = 0;
696 frame->packet_first = 0;
697 frame->packet_last = 0;
699 frame->length = length;
700 memcpy( (guint8 *) (frame->consmac), consmac, sizeof(frame->consmac));
701 frame->conscrid = conscrid;
702 frame->qostype = qostype;
703 frame->qosvalue = qosvalue;
709 frame->conncrret = -1;
711 cons_ldev->consframes = g_list_append(cons_ldev->consframes, frame);
712 prov_ldev->provframes = g_list_append(prov_ldev->provframes, frame);
719 cba_frame_disconnect(packet_info *pinfo, cba_frame_t *frame)
722 if (frame->packet_disconnect == 0) {
723 frame->packet_disconnect = pinfo->fd->num;
726 if (frame->packet_disconnect != pinfo->fd->num) {
727 g_warning("cba_frame_disconnect#%u: frame already disconnected in #%u",
728 pinfo->fd->num, frame->packet_disconnect);
734 cba_frame_disconnectme(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev)
740 for(frames = cons_ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
741 frame = frames->data;
743 if ( frame->provparent == prov_ldev &&
744 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
746 cba_frame_info(tvb, pinfo, tree, frame);
748 if (frame->packet_disconnectme == 0) {
749 frame->packet_disconnectme = pinfo->fd->num;
752 if (frame->packet_disconnectme != pinfo->fd->num) {
753 g_warning("cba_frame_disconnectme#%u: frame already disconnectme'd in #%u",
754 pinfo->fd->num, frame->packet_disconnectme);
762 cba_frame_find_by_cons(packet_info *pinfo, const guint8 *consmac, guint16 conscrid)
773 for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) {
777 for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) {
781 for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
782 frame = frames->data;
784 if ( frame->conscrid == conscrid &&
785 memcmp(frame->consmac, consmac, 6) == 0 &&
786 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
798 cba_frame_find_by_provcrid(packet_info *pinfo, cba_ldev_t *prov_ldev, guint32 provcrid)
804 if (prov_ldev == NULL) {
808 for(frames = prov_ldev->provframes; frames != NULL; frames = g_list_next(frames)) {
809 frame = frames->data;
811 if ( frame->provcrid == provcrid &&
812 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
817 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
818 "Unknown provider frame ProvCRID");
825 cba_frame_incoming_data(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_frame_t *frame)
827 if (frame->packet_first == 0) {
828 frame->packet_first = pinfo->fd->num;
831 if ( pinfo->fd->num > frame->packet_last &&
832 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
833 frame->packet_last = pinfo->fd->num;
839 cba_connection_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_connection_t *conn)
843 proto_item *sub_item;
844 proto_tree *sub_tree;
846 if (conn->qostype != 0x30) {
847 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x QoS:%s/%ums",
848 conn->provitem, conn->provid, conn->consid,
849 val_to_str(conn->qostype, cba_qos_type_short_vals, "%u"), conn->qosvalue);
851 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x Len:%u",
852 conn->provitem, conn->provid, conn->consid, conn->length);
854 sub_tree = proto_item_add_subtree(sub_item, ett_cba_conn_info);
855 PROTO_ITEM_SET_GENERATED(sub_item);
857 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider_item, tvb, 0, 0 /* len */, conn->provitem);
858 PROTO_ITEM_SET_GENERATED(item);
859 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_prov_id, tvb, 0, 0 /* len */, conn->provid);
860 PROTO_ITEM_SET_GENERATED(item);
861 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_cons_id, tvb, 0, 0 /* len */, conn->consid);
862 PROTO_ITEM_SET_GENERATED(item);
863 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_record_length, tvb, 0, 0 /* len */, conn->length);
864 PROTO_ITEM_SET_GENERATED(item);
866 if (conn->qostype != 0x30) {
867 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type,
868 tvb, 0, 0, conn->qostype);
869 PROTO_ITEM_SET_GENERATED(item);
870 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_value,
871 tvb, 0, 0, conn->qosvalue);
872 PROTO_ITEM_SET_GENERATED(item);
873 item = proto_tree_add_uint(sub_tree, hf_cba_connect_in,
874 tvb, 0, 0, conn->packet_connect);
875 PROTO_ITEM_SET_GENERATED(item);
876 item = proto_tree_add_uint(sub_tree, hf_cba_data_first_in,
877 tvb, 0, 0, conn->packet_first);
878 PROTO_ITEM_SET_GENERATED(item);
879 item = proto_tree_add_uint(sub_tree, hf_cba_data_last_in,
880 tvb, 0, 0, conn->packet_last);
881 PROTO_ITEM_SET_GENERATED(item);
882 item = proto_tree_add_uint(sub_tree, hf_cba_disconnect_in,
883 tvb, 0, 0, conn->packet_disconnect);
884 PROTO_ITEM_SET_GENERATED(item);
885 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectme_in,
886 tvb, 0, 0, conn->packet_disconnectme);
887 PROTO_ITEM_SET_GENERATED(item);
893 static cba_connection_t *
894 cba_connection_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev, cba_frame_t *cons_frame,
895 guint16 qostype, guint16 qosvalue, const char *provitem, guint32 consid, guint16 length,
896 guint16 *typedesc, guint16 typedesclen)
899 cba_connection_t *conn;
902 /* find connection */
903 if (cons_frame != NULL) {
904 /* SRT: search in frame */
905 for(cba_iter = cons_frame->conns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
906 conn = cba_iter->data;
907 if (conn->consid == consid) {
912 /* DCOM: search in ldev */
913 for(cba_iter = cons_ldev->consconns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
914 conn = cba_iter->data;
915 if ( conn->consid == consid &&
916 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
922 conn = se_alloc(sizeof(cba_connection_t));
924 conn->consparentacco = cons_ldev;
925 conn->provparentacco = prov_ldev;
926 conn->parentframe = cons_frame;
928 conn->packet_connect = pinfo->fd->num;
929 conn->packet_disconnect = 0;
930 conn->packet_disconnectme = 0;
931 conn->packet_first = 0;
932 conn->packet_last = 0;
934 conn->consid = consid;
935 conn->provitem = se_strdup(provitem);
936 conn->typedesclen = typedesclen;
937 conn->typedesc = typedesc;
938 conn->qostype = qostype;
939 conn->qosvalue = qosvalue;
940 conn->length = length;
945 if (cons_frame != NULL) {
946 conn->frame_offset = cons_frame->offset;
947 conn->length = length;
948 cons_frame->offset += length;
949 cons_frame->conns = g_list_append(cons_frame->conns, conn);
951 conn->frame_offset = 0;
952 cons_ldev->consconns = g_list_append(cons_ldev->consconns, conn);
953 prov_ldev->provconns = g_list_append(prov_ldev->provconns, conn);
961 cba_connection_disconnect(packet_info *pinfo, cba_connection_t *conn)
963 /* XXX - detect multiple disconnects? */
964 if (conn->packet_disconnect == 0) {
965 conn->packet_disconnect = pinfo->fd->num;
968 if (conn->packet_disconnect != pinfo->fd->num) {
969 g_warning("connection_disconnect#%u: already disconnected",
970 conn->packet_disconnect);
976 cba_connection_disconnectme(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev)
979 cba_connection_t *conn;
982 for(conns = cons_ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
985 if ( conn->provparentacco == prov_ldev &&
986 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
988 cba_connection_info(tvb, pinfo, tree, conn);
990 if (conn->packet_disconnectme == 0) {
991 conn->packet_disconnectme = pinfo->fd->num;
994 if (conn->packet_disconnectme != pinfo->fd->num) {
995 g_warning("connection_disconnectme#%u: already disconnectme'd",
996 conn->packet_disconnectme);
1003 static cba_connection_t *
1004 cba_connection_find_by_provid(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_ldev_t *prov_ldev, guint32 provid)
1007 cba_connection_t *conn;
1010 for(cba_iter = prov_ldev->provconns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
1011 conn = cba_iter->data;
1012 if ( conn->provid == provid &&
1013 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
1022 cba_connection_incoming_data(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_connection_t *conn)
1024 if (conn->packet_first == 0) {
1025 conn->packet_first = pinfo->fd->num;
1028 if ( pinfo->fd->num > conn->packet_last &&
1029 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
1030 conn->packet_last = pinfo->fd->num;
1035 /* dissect a response containing an array of hresults (e.g: ICBAAccoMgt::RemoveConnections) */
1037 dissect_HResultArray_resp(tvbuff_t *tvb, int offset,
1038 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1042 guint32 u32ArraySize = 0;
1047 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1049 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1053 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1057 u32Tmp = u32ArraySize;
1059 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1060 &u32HResult, u32Idx);
1065 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1068 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1070 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1077 dissect_ICBAAccoServer_SetActivation_resp(tvbuff_t *tvb, int offset,
1078 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1082 guint32 u32ArraySize = 0;
1088 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1090 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1091 PROTO_ITEM_SET_GENERATED(item);
1092 pinfo->profinet_type = 1;
1094 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1098 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1102 u32Tmp = u32ArraySize;
1104 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1105 &u32HResult, u32Idx);
1110 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1113 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1115 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1122 dissect_ICBAAccoServerSRT_Disconnect_resp(tvbuff_t *tvb, int offset,
1123 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1127 guint32 u32ArraySize = 0;
1133 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1135 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1136 PROTO_ITEM_SET_GENERATED(item);
1137 pinfo->profinet_type = 3;
1139 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1143 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1147 u32Tmp = u32ArraySize;
1149 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1150 &u32HResult, u32Idx);
1155 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1158 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1160 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1167 dissect_ICBAAccoServerSRT_SetActivation_resp(tvbuff_t *tvb, int offset,
1168 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1172 guint32 u32ArraySize = 0;
1178 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1180 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1181 PROTO_ITEM_SET_GENERATED(item);
1182 pinfo->profinet_type = 3;
1184 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1188 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1192 u32Tmp = u32ArraySize;
1194 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1195 &u32HResult, u32Idx);
1200 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1203 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1205 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1212 dissect_ICBAAccoServer_Connect_rqst(tvbuff_t *tvb, int offset,
1213 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1216 guint16 u16QoSValue;
1219 guint32 u32ArraySize;
1221 guint32 u32VariableOffset;
1222 guint32 u32SubStart;
1226 gchar szItem[1000] = { 0 };
1227 guint32 u32MaxItemLen = sizeof(szItem);
1228 gchar szCons[1000] = { 0 };
1229 guint32 u32MaxConsLen = sizeof(szCons);
1233 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1234 dcom_interface_t *cons_interf;
1235 cba_ldev_t *cons_ldev;
1236 cba_ldev_t *prov_ldev;
1237 cba_connection_t *conn;
1238 server_connect_call_t *call;
1241 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1243 /* get corresponding provider ldev */
1244 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1246 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1247 PROTO_ITEM_SET_GENERATED(item);
1248 pinfo->profinet_type = 2;
1250 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1251 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
1253 /* find the consumer ldev by it's name */
1254 cons_ldev = cba_acco_add(pinfo, szCons);
1256 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1257 hf_cba_acco_conn_qos_type, &u16QoSType);
1258 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1259 hf_cba_acco_conn_qos_value, &u16QoSValue);
1260 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
1261 hf_cba_acco_conn_state, &u8State);
1263 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
1264 if (cons_interf == NULL) {
1265 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1266 "Server_Connect: consumer interface invalid");
1269 /* "crosslink" consumer interface and it's object */
1270 if (cons_interf != NULL && cons_ldev != NULL) {
1271 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
1274 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1275 hf_cba_acco_count, &u32Count);
1277 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1280 /* link connections infos to the call */
1281 if (prov_ldev != NULL && cons_ldev != NULL) {
1282 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1283 call->conn_count = 0;
1285 call->conns = (cba_connection_t **) (call+1);
1286 info->call_data->private_data = call;
1291 u32VariableOffset = offset + u32ArraySize*16;
1293 /* array of CONNECTINs */
1295 while (u32ArraySize--) {
1296 proto_item *sub_item;
1297 proto_tree *sub_tree;
1299 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, ENC_NA);
1300 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
1301 u32SubStart = offset;
1304 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1307 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1308 hf_cba_acco_conn_provider_item, szItem, u32MaxItemLen);
1312 offset = dissect_dcom_VARTYPE(tvb, offset, pinfo, sub_tree, drep,
1316 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1319 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1320 hf_cba_acco_conn_epsilon);
1323 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1324 hf_cba_acco_conn_cons_id, &u32ConsID);
1326 /* add to object database */
1327 if (prov_ldev != NULL && cons_ldev != NULL) {
1328 conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL,
1329 u16QoSType, u16QoSValue, szItem, u32ConsID, 0,
1330 /* XXX - VarType must be translated to new type description if it includes an array (0x2000) */
1331 se_memdup(&u16VarType, 2), 1);
1333 cba_connection_info(tvb, pinfo, sub_tree, conn);
1338 /* add to current call */
1341 call->conns[u32Idx-1] = conn;
1344 /* update subtree header */
1345 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", VarType=%s",
1346 u32Idx, u32ConsID, szItem,
1347 val_to_str(u16VarType, dcom_variant_type_vals, "Unknown (0x%04x)") );
1348 proto_item_set_len(sub_item, offset - u32SubStart);
1353 col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count);
1355 return u32VariableOffset;
1359 dissect_ICBAAccoServer2_Connect2_rqst(tvbuff_t *tvb, int offset,
1360 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1363 guint16 u16QoSValue;
1366 guint32 u32ArraySize;
1368 guint32 u32VariableOffset;
1369 guint32 u32SubStart;
1373 gchar szItem[1000] = { 0 };
1374 guint32 u32MaxItemLen = sizeof(szItem);
1375 gchar szCons[1000] = { 0 };
1376 guint32 u32MaxConsLen = sizeof(szCons);
1378 guint16 u16TypeDescLen;
1379 guint32 u32ArraySize2;
1381 guint16 u16VarType2 = -1;
1384 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1385 dcom_interface_t *cons_interf;
1386 cba_ldev_t *prov_ldev;
1387 cba_ldev_t *cons_ldev;
1388 cba_connection_t *conn;
1389 guint16 typedesclen = 0;
1390 guint16 *typedesc = NULL;
1391 server_connect_call_t *call = NULL;
1394 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1396 /* get corresponding provider ldev */
1397 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1399 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1400 PROTO_ITEM_SET_GENERATED(item);
1401 pinfo->profinet_type = 2;
1403 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1404 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
1406 /* find the consumer ldev by it's name */
1407 cons_ldev = cba_acco_add(pinfo, szCons);
1409 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1410 hf_cba_acco_conn_qos_type, &u16QoSType);
1411 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1412 hf_cba_acco_conn_qos_value, &u16QoSValue);
1413 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
1414 hf_cba_acco_conn_state, &u8State);
1416 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, &u32Pointer);
1419 offset = dissect_dcom_MInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
1420 if (cons_interf == NULL) {
1421 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1422 "Server2_Connect2: consumer interface invalid");
1425 /* GetConnectionData do it this way */
1429 /* "crosslink" consumer interface and it's object */
1430 if (cons_interf != NULL && cons_ldev != NULL) {
1431 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
1434 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1435 hf_cba_acco_count, &u32Count);
1437 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1440 /* link connection infos to the call */
1441 if (prov_ldev != NULL && cons_ldev != NULL) {
1442 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1443 call->conn_count = 0;
1445 call->conns = (cba_connection_t **) (call+1);
1446 info->call_data->private_data = call;
1451 u32VariableOffset = offset + u32ArraySize*20;
1453 /* array of CONNECTINs */
1455 while (u32ArraySize--) {
1456 proto_item *sub_item;
1457 proto_tree *sub_tree;
1459 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, ENC_NA);
1460 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
1461 u32SubStart = offset;
1464 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1467 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1468 hf_cba_acco_conn_provider_item, szItem, u32MaxItemLen);
1472 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
1473 hf_cba_type_desc_len, &u16TypeDescLen);
1475 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1479 u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1482 /* limit the allocation to a reasonable size */
1483 if (u32ArraySize2 < 1000) {
1484 typedesc = se_alloc0(u32ArraySize2 * 2);
1485 typedesclen = u32ArraySize2;
1491 /* extended type description will build an array here */
1493 while (u32ArraySize2--) {
1494 /* ToBeDone: some of the type description values are counts */
1495 u32VariableOffset = dissect_dcom_VARTYPE(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1498 if (typedesc != NULL && u32Idx2 <= typedesclen) {
1499 typedesc[u32Idx2-1] = u16VarType;
1502 /* remember first VarType only */
1504 u16VarType2 = u16VarType;
1511 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1514 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1515 hf_cba_acco_conn_epsilon);
1518 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1519 hf_cba_acco_conn_cons_id, &u32ConsID);
1521 /* add to object database */
1522 if (prov_ldev != NULL && cons_ldev != NULL) {
1523 conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL,
1524 u16QoSType, u16QoSValue, szItem, u32ConsID, 0,
1525 typedesc, typedesclen);
1527 cba_connection_info(tvb, pinfo, sub_tree, conn);
1532 /* add to current call */
1535 call->conns[u32Idx-1] = conn;
1538 /* update subtree header */
1539 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", TypeDesc=%s",
1540 u32Idx, u32ConsID, szItem,
1541 val_to_str(u16VarType2, dcom_variant_type_vals, "Unknown (0x%04x)") );
1542 proto_item_set_len(sub_item, offset - u32SubStart);
1547 col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count);
1550 return u32VariableOffset;
1555 dissect_ICBAAccoServer_Connect_resp(tvbuff_t *tvb, int offset,
1556 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1558 guint8 u8FirstConnect;
1560 guint32 u32ArraySize = 0;
1564 guint32 u32SubStart;
1567 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1568 cba_connection_t *conn;
1569 server_connect_call_t *call = info->call_data->private_data;
1572 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1575 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1576 "No request info, response data ignored");
1579 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1580 PROTO_ITEM_SET_GENERATED(item);
1581 pinfo->profinet_type = 1;
1583 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
1584 hf_cba_acco_server_first_connect, &u8FirstConnect);
1586 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1590 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1593 /* array of CONNECTOUTs */
1594 while(u32ArraySize--) {
1595 proto_item *sub_item;
1596 proto_tree *sub_tree;
1598 sub_item = proto_tree_add_item(tree, hf_cba_connectout, tvb, offset, 8, ENC_NA);
1599 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectout);
1600 u32SubStart = offset;
1602 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1603 hf_cba_acco_conn_prov_id, &u32ProvID);
1605 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
1606 &u32HResult, u32Idx);
1608 /* put response data into the connection */
1609 if (call && u32Idx <= call->conn_count) {
1610 conn = call->conns[u32Idx-1];
1611 conn->provid = u32ProvID;
1612 conn->connret = u32HResult;
1614 cba_connection_info(tvb, pinfo, sub_tree, conn);
1617 proto_item_append_text(sub_item, "[%u]: ProvID=0x%x %s",
1619 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1620 proto_item_set_len(sub_item, offset - u32SubStart);
1626 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1629 /* this might be a global HRESULT */
1630 while(call && u32Idx <= call->conn_count) {
1631 conn = call->conns[u32Idx-1];
1633 conn->connret = u32HResult;
1637 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u -> %s",
1638 (u8FirstConnect) ? "First" : "NotFirst",
1640 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1647 dissect_ICBAAccoServer_Disconnect_rqst(tvbuff_t *tvb, int offset,
1648 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1651 guint32 u32ArraySize;
1656 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1657 cba_ldev_t *prov_ldev;
1658 cba_connection_t *conn;
1659 server_connect_call_t *call;
1662 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1664 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1665 PROTO_ITEM_SET_GENERATED(item);
1666 pinfo->profinet_type = 2;
1668 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1669 hf_cba_acco_count, &u32Count);
1671 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1674 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1676 /* link connection infos to the call */
1677 if (prov_ldev != NULL) {
1678 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1679 call->conn_count = 0;
1681 call->conns = (cba_connection_t **) (call+1);
1682 info->call_data->private_data = call;
1688 while (u32ArraySize--) {
1689 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
1690 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
1692 /* add to current call */
1694 conn = cba_connection_find_by_provid(tvb, pinfo, tree, prov_ldev, u32ProvID);
1696 call->conns[u32Idx-1] = conn;
1702 /* update column info now */
1703 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
1711 dissect_ICBAAccoServer_Disconnect_resp(tvbuff_t *tvb, int offset,
1712 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1716 guint32 u32ArraySize = 0;
1721 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1722 cba_connection_t *conn;
1723 server_connect_call_t *call = info->call_data->private_data;
1726 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1729 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1730 "No request info, response data ignored");
1733 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1734 PROTO_ITEM_SET_GENERATED(item);
1735 pinfo->profinet_type = 1;
1737 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1741 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1745 u32Tmp = u32ArraySize;
1747 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1748 &u32HResult, u32Idx);
1750 /* mark this connection as disconnected */
1751 if (call && u32Idx <= call->conn_count) {
1752 conn = call->conns[u32Idx-1];
1754 cba_connection_disconnect(pinfo, conn);
1762 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1765 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1767 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1774 dissect_ICBAAccoServerSRT_Disconnect_rqst(tvbuff_t *tvb, int offset,
1775 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1778 guint32 u32ArraySize;
1784 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1786 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
1787 PROTO_ITEM_SET_GENERATED(item);
1788 pinfo->profinet_type = 4;
1790 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1791 hf_cba_acco_count, &u32Count);
1793 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1797 while (u32ArraySize--) {
1798 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
1799 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
1803 /* update column info now */
1804 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
1811 dissect_ICBAAccoServer_DisconnectMe_rqst(tvbuff_t *tvb, int offset,
1812 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1815 guint32 u32MaxStr = sizeof(szStr);
1817 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1818 cba_ldev_t *prov_ldev;
1819 cba_ldev_t *cons_ldev;
1820 server_disconnectme_call_t *call;
1823 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1825 /* get corresponding provider ldev */
1826 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1828 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1829 PROTO_ITEM_SET_GENERATED(item);
1830 pinfo->profinet_type = 2;
1832 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1833 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
1835 /* find the consumer ldev by it's name */
1836 cons_ldev = cba_acco_add(pinfo, szStr);
1838 if (prov_ldev != NULL && cons_ldev != NULL) {
1839 call = se_alloc(sizeof(server_disconnectme_call_t));
1840 call->cons = cons_ldev;
1841 call->prov = prov_ldev;
1842 info->call_data->private_data = call;
1845 /* update column info now */
1846 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
1853 dissect_ICBAAccoServer_DisconnectMe_resp(tvbuff_t *tvb, int offset,
1854 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1858 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1859 server_disconnectme_call_t *call;
1862 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1864 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1865 PROTO_ITEM_SET_GENERATED(item);
1866 pinfo->profinet_type = 1;
1868 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1871 call = info->call_data->private_data;
1873 cba_connection_disconnectme(tvb, pinfo, tree, call->cons, call->prov);
1876 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1877 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1884 dissect_ICBAAccoServerSRT_DisconnectMe_rqst(tvbuff_t *tvb, int offset,
1885 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1888 guint32 u32MaxStr = sizeof(szStr);
1890 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1891 cba_ldev_t *prov_ldev;
1892 cba_ldev_t *cons_ldev;
1893 server_disconnectme_call_t *call;
1896 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1898 /* get corresponding provider ldev */
1899 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1901 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
1902 PROTO_ITEM_SET_GENERATED(item);
1903 pinfo->profinet_type = 4;
1905 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1906 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
1908 /* find the consumer ldev by it's name */
1909 cons_ldev = cba_acco_add(pinfo, szStr);
1911 if (prov_ldev != NULL && cons_ldev != NULL) {
1912 call = se_alloc(sizeof(server_disconnectme_call_t));
1913 call->cons = cons_ldev;
1914 call->prov = prov_ldev;
1915 info->call_data->private_data = call;
1918 /* update column info now */
1919 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
1926 dissect_ICBAAccoServerSRT_DisconnectMe_resp(tvbuff_t *tvb, int offset,
1927 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1931 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1932 server_disconnectme_call_t *call;
1935 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1937 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1938 PROTO_ITEM_SET_GENERATED(item);
1939 pinfo->profinet_type = 3;
1941 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1944 call = info->call_data->private_data;
1946 cba_frame_disconnectme(tvb, pinfo, tree, call->cons, call->prov);
1949 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1950 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1957 dissect_ICBAAccoServer_Ping_resp(tvbuff_t *tvb, int offset,
1958 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1964 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1966 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1967 PROTO_ITEM_SET_GENERATED(item);
1968 pinfo->profinet_type = 1;
1970 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1973 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1974 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1981 dissect_ICBAAccoServer_SetActivation_rqst(tvbuff_t *tvb, int offset,
1982 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1986 guint32 u32ArraySize;
1992 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1994 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1995 PROTO_ITEM_SET_GENERATED(item);
1996 pinfo->profinet_type = 2;
1998 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
1999 hf_cba_acco_conn_state, &u8State);
2001 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2002 hf_cba_acco_count, &u32Count);
2004 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2008 while (u32ArraySize--) {
2009 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2010 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2014 /* update column info now */
2016 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2023 dissect_ICBAAccoServerSRT_SetActivation_rqst(tvbuff_t *tvb, int offset,
2024 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2028 guint32 u32ArraySize;
2034 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2036 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2037 PROTO_ITEM_SET_GENERATED(item);
2038 pinfo->profinet_type = 4;
2040 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2041 hf_cba_acco_conn_state, &u8State);
2043 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2044 hf_cba_acco_count, &u32Count);
2046 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2050 while (u32ArraySize--) {
2051 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2052 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2056 /* update column info now */
2057 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2064 dissect_ICBAAccoServer_Ping_rqst(tvbuff_t *tvb, int offset,
2065 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2068 guint32 u32MaxStr = sizeof(szStr);
2072 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2074 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
2075 PROTO_ITEM_SET_GENERATED(item);
2076 pinfo->profinet_type = 2;
2078 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
2079 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
2081 /* update column info now */
2082 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
2089 dissect_ICBAAccoServerSRT_ConnectCR_rqst(tvbuff_t *tvb, int offset,
2090 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2092 gchar szCons[1000] = { 0 };
2093 guint32 u32MaxConsLen = sizeof(szCons);
2095 guint16 u16QoSValue;
2096 guint8 u8ConsMac[6];
2097 guint16 u16CRID = 0;
2098 guint16 u16CRLength = 0;
2101 guint32 u32ArraySize;
2104 proto_tree *flags_tree;
2105 guint32 u32SubStart;
2106 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2107 dcom_interface_t *cons_interf;
2108 cba_ldev_t *prov_ldev;
2109 cba_ldev_t *cons_ldev;
2111 server_frame_call_t *call;
2114 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2116 /* get corresponding provider ldev */
2117 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2119 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2120 PROTO_ITEM_SET_GENERATED(item);
2121 pinfo->profinet_type = 4;
2124 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
2125 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
2127 /* find the consumer ldev by it's name */
2128 cons_ldev = cba_acco_add(pinfo, szCons);
2130 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
2131 hf_cba_acco_conn_qos_type, &u16QoSType);
2132 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
2133 hf_cba_acco_conn_qos_value, &u16QoSValue);
2135 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
2136 if (cons_interf == NULL) {
2137 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2138 "ServerSRT_ConnectCR: consumer interface invalid");
2141 /* "crosslink" consumer interface and it's object */
2142 if (cons_interf != NULL && cons_ldev != NULL) {
2143 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
2146 /* ConsumerMAC (big-endian, 1byte-aligned) */
2147 tvb_memcpy(tvb, u8ConsMac, offset, 6);
2149 proto_tree_add_ether(tree, hf_cba_acco_serversrt_cons_mac, tvb,
2150 offset, 6, u8ConsMac);
2153 /* add flags subtree */
2154 offset = dissect_dcom_DWORD(tvb, offset, pinfo, NULL /*tree*/, drep,
2155 0 /* hfindex */, &u32Flags);
2157 item = proto_tree_add_uint_format_value(tree, hf_cba_acco_serversrt_cr_flags,
2158 tvb, offset, 4, u32Flags,
2159 "0x%02x (%s, %s)", u32Flags,
2160 (u32Flags & 0x2) ? "Reconfigure" : "not Reconfigure",
2161 (u32Flags & 0x1) ? "Timestamped" : "not Timestamped");
2162 flags_tree = proto_item_add_subtree(item, ett_cba_acco_serversrt_cr_flags);
2163 proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_reconfigure, tvb, offset, 4, u32Flags);
2164 proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_timestamped, tvb, offset, 4, u32Flags);
2167 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2168 hf_cba_acco_count, &u32Count);
2170 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2173 /* link frame infos to the call */
2174 if (prov_ldev != NULL && cons_ldev != NULL && u32ArraySize < 100) {
2175 call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *));
2176 call->frame_count = 0;
2177 call->frames = (cba_frame_t **) (call+1);
2178 info->call_data->private_data = call;
2184 while (u32ArraySize--) {
2185 proto_item *sub_item;
2186 proto_tree *sub_tree;
2188 /* array of CONNECTINCRs */
2189 sub_item = proto_tree_add_item(tree, hf_cba_connectincr, tvb, offset, 0, ENC_NA);
2190 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectincr);
2191 u32SubStart = offset;
2193 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2194 hf_cba_acco_serversrt_cr_id, &u16CRID);
2196 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2197 hf_cba_acco_serversrt_cr_length, &u16CRLength);
2199 /* add to object database */
2200 if (prov_ldev != NULL && cons_ldev != NULL) {
2201 frame = cba_frame_connect(pinfo, cons_ldev, prov_ldev, u16QoSType, u16QoSValue, u8ConsMac, u16CRID, u16CRLength);
2203 cba_frame_info(tvb, pinfo, sub_tree, frame);
2208 /* add to current call */
2210 call->frame_count++;
2211 call->frames[u32Idx-1] = frame;
2214 /* update subtree header */
2215 proto_item_append_text(sub_item, "[%u]: CRID=0x%x, CRLength=%u",
2216 u32Idx, u16CRID, u16CRLength);
2217 proto_item_set_len(sub_item, offset - u32SubStart);
2223 /* update column info now */
2224 col_append_fstr(pinfo->cinfo, COL_INFO, ": %sConsCRID=0x%x Len=%u QoS=%u",
2225 (u32Flags & 0x2) ? "Reco " : "", u16CRID, u16CRLength, u16QoSValue);
2232 dissect_ICBAAccoServerSRT_ConnectCR_resp(tvbuff_t *tvb, int offset,
2233 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2235 guint8 u8FirstConnect;
2236 guint8 u8ProvMac[6];
2237 guint32 u32ProvCRID = 0;
2239 guint32 u32ArraySize;
2242 guint32 u32SubStart;
2245 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2246 server_frame_call_t *call = info->call_data->private_data;
2249 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2252 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2253 "No request info, response data ignored");
2256 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2257 PROTO_ITEM_SET_GENERATED(item);
2258 pinfo->profinet_type = 3;
2260 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2261 hf_cba_acco_server_first_connect, &u8FirstConnect);
2263 /* ProviderMAC (big-endian, 1byte-aligned) */
2264 tvb_memcpy(tvb, u8ProvMac, offset, 6);
2266 proto_tree_add_ether(tree, hf_cba_acco_serversrt_prov_mac, tvb,
2267 offset, 6, u8ProvMac);
2271 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2275 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2278 while (u32ArraySize--) {
2279 proto_item *sub_item;
2280 proto_tree *sub_tree;
2282 /* array of CONNECTOUTCRs */
2283 sub_item = proto_tree_add_item(tree, hf_cba_connectoutcr, tvb, offset, 0, ENC_NA);
2284 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectoutcr);
2285 u32SubStart = offset;
2287 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2288 hf_cba_acco_prov_crid, &u32ProvCRID);
2290 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2293 /* put response data into the frame */
2294 if (call && u32Idx <= call->frame_count) {
2295 frame = call->frames[u32Idx-1];
2296 frame->provcrid = u32ProvCRID;
2297 frame->conncrret = u32HResult;
2299 cba_frame_info(tvb, pinfo, sub_tree, frame);
2302 /* update subtree header */
2303 proto_item_append_text(sub_item, "[%u]: ProvCRID=0x%x, %s",
2304 u32Idx, u32ProvCRID,
2305 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2306 proto_item_set_len(sub_item, offset - u32SubStart);
2312 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2315 /* this might be a global HRESULT */
2316 while(call && u32Idx <= call->frame_count) {
2317 frame = call->frames[u32Idx-1];
2318 frame->provcrid = 0;
2319 frame->conncrret = u32HResult;
2323 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s PCRID=0x%x -> %s",
2324 (u8FirstConnect) ? "FirstCR" : "NotFirstCR",
2326 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2333 dissect_ICBAAccoServerSRT_DisconnectCR_rqst(tvbuff_t *tvb, int offset,
2334 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2337 guint32 u32ArraySize;
2339 guint32 u32ProvCRID = 0;
2341 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2342 cba_ldev_t *prov_ldev;
2344 server_frame_call_t *call;
2347 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2349 /* get corresponding provider ldev */
2350 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2352 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2353 PROTO_ITEM_SET_GENERATED(item);
2354 pinfo->profinet_type = 4;
2356 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2357 hf_cba_acco_count, &u32Count);
2359 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2362 /* link frame infos to the call */
2363 if (prov_ldev != NULL) {
2364 call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *));
2365 call->frame_count = 0;
2366 call->frames = (cba_frame_t **) (call+1);
2367 info->call_data->private_data = call;
2373 while (u32ArraySize--) {
2374 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2375 hf_cba_acco_prov_crid, &u32ProvCRID, u32Idx);
2377 /* find frame and add it to current call */
2379 frame = cba_frame_find_by_provcrid(pinfo, prov_ldev, u32ProvCRID);
2380 call->frame_count++;
2381 call->frames[u32Idx-1] = frame;
2387 /* update column info now */
2388 col_append_fstr(pinfo->cinfo, COL_INFO, ": PCRID=0x%x",
2396 dissect_ICBAAccoServerSRT_DisconnectCR_resp(tvbuff_t *tvb, int offset,
2397 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2401 guint32 u32ArraySize = 0;
2406 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2407 server_frame_call_t *call = info->call_data->private_data;
2410 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2412 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2413 PROTO_ITEM_SET_GENERATED(item);
2414 pinfo->profinet_type = 3;
2416 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2420 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2424 u32Tmp = u32ArraySize;
2426 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
2427 &u32HResult, u32Idx);
2428 /* put response data into the frame */
2429 if (call && u32Idx <= call->frame_count) {
2430 frame = call->frames[u32Idx-1];
2431 if (frame != NULL) {
2432 cba_frame_disconnect(pinfo, frame);
2440 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2443 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2444 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2451 dissect_ICBAAccoServerSRT_Connect_rqst(tvbuff_t *tvb, int offset,
2452 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2454 guint32 u32ProvCRID;
2456 guint8 u8LastConnect;
2458 guint32 u32ArraySize;
2459 guint32 u32VariableOffset;
2461 guint32 u32SubStart;
2463 gchar szProvItem[1000] = { 0 };
2464 guint32 u32MaxProvItemLen = sizeof(szProvItem);
2465 guint16 u16TypeDescLen;
2466 guint32 u32ArraySize2;
2468 guint16 u16VarType2 = -1;
2471 guint16 u16RecordLength;
2474 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2475 cba_ldev_t *prov_ldev;
2476 cba_frame_t *frame = NULL;
2477 guint16 typedesclen = 0;
2478 guint16 *typedesc = NULL;
2480 cba_connection_t *conn;
2481 server_connect_call_t *call;
2484 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2486 /* get corresponding provider ldev */
2487 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2489 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2490 PROTO_ITEM_SET_GENERATED(item);
2491 pinfo->profinet_type = 4;
2493 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2494 hf_cba_acco_prov_crid, &u32ProvCRID);
2496 frame = cba_frame_find_by_provcrid(pinfo, prov_ldev, u32ProvCRID);
2498 if (frame != NULL) {
2499 cba_frame_info(tvb, pinfo, tree, frame);
2502 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
2503 hf_cba_acco_conn_state, &u8State);
2505 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
2506 hf_cba_acco_serversrt_last_connect, &u8LastConnect);
2509 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2510 hf_cba_acco_count, &u32Count);
2512 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2515 /* link connections infos to the call */
2516 if (frame != NULL) {
2517 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
2518 call->conn_count = 0;
2519 call->frame = frame;
2520 call->conns = (cba_connection_t **) (call+1);
2521 info->call_data->private_data = call;
2526 u32VariableOffset = offset + u32ArraySize*20;
2529 while (u32ArraySize--) {
2530 proto_item *sub_item;
2531 proto_tree *sub_tree;
2533 /* array of CONNECTINs */
2534 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, ENC_NA);
2535 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
2536 u32SubStart = offset;
2539 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2542 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2543 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
2547 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2548 hf_cba_type_desc_len, &u16TypeDescLen);
2550 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2554 u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2557 typedesc = se_alloc0(u32ArraySize2 * 2);
2558 typedesclen = u32ArraySize2;
2560 /* extended type description will build an array here */
2562 while (u32ArraySize2--) {
2563 /* ToBeDone: some of the type description values are counts */
2564 u32VariableOffset = dissect_dcom_VARTYPE(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2567 if (u32Idx2 <= typedesclen) {
2568 typedesc[u32Idx2-1] = u16VarType;
2571 /* remember first VarType only */
2573 u16VarType2 = u16VarType;
2580 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2581 hf_cba_acco_conn_cons_id, &u32ConsID);
2584 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2585 hf_cba_acco_serversrt_record_length, &u16RecordLength);
2587 /* add to object database */
2588 if (frame != NULL) {
2589 conn = cba_connection_connect(pinfo, frame->consparent, frame->provparent, frame,
2590 frame->qostype, frame->qosvalue, szProvItem, u32ConsID, u16RecordLength,
2591 typedesc, typedesclen);
2593 cba_connection_info(tvb, pinfo, sub_tree, conn);
2598 /* add to current call */
2601 call->conns[u32Idx-1] = conn;
2604 /* update subtree header */
2605 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", TypeDesc=%s",
2606 u32Idx, u32ConsID, szProvItem,
2607 val_to_str(u16VarType2, dcom_variant_type_vals, "Unknown (0x%04x)") );
2608 proto_item_set_len(sub_item, offset - u32SubStart);
2614 /* update column info now */
2615 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u PCRID=0x%x",
2616 (u8LastConnect) ? "LastOfCR" : "",
2620 return u32VariableOffset;
2625 dissect_ICBAAccoServerSRT_Connect_resp(tvbuff_t *tvb, int offset,
2626 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2629 guint32 u32ArraySize;
2631 guint32 u32SubStart;
2636 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2638 server_connect_call_t *call = info->call_data->private_data;
2639 cba_connection_t *conn;
2642 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2645 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2646 "No request info, response data ignored");
2649 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2650 PROTO_ITEM_SET_GENERATED(item);
2651 pinfo->profinet_type = 3;
2653 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2656 if (call && call->frame != NULL) {
2657 cba_frame_info(tvb, pinfo, tree, call->frame);
2661 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2664 /* array of CONNECTOUTs */
2665 while(u32ArraySize--) {
2666 proto_item *sub_item;
2667 proto_tree *sub_tree;
2669 sub_item = proto_tree_add_item(tree, hf_cba_connectout, tvb, offset, 8, ENC_NA);
2670 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectout);
2671 u32SubStart = offset;
2673 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2674 hf_cba_acco_conn_prov_id, &u32ProvID);
2676 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2677 &u32HResult, u32Idx);
2679 /* put response data into the frame */
2680 if (call && u32Idx <= call->conn_count) {
2681 conn = call->conns[u32Idx-1];
2682 conn->provid = u32ProvID;
2683 conn->connret = u32HResult;
2685 cba_connection_info(tvb, pinfo, sub_tree, conn);
2688 proto_item_append_text(sub_item, "[%u]: ProvID=0x%x %s",
2690 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2691 proto_item_set_len(sub_item, offset - u32SubStart);
2697 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2700 /* this might be a global HRESULT */
2701 while(call && u32Idx <= call->conn_count) {
2702 conn = call->conns[u32Idx-1];
2704 conn->connret = u32HResult;
2708 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
2710 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2717 dissect_Server_GetProvIDs_resp(tvbuff_t *tvb, int offset,
2718 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2722 guint32 u32ArraySize;
2728 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2730 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2731 hf_cba_acco_count, &u32Count);
2734 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ProvID=", u32Count);
2736 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2739 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2742 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2746 while (u32ArraySize--) {
2747 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo,
2749 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2752 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ProvID);
2753 } else if (u32Idx < 10) {
2754 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ProvID);
2755 } else if (u32Idx == 10) {
2756 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
2763 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2766 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2767 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2774 dissect_Server_GetProvConnections_rqst(tvbuff_t *tvb, int offset,
2775 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2778 guint32 u32ArraySize;
2783 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2785 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2786 hf_cba_acco_count, &u32Count);
2788 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2792 while (u32ArraySize--) {
2793 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2794 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2798 /* update column info now */
2799 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2806 dissect_Server_GetProvConnections_resp(tvbuff_t *tvb, int offset,
2807 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2810 guint32 u32TmpCount;
2812 guint32 u32VariableOffset;
2814 guint32 u32SubStart;
2815 gchar szCons[1000] = { 0 };
2816 guint32 u32MaxConsLen = sizeof(szCons);
2817 gchar szProvItem[1000] = { 0 };
2818 guint32 u32MaxProvItemLen = sizeof(szProvItem);
2821 guint16 u16QoSValue;
2826 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2828 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2831 u32VariableOffset = offset;
2834 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2835 hf_cba_acco_count, &u32Count);
2837 u32VariableOffset = offset + u32Count*28;
2839 /* array fixed part (including pointers to variable part) */
2840 u32TmpCount = u32Count;
2842 while (u32TmpCount--) {
2843 proto_item *sub_item;
2844 proto_tree *sub_tree;
2846 sub_item = proto_tree_add_item(tree, hf_cba_getprovconnout, tvb, offset, 0, ENC_NA);
2847 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getprovconnout);
2848 u32SubStart = offset;
2851 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2854 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2855 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
2857 /* wszProviderItem */
2858 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2861 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2862 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
2865 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2866 hf_cba_acco_conn_cons_id, &u32ConsID);
2869 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2872 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2873 hf_cba_acco_conn_epsilon);
2877 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2878 hf_cba_acco_conn_qos_type, &u16QoSType);
2880 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2881 hf_cba_acco_conn_qos_value, &u16QoSValue);
2883 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
2884 hf_cba_acco_conn_state, &u8State);
2886 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2887 &u32HResult, u32Idx);
2889 proto_item_append_text(sub_item, "[%u]: %s",
2891 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2892 proto_item_set_len(sub_item, offset - u32SubStart);
2898 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
2901 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2902 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2904 return u32VariableOffset;
2908 #define CBA_MRSH_VERSION_DCOM 0x01
2909 #define CBA_MRSH_VERSION_SRT_WITH_CONSID 0x10
2910 #define CBA_MRSH_VERSION_SRT_WITHOUT_CONSID 0x11
2914 dissect_CBA_Connection_Data(tvbuff_t *tvb,
2915 packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_frame_t *frame)
2919 guint16 u16CountFix;
2923 proto_item *conn_data_item = NULL;
2924 proto_tree *conn_data_tree = NULL;
2932 gboolean qc_reported = FALSE;
2934 int qc_uncertain = 0;
2938 cba_connection_t *conn;
2941 /*** ALL data in this buffer is NOT aligned and always little endian ordered ***/
2944 conn_data_item = proto_tree_add_item(tree, hf_cba_acco_cb_conn_data, tvb, offset, 0, ENC_NA);
2945 conn_data_tree = proto_item_add_subtree(conn_data_item, ett_ICBAAccoCallback_Buffer);
2948 /* add buffer header */
2949 u8Version = tvb_get_guint8 (tvb, offset);
2950 if (conn_data_tree) {
2951 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2955 u8Flags = tvb_get_guint8 (tvb, offset);
2956 if (conn_data_tree) {
2957 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2961 u16Count = tvb_get_letohs (tvb, offset);
2962 if (conn_data_tree) {
2963 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2966 u16CountFix = u16Count;
2968 /* show meta information */
2970 cba_frame_info(tvb, pinfo, conn_data_tree, frame);
2972 if (cons_ldev && cons_ldev->name) {
2974 item = proto_tree_add_string(conn_data_tree, hf_cba_acco_conn_consumer, tvb, offset, 0, cons_ldev->name);
2975 PROTO_ITEM_SET_GENERATED(item);
2979 /* update column info now */
2981 col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u", u16Count);
2984 /* is this an OnDataChanged buffer format (version), we know? */
2985 if ((u8Version != CBA_MRSH_VERSION_DCOM) &&
2986 (u8Version != CBA_MRSH_VERSION_SRT_WITH_CONSID) &&
2987 (u8Version != CBA_MRSH_VERSION_SRT_WITHOUT_CONSID))
2992 /* Timestamps are currently unused -> flags must be zero */
2999 while (u16Count--) {
3000 proto_item *sub_item;
3001 proto_tree *sub_tree;
3004 /* find next record header */
3005 u16Len = tvb_get_letohs (tvb, offset);
3007 /* trapped inside an empty hole? -> try to find next record header */
3009 (u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID ||
3010 u8Version == CBA_MRSH_VERSION_SRT_WITHOUT_CONSID))
3013 offset_hole = offset;
3014 /* length smaller or larger than possible -> must be a hole */
3015 while (u16Len == 0) {
3017 u16Len = tvb_get_letohs(tvb, offset);
3018 /* this is a bit tricky here! we know: */
3019 /* u16Len must be greater than 3 (min. size of header itself) */
3020 /* u16Len must be a lot smaller than 0x300 (max. size of frame) */
3021 /* -> if we found a length larger than 0x300, */
3022 /* this must be actually the high byte, so do one more step */
3023 if (u16Len > 0x300) {
3027 proto_tree_add_none_format(conn_data_tree, hf_cba_acco_cb_item_hole, tvb,
3028 offset_hole, offset - offset_hole,
3029 "Hole(--): -------------, offset=%2u, length=%2u",
3030 offset_hole, offset - offset_hole);
3033 /* add callback-item subtree */
3034 sub_item = proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_item, tvb, offset, 0, ENC_NA);
3035 sub_tree = proto_item_add_subtree(sub_item, ett_ICBAAccoCallback_Item);
3037 item_offset = offset;
3039 /* add item header fields */
3041 proto_tree_add_item(sub_tree, hf_cba_acco_cb_item_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3046 if (u8Version == CBA_MRSH_VERSION_DCOM ||
3047 u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID)
3049 u32ID = tvb_get_letohl (tvb, offset);
3051 proto_tree_add_item(sub_tree, hf_cba_acco_conn_cons_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3059 u8QC = tvb_get_guint8 (tvb, offset);
3062 item = proto_tree_add_item(sub_tree, hf_cba_acco_qc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3067 if ( u8QC != 0x80 && /* GoodNonCascOk */
3068 u8QC != 0x1C && /* BadOutOfService (usually permanent, so don't report for every frame) */
3070 expert_add_info_format(pinfo, item, PI_RESPONSE_CODE, PI_CHAT, "%s QC: %s",
3071 u8Version == CBA_MRSH_VERSION_DCOM ? "DCOM" : "SRT",
3072 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"));
3087 /* user data length is item length without headers */
3088 u16DataLen = u16Len - u16HdrLen;
3090 /* append text to subtree header */
3091 if (u8Version == CBA_MRSH_VERSION_DCOM ||
3092 u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID)
3094 proto_item_append_text(sub_item,
3095 "[%2u]: ConsID=0x%08x, offset=%2u, length=%2u (user-length=%2u), QC=%s (0x%02x)",
3096 u32ItemIdx, u32ID, offset - u16HdrLen, u16Len, u16DataLen,
3097 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"), u8QC );
3099 proto_item_append_text(sub_item,
3100 "[%2u]: ConsID=-, offset=%2u, length=%2u (user-length=%2u), QC=%s (0x%02x)",
3101 u32ItemIdx, offset - u16HdrLen, u16Len, u16DataLen,
3102 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"), u8QC );
3104 proto_item_set_len(sub_item, u16Len);
3106 /* hexdump of user data */
3107 proto_tree_add_item(sub_tree, hf_cba_acco_cb_item_data, tvb, offset, u16DataLen, ENC_NA);
3108 offset += u16DataLen;
3110 if (frame != NULL ) {
3111 /* find offset in SRT */
3112 /* XXX - expensive! */
3113 cba_frame_incoming_data(tvb, pinfo, sub_tree, frame);
3114 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
3116 if (conn->frame_offset == item_offset) {
3117 cba_connection_info(tvb, pinfo, sub_tree, conn);
3122 /* find consID in ldev */
3123 /* XXX - expensive! */
3124 if (cons_ldev != NULL) {
3125 for(conns = cons_ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
3127 if (conn->consid == u32ID) {
3128 cba_connection_info(tvb, pinfo, sub_tree, conn);
3129 cba_connection_incoming_data(tvb, pinfo, sub_tree, conn);
3139 if (u8Version == 1) {
3140 proto_item_append_text(conn_data_item,
3141 ": Version=0x%x (DCOM), Flags=0x%x, Count=%u",
3142 u8Version, u8Flags, u16CountFix);
3144 proto_item_append_text(conn_data_item,
3145 ": Version=0x%x (SRT), Flags=0x%x, Count=%u, Items=%u, Holes=%u",
3146 u8Version, u8Flags, u16CountFix, u32ItemIdx-1, u32HoleIdx-1);
3148 proto_item_set_len(conn_data_item, offset);
3150 col_append_fstr(pinfo->cinfo, COL_INFO, ", QC (G:%u,U:%u,B:%u)",
3151 qc_good, qc_uncertain, qc_bad);
3158 dissect_CBA_Connection_Data_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
3166 /* the tvb will NOT contain the frame_id here! */
3167 u16FrameID = GPOINTER_TO_UINT(pinfo->private_data);
3169 /* frame id must be in valid range (cyclic Real-Time, class=1 or class=2) */
3170 if (u16FrameID < 0x8000 || u16FrameID >= 0xfb00) {
3174 u8Version = tvb_get_guint8 (tvb, 0);
3175 u8Flags = tvb_get_guint8 (tvb, 1);
3177 /* version and flags must be ok */
3178 if (u8Version != 0x11 || u8Flags != 0x00) {
3182 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN-CBA");
3184 frame = cba_frame_find_by_cons(pinfo, pinfo->dl_dst.data, u16FrameID);
3186 dissect_CBA_Connection_Data(tvb, pinfo, tree, frame ? frame->consparent : NULL, frame);
3193 dissect_ICBAAccoCallback_OnDataChanged_rqst(tvbuff_t *tvb, int offset,
3194 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3197 guint32 u32ArraySize;
3200 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3201 cba_ldev_t *cons_ldev;
3204 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3206 /* get corresponding provider ldev */
3207 cons_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
3209 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
3210 PROTO_ITEM_SET_GENERATED(item);
3211 pinfo->profinet_type = 1;
3214 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3215 hf_cba_acco_cb_length, &u32Length);
3218 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3221 /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
3222 /* dissect PROFINET component data (without header) */
3223 next_tvb = tvb_new_subset_remaining(tvb, offset);
3225 offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, cons_ldev, NULL /* frame */);
3232 dissect_ICBAAccoCallback_OnDataChanged_resp(tvbuff_t *tvb, int offset,
3233 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3239 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3241 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
3242 PROTO_ITEM_SET_GENERATED(item);
3243 pinfo->profinet_type = 2;
3245 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3248 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3249 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3256 dissect_ICBAAccoCallback_Gnip_rqst(tvbuff_t *tvb, int offset,
3257 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3262 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3264 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
3265 PROTO_ITEM_SET_GENERATED(item);
3266 pinfo->profinet_type = 3;
3273 dissect_ICBAAccoCallback_Gnip_resp(tvbuff_t *tvb, int offset,
3274 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3280 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3282 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
3283 PROTO_ITEM_SET_GENERATED(item);
3284 pinfo->profinet_type = 4;
3286 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3289 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3290 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3297 dissect_ICBAAccoServer2_GetConnectionData_rqst(tvbuff_t *tvb, int offset,
3298 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3301 guint32 u32MaxStr = sizeof(szStr);
3303 cba_ldev_t *cons_ldev;
3304 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3308 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3310 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
3311 PROTO_ITEM_SET_GENERATED(item);
3312 pinfo->profinet_type = 2;
3314 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
3315 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
3317 cons_ldev = cba_acco_add(pinfo, szStr);
3319 /* link ldev to the call */
3320 if (cons_ldev != NULL) {
3321 call = se_alloc(sizeof(cba_ldev_t *));
3323 info->call_data->private_data = call;
3326 /* update column info now */
3327 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
3334 dissect_ICBAAccoServer2_GetConnectionData_resp(tvbuff_t *tvb, int offset,
3335 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3338 guint32 u32ArraySize;
3343 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3344 cba_ldev_t **call = info->call_data->private_data;
3345 cba_ldev_t *cons_ldev = (call!=NULL) ? *call : NULL;
3348 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3350 if (cons_ldev == NULL) {
3351 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
3352 "No request info, response data ignored");
3355 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
3356 PROTO_ITEM_SET_GENERATED(item);
3357 pinfo->profinet_type = 1;
3360 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3361 hf_cba_acco_cb_length, &u32Length);
3363 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3367 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3370 /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
3371 /* dissect PROFINET component data (without header) */
3372 next_tvb = tvb_new_subset_remaining(tvb, offset);
3374 offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, (call != NULL) ? *call : NULL, NULL /* frame */);
3378 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3381 /* update column info now */
3382 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3383 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3390 dissect_ICBAAccoMgt_AddConnections_rqst(tvbuff_t *tvb, int offset,
3391 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3393 gchar szConsumer[1000] = { 0 };
3394 guint32 u32MaxConsLen = sizeof(szConsumer);
3396 guint16 u16QoSValue;
3399 guint32 u32ArraySize;
3401 guint16 u16Persistence;
3402 gchar szConsItem[1000] = { 0 };
3403 guint32 u32MaxConsItemLen = sizeof(szConsItem);
3404 gchar szProvItem[1000] = { 0 };
3405 guint32 u32MaxProvItemLen = sizeof(szProvItem);
3406 guint32 u32VariableOffset;
3407 guint32 u32SubStart;
3411 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3413 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
3414 hf_cba_acco_conn_provider, szConsumer, u32MaxConsLen);
3415 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
3416 hf_cba_acco_conn_qos_type, &u16QoSType);
3417 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
3418 hf_cba_acco_conn_qos_value, &u16QoSValue);
3419 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
3420 hf_cba_acco_conn_state, &u8State);
3422 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3423 hf_cba_acco_count, &u32Count);
3425 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3428 u32VariableOffset = offset + u32ArraySize * 20;
3431 while (u32ArraySize--) {
3432 proto_item *sub_item;
3433 proto_tree *sub_tree;
3435 sub_item = proto_tree_add_item(tree, hf_cba_addconnectionin, tvb, offset, 0, ENC_NA);
3436 sub_tree = proto_item_add_subtree(sub_item, ett_cba_addconnectionin);
3437 u32SubStart = offset;
3439 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3442 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3443 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
3445 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3448 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3449 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
3451 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3452 hf_cba_acco_conn_persist, &u16Persistence);
3454 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3457 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3458 hf_cba_acco_conn_substitute);
3460 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3463 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3464 hf_cba_acco_conn_epsilon);
3466 proto_item_append_text(sub_item, "[%u]: ConsItem=\"%s\" ProvItem=\"%s\" %s Pers=%u",
3467 u32Idx, szConsItem, szProvItem,
3468 val_to_str(u16Persistence, cba_persist_vals, "Unknown (0x%02x)"), u16Persistence);
3469 proto_item_set_len(sub_item, offset - u32SubStart);
3474 /* update column info now */
3475 col_append_fstr(pinfo->cinfo, COL_INFO, ": Prov=\"%s\" State=%s Cnt=%u",
3477 val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"),
3480 return u32VariableOffset;
3485 dissect_ICBAAccoMgt_AddConnections_resp(tvbuff_t *tvb, int offset,
3486 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3489 guint32 u32ArraySize = 0;
3491 guint16 u16ConnVersion;
3492 guint32 u32HResult = 0;
3493 guint32 u32Count = 0;
3495 guint32 u32SubStart;
3498 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3500 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3504 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3507 u32Count = u32ArraySize;
3509 while (u32ArraySize--) {
3510 proto_item *sub_item;
3511 proto_tree *sub_tree;
3513 sub_item = proto_tree_add_item(tree, hf_cba_addconnectionout, tvb, offset, 0, ENC_NA);
3514 sub_tree = proto_item_add_subtree(sub_item, ett_cba_addconnectionout);
3515 u32SubStart = offset;
3517 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3518 hf_cba_acco_conn_cons_id, &u32ConsID);
3520 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3521 hf_cba_acco_conn_version, &u16ConnVersion);
3523 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3524 &u32HResult, u32Idx);
3526 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x Version=%u %s",
3527 u32Idx, u32ConsID, u16ConnVersion,
3528 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3529 proto_item_set_len(sub_item, offset - u32SubStart);
3534 /* update column info now */
3535 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3538 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3541 /* update column info now */
3542 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3543 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3550 dissect_ICBAAccoMgt_RemoveConnections_rqst(tvbuff_t *tvb, int offset,
3551 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3554 guint32 u32ArraySize;
3559 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3561 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3562 hf_cba_acco_count, &u32Count);
3564 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3568 while (u32ArraySize--) {
3569 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3570 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3574 /* update column info now */
3575 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3582 dissect_ICBAAccoMgt_SetActivationState_rqst(tvbuff_t *tvb, int offset,
3583 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3587 guint32 u32ArraySize;
3592 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3594 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
3595 hf_cba_acco_conn_state, &u8State);
3597 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3598 hf_cba_acco_count, &u32Count);
3600 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3604 while (u32ArraySize--) {
3605 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3606 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3610 /* update column info now */
3611 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3618 dissect_ICBAAccoMgt_GetInfo_resp(tvbuff_t *tvb, int offset,
3619 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3626 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3628 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3629 hf_cba_acco_info_max, &u32Max);
3631 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3632 hf_cba_acco_info_curr, &u32CurCnt);
3634 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3637 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u/%u -> %s",
3639 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3646 dissect_ICBAAccoMgt_GetIDs_resp(tvbuff_t *tvb, int offset,
3647 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3651 guint32 u32ArraySize;
3657 guint32 u32SubStart;
3660 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3662 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3663 hf_cba_acco_count, &u32Count);
3666 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count);
3668 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3671 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3674 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3678 while (u32ArraySize--) {
3679 proto_item *sub_item;
3680 proto_tree *sub_tree;
3682 sub_item = proto_tree_add_item(tree, hf_cba_getidout, tvb, offset, 0, ENC_NA);
3683 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getidout);
3684 u32SubStart = offset;
3686 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3687 hf_cba_acco_conn_cons_id, &u32ConsID);
3688 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3689 hf_cba_acco_conn_state, &u8State);
3690 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3691 hf_cba_acco_conn_version, &u16Version);
3692 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3693 &u32HResult, u32Idx);
3695 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x State=%s Version=%u %s",
3697 val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"),
3699 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3700 proto_item_set_len(sub_item, offset - u32SubStart);
3703 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID);
3704 } else if (u32Idx < 10) {
3705 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID);
3706 } else if (u32Idx == 10) {
3707 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
3714 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3717 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3718 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3725 dissect_ICBAAccoMgt2_GetConsIDs_resp(tvbuff_t *tvb, int offset,
3726 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3730 guint32 u32ArraySize;
3736 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3738 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3739 hf_cba_acco_count, &u32Count);
3742 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count);
3744 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3747 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3750 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3754 while (u32ArraySize--) {
3755 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo,
3757 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3760 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID);
3761 } else if (u32Idx < 10) {
3762 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID);
3763 } else if (u32Idx == 10) {
3764 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
3771 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3774 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3775 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3782 dissect_ICBAAccoMgt2_GetConsConnections_resp(tvbuff_t *tvb, int offset,
3783 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3786 guint32 u32TmpCount;
3791 guint16 u16QoSValue;
3793 guint16 u16Persistence;
3794 guint32 u32SubStart;
3796 guint32 u32VariableOffset;
3797 gchar szProv[1000] = { 0 };
3798 guint32 u32MaxProvLen = sizeof(szProv);
3799 gchar szProvItem[1000] = { 0 };
3800 guint32 u32MaxProvItemLen = sizeof(szProvItem);
3801 gchar szConsItem[1000] = { 0 };
3802 guint32 u32MaxConsItemLen = sizeof(szConsItem);
3805 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3807 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3810 u32VariableOffset = offset;
3813 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3814 hf_cba_acco_count, &u32Count);
3816 u32VariableOffset = offset + u32Count*32;
3818 /* array fixed part (including pointers to variable part) */
3819 u32TmpCount = u32Count;
3821 while (u32TmpCount--) {
3822 proto_item *sub_item;
3823 proto_tree *sub_tree;
3825 sub_item = proto_tree_add_item(tree, hf_cba_getconsconnout, tvb, offset, 0, ENC_NA);
3826 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
3827 u32SubStart = offset;
3829 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3832 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3833 hf_cba_acco_conn_provider, szProv, u32MaxProvLen);
3835 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3838 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3839 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
3841 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3844 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3845 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
3847 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3850 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3851 hf_cba_acco_conn_substitute);
3853 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3856 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3857 hf_cba_acco_conn_epsilon);
3860 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3861 hf_cba_acco_conn_qos_type, &u16QoSType);
3862 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3863 hf_cba_acco_conn_qos_value, &u16QoSValue);
3864 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3865 hf_cba_acco_conn_state, &u8State);
3866 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3867 hf_cba_acco_conn_persist, &u16Persistence);
3868 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3869 &u32HResult, u32Idx);
3871 proto_item_append_text(sub_item, "[%u]: %s",
3873 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3874 proto_item_set_len(sub_item, offset - u32SubStart);
3880 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
3883 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3884 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3886 return u32VariableOffset;
3891 dissect_ICBAAccoMgt2_DiagConsConnections_resp(tvbuff_t *tvb, int offset,
3892 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3895 guint32 u32TmpCount;
3899 guint16 u16Persistence;
3900 guint16 u16ConnVersion;
3901 guint32 u32SubStart;
3903 guint32 u32VariableOffset;
3904 guint32 u32ConnErrorState;
3907 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3909 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3912 u32VariableOffset = offset;
3915 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3916 hf_cba_acco_count, &u32Count);
3918 u32VariableOffset = offset + u32Count*16;
3920 /* array fixed part (including pointers to variable part) */
3921 u32TmpCount = u32Count;
3923 while (u32TmpCount--) {
3924 proto_item *sub_item;
3925 proto_tree *sub_tree;
3926 proto_item *state_item;
3928 sub_item = proto_tree_add_item(tree, hf_cba_diagconsconnout, tvb, offset, 0, ENC_NA);
3929 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
3930 u32SubStart = offset;
3932 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3933 hf_cba_acco_conn_state, &u8State);
3934 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3935 hf_cba_acco_conn_persist, &u16Persistence);
3936 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3937 hf_cba_acco_conn_version, &u16ConnVersion);
3938 /* connection state */
3940 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3941 hf_cba_acco_conn_error_state, &u32ConnErrorState);
3943 offset = dissect_dcom_HRESULT_item(tvb, offset, pinfo, sub_tree, drep,
3944 &u32ConnErrorState, hf_cba_acco_conn_error_state, &state_item);
3945 proto_item_set_text(state_item, "ConnErrorState: %s (0x%x)",
3946 val_to_str(u32ConnErrorState, dcom_hresult_vals, "Unknown (0x%08x)"),
3949 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3950 &u32HResult, u32Idx);
3952 proto_item_append_text(sub_item, "[%u]: %s",
3954 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3955 proto_item_set_len(sub_item, offset - u32SubStart);
3961 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
3964 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3965 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3967 return u32VariableOffset;
3972 dissect_ICBAAccoMgt_GetConnections_rqst(tvbuff_t *tvb, int offset,
3973 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3977 guint32 u32ArraySize;
3981 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3983 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3984 hf_cba_acco_count, &u32Count);
3986 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3990 while (u32ArraySize--){
3991 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3992 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
4001 dissect_ICBAAccoMgt_GetConnections_resp(tvbuff_t *tvb, int offset,
4002 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4005 guint32 u32TmpCount;
4010 guint16 u16QoSValue;
4012 guint16 u16Persistence;
4013 guint16 u16ConnVersion;
4014 guint32 u32SubStart;
4016 guint32 u32VariableOffset;
4017 gchar szProv[1000] = { 0 };
4018 guint32 u32MaxProvLen = sizeof(szProv);
4019 gchar szProvItem[1000] = { 0 };
4020 guint32 u32MaxProvItemLen = sizeof(szProvItem);
4021 gchar szConsItem[1000] = { 0 };
4022 guint32 u32MaxConsItemLen = sizeof(szConsItem);
4025 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4027 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4030 u32VariableOffset = offset;
4033 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4034 hf_cba_acco_count, &u32Count);
4036 u32VariableOffset = offset + u32Count*36;
4038 /* array fixed part (including pointers to variable part) */
4039 u32TmpCount = u32Count;
4041 while (u32TmpCount--) {
4042 proto_item *sub_item;
4043 proto_tree *sub_tree;
4045 sub_item = proto_tree_add_item(tree, hf_cba_getconnectionout, tvb, offset, 0, ENC_NA);
4046 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
4047 u32SubStart = offset;
4049 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4052 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4053 hf_cba_acco_conn_provider, szProv, u32MaxProvLen);
4055 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4058 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4059 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
4061 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4064 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4065 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
4067 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4070 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4071 hf_cba_acco_conn_substitute);
4073 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4076 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4077 hf_cba_acco_conn_epsilon);
4080 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4081 hf_cba_acco_conn_qos_type, &u16QoSType);
4082 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4083 hf_cba_acco_conn_qos_value, &u16QoSValue);
4084 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
4085 hf_cba_acco_conn_state, &u8State);
4086 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4087 hf_cba_acco_conn_persist, &u16Persistence);
4088 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4089 hf_cba_acco_conn_version, &u16ConnVersion);
4090 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4091 &u32HResult, u32Idx);
4093 proto_item_append_text(sub_item, "[%u]: %s",
4095 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4096 proto_item_set_len(sub_item, offset - u32SubStart);
4102 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4105 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
4106 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4108 return u32VariableOffset;
4113 dissect_ICBAAccoMgt_ReviseQoS_rqst(tvbuff_t *tvb, int offset,
4114 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4117 guint16 u16QoSValue;
4119 guint32 u32MaxStr = sizeof(szStr);
4122 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4124 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
4125 hf_cba_acco_rtauto, szStr, u32MaxStr);
4127 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4128 hf_cba_acco_conn_qos_type, &u16QoSType);
4130 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4131 hf_cba_acco_conn_qos_value, &u16QoSValue);
4133 col_append_fstr(pinfo->cinfo, COL_INFO, ": RTAuto=\"%s\" QoSType=%s QoSValue=%u",
4135 val_to_str(u16QoSType, cba_qos_type_vals, "Unknown (0x%04x)"),
4143 dissect_ICBAAccoMgt_ReviseQoS_resp(tvbuff_t *tvb, int offset,
4144 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4146 guint16 u16QoSValue;
4150 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4152 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4153 hf_cba_acco_conn_qos_value, &u16QoSValue);
4155 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4158 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s",
4160 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4167 dissect_ICBAAccoMgt_get_PingFactor_resp(tvbuff_t *tvb, int offset,
4168 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4174 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4176 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4177 hf_cba_acco_ping_factor, &u16PF);
4179 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4182 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s",
4184 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4191 dissect_ICBAAccoMgt_put_PingFactor_rqst(tvbuff_t *tvb, int offset,
4192 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4197 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4199 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4200 hf_cba_acco_ping_factor, &u16PF);
4202 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", u16PF);
4210 dissect_ICBAAccoMgt_get_CDBCookie_resp(tvbuff_t *tvb, int offset,
4211 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4217 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4219 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4220 hf_cba_acco_cdb_cookie, &u32Cookie);
4222 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4225 col_append_fstr(pinfo->cinfo, COL_INFO, ": CDBCookie=0x%x -> %s",
4227 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4234 dissect_ICBAAccoMgt_GetDiagnosis_rqst(tvbuff_t *tvb, int offset,
4235 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4238 guint32 u32InLength;
4239 guint32 u32ArraySize;
4242 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4244 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4245 hf_cba_acco_diag_req, &u32Request);
4247 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4248 hf_cba_acco_diag_in_length, &u32InLength);
4250 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4253 if (u32ArraySize != 0) {
4254 proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32InLength, ENC_NA);
4257 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s: %u bytes",
4258 val_to_str(u32Request, cba_acco_diag_req_vals, "Unknown request (0x%08x)"),
4266 dissect_ICBAAccoMgt_GetDiagnosis_resp(tvbuff_t *tvb, int offset,
4267 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4269 guint32 u32OutLength;
4272 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4274 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4275 hf_cba_acco_diag_out_length, &u32OutLength);
4277 if (u32OutLength != 0) {
4278 proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32OutLength, ENC_NA);
4281 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u bytes",
4289 dissect_ICBAAccoSync_ReadItems_rqst(tvbuff_t *tvb, int offset,
4290 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4294 guint32 u32MaxStr = sizeof(szStr);
4296 guint32 u32ArraySize;
4297 guint32 u32VariableOffset;
4301 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4303 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4304 hf_cba_acco_count, &u32Count);
4306 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4309 u32VariableOffset = offset + u32ArraySize*4;
4312 while (u32ArraySize--) {
4313 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4316 u32VariableOffset = dissect_dcom_indexed_LPWSTR(tvb, u32VariableOffset, pinfo, tree, drep,
4317 hf_cba_acco_item, szStr, u32MaxStr, u32Idx);
4323 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4325 return u32VariableOffset;
4332 dissect_ICBAAccoSync_ReadItems_resp(tvbuff_t *tvb, int offset,
4333 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4337 guint32 u32ArraySize = 0;
4340 guint32 u32SubStart;
4341 guint32 u32VariableOffset;
4345 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4347 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4349 u32VariableOffset = offset;
4352 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4355 u32VariableOffset = offset + u32ArraySize * 20;
4357 u32Tmp = u32ArraySize;
4359 proto_item *sub_item;
4360 proto_tree *sub_tree;
4362 sub_item = proto_tree_add_item(tree, hf_cba_readitemout, tvb, offset, 0, ENC_NA);
4363 sub_tree = proto_item_add_subtree(sub_item, ett_cba_readitemout);
4364 u32SubStart = offset;
4366 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4369 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep, hf_cba_acco_data);
4372 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4373 hf_cba_acco_qc, &u16QC);
4374 offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
4375 hf_cba_acco_time_stamp, NULL);
4377 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4378 &u32HResult, u32Idx);
4380 proto_item_append_text(sub_item, "[%u]: QC=%s (0x%02x) %s",
4382 val_to_str(u16QC, cba_acco_qc_vals, "Unknown"),
4384 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4385 proto_item_set_len(sub_item, offset - u32SubStart);
4391 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4394 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
4396 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4398 return u32VariableOffset;
4403 dissect_ICBAAccoSync_WriteItems_rqst(tvbuff_t *tvb, int offset,
4404 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4407 guint32 u32ArraySize;
4409 guint32 u32MaxStr = sizeof(szStr);
4411 guint32 u32VariableOffset;
4412 guint32 u32SubStart;
4416 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4418 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4419 hf_cba_acco_count, &u32Count);
4421 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4424 u32VariableOffset = offset + u32ArraySize * 8;
4426 while(u32ArraySize--) {
4427 proto_item *sub_item;
4428 proto_tree *sub_tree;
4430 sub_item = proto_tree_add_item(tree, hf_cba_writeitemin, tvb, offset, 0, ENC_NA);
4431 sub_tree = proto_item_add_subtree(sub_item, ett_cba_writeitemin);
4432 u32SubStart = offset;
4434 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4437 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4438 hf_cba_acco_item, szStr, u32MaxStr);
4440 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4443 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4447 proto_item_append_text(sub_item, "[%u]: Item=\"%s\"", u32Idx, szStr);
4448 proto_item_set_len(sub_item, offset - u32SubStart);
4453 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4455 return u32VariableOffset;
4461 dissect_ICBAAccoSync_WriteItemsQCD_rqst(tvbuff_t *tvb, int offset,
4462 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4465 guint32 u32ArraySize;
4467 guint32 u32MaxStr = sizeof(szStr);
4469 guint32 u32VariableOffset;
4470 guint32 u32SubStart;
4474 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4476 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4477 hf_cba_acco_count, &u32Count);
4479 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4482 u32VariableOffset = offset + u32ArraySize * 20;
4484 while(u32ArraySize--) {
4485 proto_item *sub_item;
4486 proto_tree *sub_tree;
4488 sub_item = proto_tree_add_item(tree, hf_cba_writeitemin, tvb, offset, 0, ENC_NA);
4489 sub_tree = proto_item_add_subtree(sub_item, ett_cba_writeitemin);
4490 u32SubStart = offset;
4492 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4495 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4496 hf_cba_acco_item, szStr, u32MaxStr);
4499 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4502 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4506 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4507 hf_cba_acco_qc, &u16QC);
4509 offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
4510 hf_cba_acco_time_stamp, NULL);
4512 proto_item_append_text(sub_item, "[%u]: Item=\"%s\" QC=%s (0x%02x)",
4514 val_to_str(u16QC, cba_acco_qc_vals, "Unknown"), u16QC);
4516 proto_item_set_len(sub_item, offset - u32SubStart);
4520 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4522 return u32VariableOffset;
4526 /* sub dissector table of ICBAAccoMgt / ICBAAccoMgt2 interface */
4527 static dcerpc_sub_dissector ICBAAccoMgt_dissectors[] = {
4528 { 0, "QueryInterface", NULL, NULL },
4529 { 1, "AddRef", NULL, NULL },
4530 { 2, "Release", NULL, NULL },
4532 { 3, "AddConnections", dissect_ICBAAccoMgt_AddConnections_rqst, dissect_ICBAAccoMgt_AddConnections_resp },
4533 { 4, "RemoveConnections", dissect_ICBAAccoMgt_RemoveConnections_rqst, dissect_HResultArray_resp },
4534 { 5, "ClearConnections", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
4535 { 6, "SetActivationState", dissect_ICBAAccoMgt_SetActivationState_rqst, dissect_HResultArray_resp },
4536 { 7, "GetInfo", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_GetInfo_resp },
4537 { 8, "GetIDs", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_GetIDs_resp },
4538 { 9, "GetConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt_GetConnections_resp },
4539 {10, "ReviseQoS", dissect_ICBAAccoMgt_ReviseQoS_rqst, dissect_ICBAAccoMgt_ReviseQoS_resp },
4540 {11, "get_PingFactor", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_get_PingFactor_resp },
4541 {12, "put_PingFactor", dissect_ICBAAccoMgt_put_PingFactor_rqst, dissect_dcom_simple_resp },
4542 {13, "get_CDBCookie", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_get_CDBCookie_resp },
4544 {14, "GetConsIDs", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt2_GetConsIDs_resp },
4545 {15, "GetConsConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt2_GetConsConnections_resp },
4546 {16, "DiagConsConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt2_DiagConsConnections_resp },
4547 {17, "GetProvIDs", dissect_dcom_simple_rqst, dissect_Server_GetProvIDs_resp },
4548 {18, "GetProvConnections", dissect_Server_GetProvConnections_rqst, dissect_Server_GetProvConnections_resp },
4549 {19, "GetDiagnosis", dissect_ICBAAccoMgt_GetDiagnosis_rqst, dissect_ICBAAccoMgt_GetDiagnosis_resp },
4550 { 0, NULL, NULL, NULL },
4554 /* sub dissector table of ICBAAccoCallback interface */
4555 static dcerpc_sub_dissector ICBAAccoCallback_dissectors[] = {
4556 { 0, "QueryInterface", NULL, NULL },
4557 { 1, "AddRef", NULL, NULL },
4558 { 2, "Release", NULL, NULL },
4560 { 3, "OnDataChanged", dissect_ICBAAccoCallback_OnDataChanged_rqst, dissect_ICBAAccoCallback_OnDataChanged_resp },
4562 { 4, "Gnip", dissect_ICBAAccoCallback_Gnip_rqst, dissect_ICBAAccoCallback_Gnip_resp },
4563 { 0, NULL, NULL, NULL },
4567 /* sub dissector table of ICBAAccoServer interface */
4568 static dcerpc_sub_dissector ICBAAccoServer_dissectors[] = {
4569 { 0, "QueryInterface", NULL, NULL },
4570 { 1, "AddRef", NULL, NULL },
4571 { 2, "Release", NULL, NULL },
4573 { 3, "Connect", dissect_ICBAAccoServer_Connect_rqst, dissect_ICBAAccoServer_Connect_resp },
4574 { 4, "Disconnect", dissect_ICBAAccoServer_Disconnect_rqst, dissect_ICBAAccoServer_Disconnect_resp },
4575 { 5, "DisconnectMe", dissect_ICBAAccoServer_DisconnectMe_rqst, dissect_ICBAAccoServer_DisconnectMe_resp },
4576 { 6, "SetActivation", dissect_ICBAAccoServer_SetActivation_rqst, dissect_ICBAAccoServer_SetActivation_resp },
4577 { 7, "Ping", dissect_ICBAAccoServer_Ping_rqst, dissect_ICBAAccoServer_Ping_resp },
4579 { 8, "Connect2", dissect_ICBAAccoServer2_Connect2_rqst, dissect_ICBAAccoServer_Connect_resp },
4580 { 9, "GetConnectionData", dissect_ICBAAccoServer2_GetConnectionData_rqst, dissect_ICBAAccoServer2_GetConnectionData_resp },
4581 { 0, NULL, NULL, NULL },
4585 /* sub dissector table of ICBAAccoServerSRT interface (stage 2 only) */
4586 static dcerpc_sub_dissector ICBAAccoServerSRT_dissectors[] = {
4587 { 0, "QueryInterface", NULL, NULL },
4588 { 1, "AddRef", NULL, NULL },
4589 { 2, "Release", NULL, NULL },
4591 { 3, "ConnectCR", dissect_ICBAAccoServerSRT_ConnectCR_rqst, dissect_ICBAAccoServerSRT_ConnectCR_resp },
4592 { 4, "DisconnectCR", dissect_ICBAAccoServerSRT_DisconnectCR_rqst, dissect_ICBAAccoServerSRT_DisconnectCR_resp },
4593 { 5, "Connect", dissect_ICBAAccoServerSRT_Connect_rqst, dissect_ICBAAccoServerSRT_Connect_resp },
4594 { 6, "Disconnect", dissect_ICBAAccoServerSRT_Disconnect_rqst, dissect_ICBAAccoServerSRT_Disconnect_resp },
4595 { 7, "DisconnectMe", dissect_ICBAAccoServerSRT_DisconnectMe_rqst, dissect_ICBAAccoServerSRT_DisconnectMe_resp },
4596 { 8, "SetActivation", dissect_ICBAAccoServerSRT_SetActivation_rqst, dissect_ICBAAccoServerSRT_SetActivation_resp },
4597 { 0, NULL, NULL, NULL },
4601 /* sub dissector table of ICBAAccoSync interface */
4602 static dcerpc_sub_dissector ICBAAccoSync_dissectors[] = {
4603 { 0, "QueryInterface", NULL, NULL },
4604 { 1, "AddRef", NULL, NULL },
4605 { 2, "Release", NULL, NULL },
4607 { 3, "ReadItems", dissect_ICBAAccoSync_ReadItems_rqst, dissect_ICBAAccoSync_ReadItems_resp },
4608 { 4, "WriteItems", dissect_ICBAAccoSync_WriteItems_rqst, dissect_HResultArray_resp },
4609 { 5, "WriteItemsQCD", dissect_ICBAAccoSync_WriteItemsQCD_rqst, dissect_HResultArray_resp },
4610 { 0, NULL, NULL, NULL },
4614 /* register protocol */
4616 proto_register_dcom_cba_acco (void)
4618 static gint *ett3[3];
4619 static gint *ett4[4];
4620 static gint *ett5[5];
4623 static hf_register_info hf_cba_acco_array[] = {
4624 { &hf_cba_acco_opnum,
4625 { "Operation", "cba.acco.opnum",
4626 FT_UINT16, BASE_DEC, NULL, 0x0,
4629 { &hf_cba_acco_ping_factor,
4630 { "PingFactor", "cba.acco.ping_factor",
4631 FT_UINT16, BASE_DEC, NULL, 0x0,
4634 { &hf_cba_acco_count,
4635 { "Count", "cba.acco.count",
4636 FT_UINT32, BASE_DEC, NULL, 0x0,
4639 { &hf_cba_acco_info_max,
4640 { "Max", "cba.acco.info_max",
4641 FT_UINT32, BASE_DEC, NULL, 0x0,
4644 { &hf_cba_acco_info_curr,
4645 { "Current", "cba.acco.info_curr",
4646 FT_UINT32, BASE_DEC, NULL, 0x0,
4649 { &hf_cba_acco_rtauto,
4650 { "RTAuto", "cba.acco.rtauto",
4651 FT_STRING, BASE_NONE, NULL, 0x0,
4654 { &hf_cba_acco_item,
4655 { "Item", "cba.acco.item",
4656 FT_STRING, BASE_NONE, NULL, 0x0,
4659 { &hf_cba_acco_data,
4660 { "Data", "cba.acco.data",
4661 FT_NONE, BASE_NONE, NULL, 0x0,
4665 { "QualityCode", "cba.acco.qc",
4666 FT_UINT8, BASE_HEX, VALS(cba_acco_qc_vals), 0x0,
4669 { &hf_cba_acco_time_stamp,
4670 { "TimeStamp", "cba.acco.time_stamp",
4671 FT_UINT64, BASE_DEC, NULL, 0x0,
4674 { &hf_cba_readitemout,
4675 { "ReadItemOut", "cba.acco.readitemout",
4676 FT_NONE, BASE_NONE, NULL, 0x0,
4679 { &hf_cba_writeitemin,
4680 { "WriteItemIn", "cba.acco.writeitemin",
4681 FT_NONE, BASE_NONE, NULL, 0x0,
4684 { &hf_cba_acco_cdb_cookie,
4685 { "CDBCookie", "cba.acco.cdb_cookie",
4686 FT_UINT32, BASE_HEX, NULL, 0x0,
4689 /* dcom_hresult_vals from packet-dcom.h doesn't work here, as length is unknown! */
4690 { &hf_cba_acco_conn_error_state,
4691 { "ConnErrorState", "cba.acco.conn_error_state",
4692 FT_UINT32, BASE_HEX, NULL /*VALS(dcom_hresult_vals)*/, 0x0,
4695 { &hf_cba_acco_diag_req,
4696 { "Request", "cba.acco.diag_req",
4697 FT_UINT32, BASE_HEX, VALS(cba_acco_diag_req_vals), 0x0,
4700 { &hf_cba_acco_diag_in_length,
4701 { "InLength", "cba.acco.diag_in_length",
4702 FT_UINT32, BASE_DEC, NULL, 0x0,
4705 { &hf_cba_acco_diag_out_length,
4706 { "OutLength", "cba.acco.diag_out_length",
4707 FT_UINT32, BASE_DEC, NULL, 0x0,
4710 { &hf_cba_acco_diag_data,
4711 { "Data", "cba.acco.diag_data",
4712 FT_BYTES, BASE_NONE, NULL, 0x0,
4715 { &hf_cba_acco_dcom_call,
4716 { "DcomRuntime", "cba.acco.dcom",
4717 FT_BOOLEAN, BASE_NONE, TFS(&cba_acco_call_flags), 0x0,
4718 "This is a DCOM runtime context", HFILL }
4720 { &hf_cba_acco_srt_call,
4721 { "SrtRuntime", "cba.acco.srt",
4722 FT_BOOLEAN, BASE_NONE, TFS(&cba_acco_call_flags), 0x0,
4723 "This is an SRT runtime context", HFILL }
4728 static hf_register_info hf_cba_acco_server[] = {
4730 { &hf_cba_acco_server_pICBAAccoCallback,
4731 { "pICBAAccoCallback", "cba.acco.server_pICBAAccoCallback",
4732 FT_BYTES, BASE_NONE, NULL, 0x0,
4736 { &hf_cba_acco_server_first_connect,
4737 { "FirstConnect", "cba.acco.server_first_connect",
4738 FT_UINT8, BASE_HEX, NULL, 0x0,
4741 { &hf_cba_getprovconnout,
4742 { "GETPROVCONNOUT", "cba.acco.getprovconnout",
4743 FT_NONE, BASE_NONE, NULL, 0x0,
4746 { &hf_cba_acco_serversrt_prov_mac,
4747 { "ProviderMAC", "cba.acco.serversrt_prov_mac",
4748 FT_ETHER, BASE_NONE, NULL, 0x0,
4751 { &hf_cba_acco_serversrt_cons_mac,
4752 { "ConsumerMAC", "cba.acco.serversrt_cons_mac",
4753 FT_ETHER, BASE_NONE, NULL, 0x0,
4756 { &hf_cba_acco_serversrt_cr_id,
4757 { "ConsumerCRID", "cba.acco.serversrt_cr_id",
4758 FT_UINT16, BASE_HEX, NULL, 0x0,
4761 { &hf_cba_acco_serversrt_cr_length,
4762 { "CRLength", "cba.acco.serversrt_cr_length",
4763 FT_UINT16, BASE_DEC, NULL, 0x0,
4766 { &hf_cba_acco_serversrt_cr_flags,
4767 { "Flags", "cba.acco.serversrt_cr_flags",
4768 FT_UINT32, BASE_HEX, 0, 0x0,
4771 { &hf_cba_acco_serversrt_cr_flags_timestamped,
4772 { "Timestamped", "cba.acco.serversrt_cr_flags_timestamped",
4773 FT_BOOLEAN, 32, TFS (&acco_flags_set_truth), 0x1,
4776 { &hf_cba_acco_serversrt_cr_flags_reconfigure,
4777 { "Reconfigure", "cba.acco.serversrt_cr_flags_reconfigure",
4778 FT_BOOLEAN, 32, TFS (&acco_flags_set_truth), 0x2,
4781 { &hf_cba_type_desc_len,
4782 { "TypeDescLen", "cba.acco.type_desc_len",
4783 FT_UINT16, BASE_DEC, NULL, 0x0,
4786 { &hf_cba_acco_serversrt_record_length,
4787 { "RecordLength", "cba.acco.serversrt_record_length",
4788 FT_UINT16, BASE_DEC, NULL, 0x0,
4792 { &hf_cba_acco_serversrt_action,
4793 { "Action", "cba.acco.serversrt_action",
4794 FT_UINT32, BASE_DEC, VALS(cba_acco_serversrt_action_vals), 0x0,
4798 { &hf_cba_acco_serversrt_last_connect,
4799 { "LastConnect", "cba.acco.serversrt_last_connect",
4800 FT_UINT8, BASE_DEC, VALS(cba_acco_serversrt_last_connect_vals), 0x0,
4805 static hf_register_info hf_cba_connectcr_array[] = {
4806 { &hf_cba_acco_prov_crid,
4807 { "ProviderCRID", "cba.acco.prov_crid",
4808 FT_UINT32, BASE_HEX, NULL, 0x0,
4813 static hf_register_info hf_cba_connect_array[] = {
4814 { &hf_cba_addconnectionin,
4815 { "ADDCONNECTIONIN", "cba.acco.addconnectionin",
4816 FT_NONE, BASE_NONE, NULL, 0x0,
4819 { &hf_cba_addconnectionout,
4820 { "ADDCONNECTIONOUT", "cba.acco.addconnectionout",
4821 FT_NONE, BASE_NONE, NULL, 0x0,
4825 { "GETIDOUT", "cba.acco.getidout",
4826 FT_NONE, BASE_NONE, NULL, 0x0,
4829 { &hf_cba_getconnectionout,
4830 { "GETCONNECTIONOUT", "cba.acco.getconnectionout",
4831 FT_NONE, BASE_NONE, NULL, 0x0,
4834 { &hf_cba_getconsconnout,
4835 { "GETCONSCONNOUT", "cba.acco.getconsconnout",
4836 FT_NONE, BASE_NONE, NULL, 0x0,
4839 { &hf_cba_diagconsconnout,
4840 { "DIAGCONSCONNOUT", "cba.acco.diagconsconnout",
4841 FT_NONE, BASE_NONE, NULL, 0x0,
4844 { &hf_cba_connectincr,
4845 { "CONNECTINCR", "cba.acco.connectincr",
4846 FT_NONE, BASE_NONE, NULL, 0x0,
4849 { &hf_cba_connectoutcr,
4850 { "CONNECTOUTCR", "cba.acco.connectoutcr",
4851 FT_NONE, BASE_NONE, NULL, 0x0,
4854 { &hf_cba_connectin,
4855 { "CONNECTIN", "cba.acco.connectin",
4856 FT_NONE, BASE_NONE, NULL, 0x0,
4859 { &hf_cba_connectout,
4860 { "CONNECTOUT", "cba.acco.connectout",
4861 FT_NONE, BASE_NONE, NULL, 0x0,
4864 { &hf_cba_acco_conn_prov_id,
4865 { "ProviderID", "cba.acco.conn_prov_id",
4866 FT_UINT32, BASE_HEX, NULL, 0x0,
4869 { &hf_cba_acco_conn_cons_id,
4870 { "ConsumerID", "cba.acco.conn_cons_id",
4871 FT_UINT32, BASE_HEX, NULL, 0x0,
4874 { &hf_cba_acco_conn_version,
4875 { "ConnVersion", "cba.acco.conn_version",
4876 FT_UINT16, BASE_HEX, NULL, 0x0,
4879 { &hf_cba_acco_conn_consumer,
4880 { "Consumer", "cba.acco.conn_consumer",
4881 FT_STRING, BASE_NONE, NULL, 0x0,
4884 { &hf_cba_acco_conn_qos_type,
4885 { "QoSType", "cba.acco.conn_qos_type",
4886 FT_UINT16, BASE_HEX, VALS(cba_qos_type_vals), 0x0,
4889 { &hf_cba_acco_conn_qos_value,
4890 { "QoSValue", "cba.acco.conn_qos_value",
4891 FT_UINT16, BASE_DEC, NULL, 0x0,
4894 { &hf_cba_acco_conn_state,
4895 { "State", "cba.acco.conn_state",
4896 FT_UINT8, BASE_HEX, VALS(cba_acco_conn_state_vals), 0x0,
4899 { &hf_cba_acco_conn_provider,
4900 { "Provider", "cba.acco.conn_provider",
4901 FT_STRING, BASE_NONE, NULL, 0x0,
4904 { &hf_cba_acco_conn_provider_item,
4905 { "ProviderItem", "cba.acco.conn_provider_item",
4906 FT_STRING, BASE_NONE, NULL, 0x0,
4909 { &hf_cba_acco_conn_consumer_item,
4910 { "ConsumerItem", "cba.acco.conn_consumer_item",
4911 FT_STRING, BASE_NONE, NULL, 0x0,
4914 { &hf_cba_acco_conn_persist,
4915 { "Persistence", "cba.acco.conn_persist",
4916 FT_UINT16, BASE_HEX, VALS(cba_persist_vals), 0x0,
4919 { &hf_cba_acco_conn_epsilon,
4920 { "Epsilon", "cba.acco.conn_epsilon",
4921 FT_NONE, BASE_NONE, NULL, 0x0,
4924 { &hf_cba_acco_conn_substitute,
4925 { "Substitute", "cba.acco.conn_substitute",
4926 FT_NONE, BASE_NONE, NULL, 0x0,
4931 static hf_register_info hf_cba_acco_cb[] = {
4932 { &hf_cba_acco_cb_length,
4933 { "Length", "cba.acco.cb_length",
4934 FT_UINT32, BASE_DEC, NULL, 0x0,
4937 { &hf_cba_acco_cb_version,
4938 { "Version", "cba.acco.cb_version",
4939 FT_UINT8, BASE_HEX, NULL, 0x0,
4942 { &hf_cba_acco_cb_flags,
4943 { "Flags", "cba.acco.cb_flags",
4944 FT_UINT8, BASE_HEX, NULL, 0x0,
4947 { &hf_cba_acco_cb_count,
4948 { "Count", "cba.acco.cb_count",
4949 FT_UINT16, BASE_DEC, NULL, 0x0,
4952 { &hf_cba_acco_cb_conn_data,
4953 { "CBA Connection data", "cba.acco.cb_conn_data",
4954 FT_NONE, BASE_NONE, NULL, 0x0,
4957 { &hf_cba_acco_cb_item,
4958 { "Item", "cba.acco.cb_item",
4959 FT_NONE, BASE_NONE, NULL, 0x0,
4962 { &hf_cba_acco_cb_item_hole,
4963 { "Hole", "cba.acco.cb_item_hole",
4964 FT_NONE, BASE_NONE, NULL, 0x0,
4967 { &hf_cba_acco_cb_item_length,
4968 { "Length", "cba.acco.cb_item_length",
4969 FT_UINT16, BASE_DEC, NULL, 0x0,
4972 { &hf_cba_acco_cb_item_data,
4973 { "Data(Hex)", "cba.acco.cb_item_data",
4974 FT_BYTES, BASE_NONE, NULL, 0x0,
4977 { &hf_cba_connect_in,
4978 { "Connect in frame", "cba.connect_in",
4979 FT_FRAMENUM, BASE_NONE, NULL, 0,
4980 "This connection Connect was in the packet with this number", HFILL }
4982 { &hf_cba_disconnect_in,
4983 { "Disconnect in frame", "cba.disconnect_in",
4984 FT_FRAMENUM, BASE_NONE, NULL, 0,
4985 "This connection Disconnect was in the packet with this number", HFILL }
4987 { &hf_cba_connectcr_in,
4988 { "ConnectCR in frame", "cba.connect_in",
4989 FT_FRAMENUM, BASE_NONE, NULL, 0,
4990 "This frame ConnectCR was in the packet with this number", HFILL }
4992 { &hf_cba_disconnectcr_in,
4993 { "DisconnectCR in frame", "cba.disconnect_in",
4994 FT_FRAMENUM, BASE_NONE, NULL, 0,
4995 "This frame DisconnectCR was in the packet with this number", HFILL }
4997 { &hf_cba_disconnectme_in,
4998 { "DisconnectMe in frame", "cba.disconnectme_in",
4999 FT_FRAMENUM, BASE_NONE, NULL, 0,
5000 "This connection/frame DisconnectMe was in the packet with this number", HFILL }
5002 { &hf_cba_data_first_in,
5003 { "First data in frame", "cba.data_first_in",
5004 FT_FRAMENUM, BASE_NONE, NULL, 0,
5005 "The first data of this connection/frame in the packet with this number", HFILL }
5007 { &hf_cba_data_last_in,
5008 { "Last data in frame", "cba.data_last_in",
5009 FT_FRAMENUM, BASE_NONE, NULL, 0,
5010 "The last data of this connection/frame in the packet with this number", HFILL }
5014 ett5[0] = &ett_ICBAAccoMgt;
5015 ett5[1] = &ett_cba_addconnectionin;
5016 ett5[2] = &ett_cba_addconnectionout;
5017 ett5[3] = &ett_cba_getidout;
5018 ett5[4] = &ett_cba_getconnectionout;
5019 proto_ICBAAccoMgt = proto_register_protocol ("ICBAAccoMgt", "ICBAAccoMgt", "cba_acco_mgt");
5020 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_acco_array, array_length(hf_cba_acco_array));
5021 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_connect_array, array_length(hf_cba_connect_array));
5022 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_connectcr_array, array_length(hf_cba_connectcr_array));
5023 proto_register_subtree_array (ett5, array_length (ett5));
5025 proto_ICBAAccoMgt2 = proto_register_protocol ("ICBAAccoMgt2", "ICBAAccoMgt2", "cba_acco_mgt2");
5027 ett3[0] = &ett_ICBAAccoCallback;
5028 ett3[1] = &ett_ICBAAccoCallback_Item;
5029 ett3[2] = &ett_ICBAAccoCallback_Buffer;
5030 proto_ICBAAccoCallback = proto_register_protocol ("ICBAAccoCallback", "ICBAAccoCB", "cba_acco_cb");
5031 proto_register_field_array(proto_ICBAAccoCallback, hf_cba_acco_cb, array_length(hf_cba_acco_cb));
5032 proto_register_subtree_array (ett3, array_length (ett3));
5034 proto_ICBAAccoCallback2 = proto_register_protocol ("ICBAAccoCallback2", "ICBAAccoCB2", "cba_acco_cb2");
5036 ett4[0] = &ett_ICBAAccoServer;
5037 ett4[1] = &ett_cba_connectin;
5038 ett4[2] = &ett_cba_connectout;
5039 ett4[3] = &ett_cba_getprovconnout;
5040 proto_ICBAAccoServer = proto_register_protocol ("ICBAAccoServer", "ICBAAccoServ", "cba_acco_server");
5041 proto_register_field_array(proto_ICBAAccoServer, hf_cba_acco_server, array_length(hf_cba_acco_server));
5042 proto_register_subtree_array (ett4, array_length (ett4));
5044 proto_ICBAAccoServer2 = proto_register_protocol ("ICBAAccoServer2", "ICBAAccoServ2", "cba_acco_server2");
5046 ett4[0] = &ett_ICBAAccoServerSRT;
5047 ett4[1] = &ett_cba_acco_serversrt_cr_flags;
5048 ett4[2] = &ett_cba_connectincr;
5049 ett4[3] = &ett_cba_connectoutcr;
5050 proto_ICBAAccoServerSRT = proto_register_protocol ("ICBAAccoServerSRT", "ICBAAccoServSRT", "cba_acco_server_srt");
5051 proto_register_subtree_array (ett4, array_length (ett4));
5053 ett5[0] = &ett_ICBAAccoSync;
5054 ett5[1] = &ett_cba_readitemout;
5055 ett5[2] = &ett_cba_writeitemin;
5056 ett5[3] = &ett_cba_frame_info;
5057 ett5[4] = &ett_cba_conn_info;
5058 proto_ICBAAccoSync = proto_register_protocol ("ICBAAccoSync", "ICBAAccoSync", "cba_acco_sync");
5059 proto_register_subtree_array (ett5, array_length (ett5));
5063 /* handoff protocol */
5065 proto_reg_handoff_dcom_cba_acco (void)
5067 /* Register the interfaces */
5068 dcerpc_init_uuid(proto_ICBAAccoMgt, ett_ICBAAccoMgt,
5069 &uuid_ICBAAccoMgt, ver_ICBAAccoMgt, ICBAAccoMgt_dissectors, hf_cba_acco_opnum);
5071 dcerpc_init_uuid(proto_ICBAAccoMgt2, ett_ICBAAccoMgt,
5072 &uuid_ICBAAccoMgt2, ver_ICBAAccoMgt2, ICBAAccoMgt_dissectors, hf_cba_acco_opnum);
5074 dcerpc_init_uuid(proto_ICBAAccoCallback, ett_ICBAAccoCallback,
5075 &uuid_ICBAAccoCallback, ver_ICBAAccoCallback, ICBAAccoCallback_dissectors, hf_cba_acco_opnum);
5077 dcerpc_init_uuid(proto_ICBAAccoCallback2, ett_ICBAAccoCallback,
5078 &uuid_ICBAAccoCallback2, ver_ICBAAccoCallback2, ICBAAccoCallback_dissectors, hf_cba_acco_opnum);
5080 dcerpc_init_uuid(proto_ICBAAccoServer, ett_ICBAAccoServer,
5081 &uuid_ICBAAccoServer, ver_ICBAAccoServer, ICBAAccoServer_dissectors, hf_cba_acco_opnum);
5083 dcerpc_init_uuid(proto_ICBAAccoServer2, ett_ICBAAccoServer,
5084 &uuid_ICBAAccoServer2, ver_ICBAAccoServer2, ICBAAccoServer_dissectors, hf_cba_acco_opnum);
5086 dcerpc_init_uuid(proto_ICBAAccoServerSRT, ett_ICBAAccoServerSRT,
5087 &uuid_ICBAAccoServerSRT, ver_ICBAAccoServerSRT, ICBAAccoServerSRT_dissectors, hf_cba_acco_opnum);
5089 dcerpc_init_uuid(proto_ICBAAccoSync, ett_ICBAAccoSync,
5090 &uuid_ICBAAccoSync, ver_ICBAAccoSync, ICBAAccoSync_dissectors, hf_cba_acco_opnum);
5093 heur_dissector_add("pn_rt", dissect_CBA_Connection_Data_heur, proto_ICBAAccoServer);