1 /* packet-dcom-cba-acco.c
2 * Routines for DCOM CBA
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #ifdef HAVE_SYS_TYPES_H
30 #include <sys/types.h>
36 #include <epan/packet.h>
37 #include <epan/expert.h>
38 #include <epan/emem.h>
39 #include <epan/addr_resolv.h>
40 #include <epan/dissectors/packet-dcerpc.h>
41 #include <epan/dissectors/packet-dcom.h>
42 #include "packet-dcom-cba-acco.h"
44 static int hf_cba_acco_opnum = -1;
46 static int hf_cba_acco_ping_factor = -1;
48 static int hf_cba_acco_count = -1;
50 static int hf_cba_acco_item = -1;
51 static int hf_cba_acco_data = -1;
52 static int hf_cba_acco_qc = -1;
53 static int hf_cba_acco_time_stamp = -1;
55 static int hf_cba_acco_conn_qos_type = -1;
56 static int hf_cba_acco_conn_qos_value = -1;
57 static int hf_cba_acco_conn_state = -1;
58 static int hf_cba_acco_conn_cons_id = -1;
59 static int hf_cba_acco_conn_version = -1;
60 static int hf_cba_acco_conn_prov_id = -1;
61 static int hf_cba_acco_conn_provider = -1;
62 static int hf_cba_acco_conn_consumer = -1;
63 static int hf_cba_acco_conn_provider_item = -1;
64 static int hf_cba_acco_conn_consumer_item = -1;
65 static int hf_cba_acco_conn_substitute = -1;
66 static int hf_cba_acco_conn_epsilon = -1;
67 static int hf_cba_acco_conn_persist = -1;
69 static int hf_cba_acco_cb_length = -1;
70 static int hf_cba_acco_cb_conn_data = -1;
71 static int hf_cba_acco_cb_version = -1;
72 static int hf_cba_acco_cb_flags = -1;
73 static int hf_cba_acco_cb_count = -1;
74 static int hf_cba_acco_cb_item = -1;
75 static int hf_cba_acco_cb_item_hole = -1;
76 static int hf_cba_acco_cb_item_length = -1;
77 static int hf_cba_acco_cb_item_data = -1;
79 static int hf_cba_connect_in = -1;
80 static int hf_cba_disconnect_in = -1;
81 static int hf_cba_connectcr_in = -1;
82 static int hf_cba_disconnectcr_in = -1;
83 static int hf_cba_disconnectme_in = -1;
84 static int hf_cba_data_first_in = -1;
85 static int hf_cba_data_last_in = -1;
87 static int hf_cba_acco_server_pICBAAccoCallback = -1;
89 static int hf_cba_acco_server_first_connect = -1;
91 static int hf_cba_acco_serversrt_prov_mac = -1;
92 static int hf_cba_acco_serversrt_cons_mac = -1;
94 static int hf_cba_acco_serversrt_cr_id = -1;
95 static int hf_cba_acco_serversrt_cr_length = -1;
96 static int hf_cba_acco_serversrt_cr_flags = -1;
97 static int hf_cba_acco_serversrt_cr_flags_timestamped = -1;
98 static int hf_cba_acco_serversrt_cr_flags_reconfigure = -1;
99 static int hf_cba_acco_serversrt_record_length = -1;
100 static int hf_cba_acco_serversrt_action = -1;
101 static int hf_cba_acco_serversrt_last_connect = -1;
103 static int hf_cba_getprovconnout = -1;
105 static int hf_cba_type_desc_len = -1;
107 static int hf_cba_connectincr = -1;
108 static int hf_cba_connectoutcr = -1;
109 static int hf_cba_connectin = -1;
110 static int hf_cba_connectout = -1;
111 static int hf_cba_getconnectionout = -1;
112 static int hf_cba_readitemout = -1;
113 static int hf_cba_writeitemin = -1;
114 static int hf_cba_addconnectionin = -1;
115 static int hf_cba_addconnectionout = -1;
116 static int hf_cba_getidout = -1;
118 static int hf_cba_getconsconnout = -1;
119 static int hf_cba_diagconsconnout = -1;
120 static int hf_cba_acco_conn_error_state = -1;
122 static int hf_cba_acco_info_max = -1;
123 static int hf_cba_acco_info_curr = -1;
125 static int hf_cba_acco_cdb_cookie = -1;
127 static int hf_cba_acco_rtauto = -1;
129 static int hf_cba_acco_prov_crid = -1;
131 static int hf_cba_acco_diag_req = -1;
132 static int hf_cba_acco_diag_in_length = -1;
133 static int hf_cba_acco_diag_out_length = -1;
134 static int hf_cba_acco_diag_data = -1;
135 static int hf_cba_acco_dcom_call = -1;
136 static int hf_cba_acco_srt_call = -1;
138 gint ett_cba_connectincr = -1;
139 gint ett_cba_connectoutcr = -1;
140 gint ett_cba_connectin = -1;
141 gint ett_cba_connectout = -1;
142 gint ett_cba_getprovconnout = -1;
143 gint ett_cba_addconnectionin = -1;
144 gint ett_cba_addconnectionout = -1;
145 gint ett_cba_getidout = -1;
146 gint ett_cba_getconnectionout = -1;
147 gint ett_cba_readitemout = -1;
148 gint ett_cba_writeitemin = -1;
149 gint ett_cba_acco_serversrt_cr_flags = -1;
150 gint ett_cba_frame_info = -1;
151 gint ett_cba_conn_info = -1;
153 static int proto_ICBAAccoMgt = -1;
154 static gint ett_ICBAAccoMgt = -1;
155 static e_uuid_t uuid_ICBAAccoMgt = { 0xcba00041, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
156 static guint16 ver_ICBAAccoMgt = 0;
158 static int proto_ICBAAccoMgt2 = -1;
159 static e_uuid_t uuid_ICBAAccoMgt2 = { 0xcba00046, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
160 static guint16 ver_ICBAAccoMgt2 = 0;
162 static int proto_ICBAAccoCallback = -1;
163 static gint ett_ICBAAccoCallback = -1;
164 static gint ett_ICBAAccoCallback_Buffer = -1;
165 static gint ett_ICBAAccoCallback_Item = -1;
166 static e_uuid_t uuid_ICBAAccoCallback = { 0xcba00042, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
167 static guint16 ver_ICBAAccoCallback = 0;
169 static int proto_ICBAAccoCallback2 = -1;
170 static e_uuid_t uuid_ICBAAccoCallback2 = { 0xcba00047, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
171 static guint16 ver_ICBAAccoCallback2 = 0;
173 static int proto_ICBAAccoServer = -1;
174 static gint ett_ICBAAccoServer = -1;
175 static e_uuid_t uuid_ICBAAccoServer = { 0xcba00043, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
176 static guint16 ver_ICBAAccoServer = 0;
178 static int proto_ICBAAccoServer2 = -1;
179 static e_uuid_t uuid_ICBAAccoServer2 = { 0xcba00048, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
180 static guint16 ver_ICBAAccoServer2 = 0;
182 static int proto_ICBAAccoServerSRT = -1;
183 static gint ett_ICBAAccoServerSRT = -1;
184 static e_uuid_t uuid_ICBAAccoServerSRT = { 0xcba00045, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
185 static guint16 ver_ICBAAccoServerSRT = 0;
187 static int proto_ICBAAccoSync = -1;
188 static gint ett_ICBAAccoSync = -1;
189 static e_uuid_t uuid_ICBAAccoSync = { 0xcba00044, 0x6c97, 0x11d1, { 0x82, 0x71, 0x00, 0xa0, 0x24, 0x42, 0xdf, 0x7d } };
190 static guint16 ver_ICBAAccoSync = 0;
194 static const value_string cba_acco_qc_vals[] = {
195 { 0x1c, "BadOutOfService" },
196 { 0x44, "UncertainLastUsableValue" },
197 { 0x48, "UncertainSubstituteSet" },
198 { 0x50, "UncertainSensorNotAccurate" },
199 { 0x80, "GoodNonCascOk" },
204 static const value_string cba_qos_type_vals[] = {
206 { 0x01, "Acyclic seconds" }, /* obsolete */
207 { 0x02, "Acyclic status" },
208 { 0x03, "Acyclic HMI" },
209 { 0x20, "Constant" },
210 { 0x30, "Cyclic Real-Time" },
215 static const value_string cba_persist_vals[] = {
216 { 0x00, "Volatile" },
217 { 0x01, "PendingPersistent" },
218 { 0x02, "Persistent" },
223 static const value_string cba_acco_conn_state_vals[] = {
229 static const value_string cba_acco_serversrt_action_vals[] = {
230 { 0x00, "Activate" },
231 { 0x01, "Deactivate" },
236 static const value_string cba_acco_serversrt_last_connect_vals[] = {
237 { 0x00, "CR not complete" },
238 { 0x01, "CR complete" },
242 static const value_string cba_acco_diag_req_vals[] = {
243 { 0x0000, "Function directory" },
244 { 0x1000, "DevCat statistic" },
245 { 0x2000, "Reset statistic" },
246 { 0x3000, "Consumer Comm. Events" },
247 { 0x4000, "Provider Comm. Events" },
251 static const true_false_string cba_acco_call_flags = {
252 "Consumer calls Provider (TRUE)",
253 "Provider calls Consumer (FALSE)"
256 static const value_string cba_qos_type_short_vals[] = {
258 { 0x01, "DCOM(sec)" }, /* obsolete */
267 typedef struct cba_frame_s {
268 cba_ldev_t *consparent;
269 cba_ldev_t *provparent;
271 guint packet_connect;
272 guint packet_disconnect;
273 guint packet_disconnectme;
278 const guint8 consmac[6];
287 typedef struct cba_connection_s {
288 cba_ldev_t *consparentacco;
289 cba_ldev_t *provparentacco;
290 cba_frame_t *parentframe;
291 guint packet_connect;
292 guint packet_disconnect;
293 guint packet_disconnectme;
300 const gchar *provitem;
306 guint16 frame_offset;
310 typedef struct server_frame_call_s {
312 cba_frame_t **frames;
313 } server_frame_call_t;
316 typedef struct server_connect_call_s {
319 cba_connection_t **conns;
320 } server_connect_call_t;
322 typedef struct server_disconnectme_call_s {
325 } server_disconnectme_call_t;
330 /* as we are a plugin, we cannot get this from libwireshark! */
331 const true_false_string acco_flags_set_truth = { "Set", "Not set" };
335 cba_connection_dump(cba_connection_t *conn, const char *role)
337 if(conn->qostype != 0x30) {
338 g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Data#%5u-#%5u",
340 conn->packet_connect,
341 conn->consid, conn->provid, conn->provitem,
342 conn->typedesclen != 0 ? val_to_str(conn->typedesc[0], dcom_variant_type_vals, "Unknown (0x%08x)") : "-",
343 val_to_str(conn->qostype, cba_qos_type_short_vals, "0x%x"), conn->qosvalue,
344 conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"),
345 conn->packet_first, conn->packet_last);
347 g_warning(" %s#%5u: CID:0x%8x PID:0x%8x PItem:\"%s\" Type:%s QoS:%s/%u Ret:%s Off:%u",
349 conn->packet_connect,
350 conn->consid, conn->provid, conn->provitem,
351 conn->typedesclen != 0 ? val_to_str(conn->typedesc[0], dcom_variant_type_vals, "Unknown (0x%08x)") : "-",
352 val_to_str(conn->qostype, cba_qos_type_short_vals, "0x%x"), conn->qosvalue,
353 conn->connret==0xffffffff ? "[pending]" : val_to_str(conn->connret, dcom_hresult_vals, "Unknown (0x%08x)"),
361 cba_object_dump(void)
374 for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) {
376 g_warning("PDev #%5u: %s IFs:%u", pdev->first_packet, ip_to_str(pdev->ip),
377 pdev->object ? g_list_length(pdev->object->interfaces) : 0);
379 for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) {
381 g_warning(" LDev#%5u: \"%s\" LDevIFs:%u AccoIFs:%u", ldev->first_packet, ldev->name,
382 ldev->ldev_object ? g_list_length(ldev->ldev_object->interfaces) : 0,
383 ldev->acco_object ? g_list_length(ldev->acco_object->interfaces) : 0);
384 for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
385 frame = frames->data;
386 g_warning(" ConsFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u",
387 frame->packet_connect, frame->conscrid, frame->provcrid, frame->length,
388 frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"),
389 frame->packet_first, frame->packet_last);
390 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
391 cba_connection_dump(conns->data, "ConsConn");
394 for(frames = ldev->provframes; frames != NULL; frames = g_list_next(frames)) {
395 frame = frames->data;
396 g_warning(" ProvFrame#%5u: CCRID:0x%x PCRID:0x%x Len:%u Ret:%s Data#%5u-#%5u",
397 frame->packet_connect, frame->conscrid, frame->provcrid, frame->length,
398 frame->conncrret==0xffffffff ? "[pending]" : val_to_str(frame->conncrret, dcom_hresult_vals, "Unknown (0x%08x)"),
399 frame->packet_first, frame->packet_last);
400 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
401 cba_connection_dump(conns->data, "ProvConn");
404 for(conns = ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
405 cba_connection_dump(conns->data, "ConsConn");
407 for(conns = ldev->provconns; conns != NULL; conns = g_list_next(conns)) {
408 cba_connection_dump(conns->data, "ProvConn");
417 cba_pdev_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid)
420 dcom_interface_t *interf;
423 interf = dcom_interface_find(pinfo, ip, ipid);
425 pdev = interf->parent->private_data;
427 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "pdev_find: no pdev for IP:%s IPID:%s",
428 ip_to_str(ip), guids_resolve_uuid_to_str(ipid));
431 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "pdev_find: unknown interface of IP:%s IPID:%s",
432 ip_to_str(ip), guids_resolve_uuid_to_str(ipid));
441 cba_pdev_add(packet_info *pinfo, const guint8 *ip)
448 for(cba_iter = cba_pdevs; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
449 pdev = cba_iter->data;
450 if(memcmp(pdev->ip, ip, 4) == 0) {
455 /* not found, create a new */
456 pdev = se_alloc(sizeof(cba_pdev_t));
457 memcpy( (void *) (pdev->ip), ip, 4);
458 pdev->first_packet = pinfo->fd->num;
461 cba_pdevs = g_list_append(cba_pdevs, pdev);
468 cba_pdev_link(packet_info *pinfo _U_, cba_pdev_t *pdev, dcom_interface_t *pdev_interf)
471 /* "crosslink" pdev interface and it's object */
472 pdev->object = pdev_interf->parent;
473 pdev_interf->private_data = pdev;
474 if(pdev_interf->parent) {
475 pdev_interf->parent->private_data = pdev;
481 cba_ldev_link(packet_info *pinfo _U_, cba_ldev_t *ldev, dcom_interface_t *ldev_interf)
484 /* "crosslink" interface and it's object */
485 ldev->ldev_object = ldev_interf->parent;
486 ldev_interf->private_data = ldev;
487 if(ldev_interf->parent) {
488 ldev_interf->parent->private_data = ldev;
494 cba_ldev_link_acco(packet_info *pinfo _U_, cba_ldev_t *ldev, dcom_interface_t *acco_interf)
497 /* "crosslink" interface and it's object */
498 ldev->acco_object = acco_interf->parent;
499 acco_interf->private_data = ldev;
500 if(acco_interf->parent) {
501 acco_interf->parent->private_data = ldev;
507 cba_ldev_add(packet_info *pinfo, cba_pdev_t *pdev, const char *name)
514 for(cba_iter = pdev->ldevs; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
515 ldev = cba_iter->data;
516 if(strcmp(ldev->name, name) == 0) {
521 /* not found, create a new */
522 ldev = se_alloc(sizeof(cba_ldev_t));
523 ldev->name = se_strdup(name);
524 ldev->first_packet = pinfo->fd->num;
525 ldev->ldev_object = NULL;
526 ldev->acco_object = NULL;
529 ldev->provframes = NULL;
530 ldev->consframes = NULL;
531 ldev->provconns = NULL;
532 ldev->consconns = NULL;
534 pdev->ldevs = g_list_append(pdev->ldevs, ldev);
541 cba_ldev_find(packet_info *pinfo, const guint8 *ip, e_uuid_t *ipid) {
542 /*dcerpc_info *info = (dcerpc_info *)pinfo->private_data;*/
543 dcom_interface_t *interf;
547 interf = dcom_interface_find(pinfo, ip, ipid);
549 ldev = interf->private_data;
552 ldev = interf->parent->private_data;
555 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "Unknown LDev of %s",
559 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE, "Unknown IPID of %s",
569 cba_acco_add(packet_info *pinfo, const char *acco)
578 ip_str = g_strdup(acco);
579 delim = strchr(ip_str, '!');
586 if(!get_host_ipaddr(ip_str, &ip)) {
592 pdev = cba_pdev_add(pinfo, (char *) &ip);
595 ldev = cba_ldev_add(pinfo, pdev, delim);
604 cba_packet_in_range(packet_info *pinfo, guint packet_connect, guint packet_disconnect, guint packet_disconnectme)
607 if(packet_connect == 0) {
608 g_warning("cba_packet_in_range#%u: packet_connect not set?", pinfo->fd->num);
611 if(packet_connect == 0 || pinfo->fd->num < packet_connect) {
614 if(packet_disconnect != 0 && pinfo->fd->num > packet_disconnect) {
617 if(packet_disconnectme != 0 && pinfo->fd->num > packet_disconnectme) {
626 cba_frame_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_frame_t *frame)
629 proto_item *sub_item;
630 proto_tree *sub_tree;
633 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "Cons:\"%s\" CCRID:0x%x Prov:\"%s\" PCRID:0x%x QoS:%s/%ums Len:%u",
634 frame->consparent ? frame->consparent->name : "", frame->conscrid,
635 frame->provparent ? frame->provparent->name : "", frame->provcrid,
636 val_to_str(frame->qostype, cba_qos_type_short_vals, "%u"), frame->qosvalue, frame->length);
637 sub_tree = proto_item_add_subtree(sub_item, ett_cba_frame_info);
638 PROTO_ITEM_SET_GENERATED(sub_item);
640 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type, tvb, 0, 0, frame->qostype);
641 PROTO_ITEM_SET_GENERATED(item);
642 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_value, tvb, 0, 0, frame->qosvalue);
643 PROTO_ITEM_SET_GENERATED(item);
644 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_cr_id, tvb, 0, 0, frame->conscrid);
645 PROTO_ITEM_SET_GENERATED(item);
646 item = proto_tree_add_uint(sub_tree, hf_cba_acco_prov_crid, tvb, 0, 0, frame->provcrid);
647 PROTO_ITEM_SET_GENERATED(item);
648 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_cr_length, tvb, 0, 0, frame->length);
649 PROTO_ITEM_SET_GENERATED(item);
651 if(frame->consparent != NULL) {
652 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_consumer, tvb, 0, 0, frame->consparent->name);
653 PROTO_ITEM_SET_GENERATED(item);
655 if(frame->provparent != NULL) {
656 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider, tvb, 0, 0, frame->provparent->name);
657 PROTO_ITEM_SET_GENERATED(item);
660 item = proto_tree_add_uint(sub_tree, hf_cba_connectcr_in,
661 tvb, 0, 0, frame->packet_connect);
662 PROTO_ITEM_SET_GENERATED(item);
663 item = proto_tree_add_uint(sub_tree, hf_cba_data_first_in,
664 tvb, 0, 0, frame->packet_first);
665 PROTO_ITEM_SET_GENERATED(item);
666 item = proto_tree_add_uint(sub_tree, hf_cba_data_last_in,
667 tvb, 0, 0, frame->packet_last);
668 PROTO_ITEM_SET_GENERATED(item);
669 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectcr_in,
670 tvb, 0, 0, frame->packet_disconnect);
671 PROTO_ITEM_SET_GENERATED(item);
672 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectme_in,
673 tvb, 0, 0, frame->packet_disconnectme);
674 PROTO_ITEM_SET_GENERATED(item);
680 cba_frame_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev,
681 guint16 qostype, guint16 qosvalue, const guint8 *consmac, guint16 conscrid, guint16 length)
687 for(cba_iter = cons_ldev->consframes; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
688 frame = cba_iter->data;
689 if( frame->conscrid == conscrid &&
690 memcmp(frame->consmac, consmac, 6) == 0 &&
691 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
696 frame = se_alloc(sizeof(cba_frame_t));
698 frame->consparent = cons_ldev;
699 frame->provparent = prov_ldev;
701 frame->packet_connect = pinfo->fd->num;
702 frame->packet_disconnect = 0;
703 frame->packet_disconnectme = 0;
704 frame->packet_first = 0;
705 frame->packet_last = 0;
707 frame->length = length;
708 memcpy( (guint8 *) (frame->consmac), consmac, sizeof(frame->consmac));
709 frame->conscrid = conscrid;
710 frame->qostype = qostype;
711 frame->qosvalue = qosvalue;
717 frame->conncrret = -1;
719 cons_ldev->consframes = g_list_append(cons_ldev->consframes, frame);
720 prov_ldev->provframes = g_list_append(prov_ldev->provframes, frame);
727 cba_frame_disconnect(packet_info *pinfo, cba_frame_t *frame)
730 if(frame->packet_disconnect == 0) {
731 frame->packet_disconnect = pinfo->fd->num;
734 if(frame->packet_disconnect != pinfo->fd->num) {
735 g_warning("cba_frame_disconnect#%u: frame already disconnected in #%u",
736 pinfo->fd->num, frame->packet_disconnect);
742 cba_frame_disconnectme(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev)
748 for(frames = cons_ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
749 frame = frames->data;
751 if( frame->provparent == prov_ldev &&
752 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
754 cba_frame_info(tvb, pinfo, tree, frame);
756 if(frame->packet_disconnectme == 0) {
757 frame->packet_disconnectme = pinfo->fd->num;
760 if(frame->packet_disconnectme != pinfo->fd->num) {
761 g_warning("cba_frame_disconnectme#%u: frame already disconnectme'd in #%u",
762 pinfo->fd->num, frame->packet_disconnectme);
770 cba_frame_find_by_cons(packet_info *pinfo, const guint8 *consmac, guint16 conscrid)
781 for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) {
785 for(ldevs = pdev->ldevs; ldevs != NULL; ldevs = g_list_next(ldevs)) {
789 for(frames = ldev->consframes; frames != NULL; frames = g_list_next(frames)) {
790 frame = frames->data;
792 if( frame->conscrid == conscrid &&
793 memcmp(frame->consmac, consmac, 6) == 0 &&
794 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
806 cba_frame_find_by_provcrid(packet_info *pinfo, cba_ldev_t *prov_ldev, guint32 provcrid)
812 if(prov_ldev == NULL) {
816 for(frames = prov_ldev->provframes; frames != NULL; frames = g_list_next(frames)) {
817 frame = frames->data;
819 if( frame->provcrid == provcrid &&
820 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
825 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
826 "Unknown provider frame with ProvCRID:0x%x", provcrid);
833 cba_frame_incoming_data(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_frame_t *frame)
835 if(frame->packet_first == 0) {
836 frame->packet_first = pinfo->fd->num;
839 if( pinfo->fd->num > frame->packet_last &&
840 cba_packet_in_range(pinfo, frame->packet_connect, frame->packet_disconnect, frame->packet_disconnectme)) {
841 frame->packet_last = pinfo->fd->num;
847 cba_connection_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, cba_connection_t *conn)
850 proto_item *sub_item;
851 proto_tree *sub_tree;
854 if(conn->qostype != 0x30) {
855 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x QoS:%s/%ums",
856 conn->provitem, conn->provid, conn->consid,
857 val_to_str(conn->qostype, cba_qos_type_short_vals, "%u"), conn->qosvalue);
859 sub_item = proto_tree_add_text(tree, tvb, 0, 0, "ProvItem:\"%s\" PID:0x%x CID:0x%x Len:%u",
860 conn->provitem, conn->provid, conn->consid, conn->length);
862 sub_tree = proto_item_add_subtree(sub_item, ett_cba_conn_info);
863 PROTO_ITEM_SET_GENERATED(sub_item);
865 item = proto_tree_add_string(sub_tree, hf_cba_acco_conn_provider_item, tvb, 0, 0 /* len */, conn->provitem);
866 PROTO_ITEM_SET_GENERATED(item);
867 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_prov_id, tvb, 0, 0 /* len */, conn->provid);
868 PROTO_ITEM_SET_GENERATED(item);
869 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_cons_id, tvb, 0, 0 /* len */, conn->consid);
870 PROTO_ITEM_SET_GENERATED(item);
871 item = proto_tree_add_uint(sub_tree, hf_cba_acco_serversrt_record_length, tvb, 0, 0 /* len */, conn->length);
872 PROTO_ITEM_SET_GENERATED(item);
874 if(conn->qostype != 0x30) {
875 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_type,
876 tvb, 0, 0, conn->qostype);
877 PROTO_ITEM_SET_GENERATED(item);
878 item = proto_tree_add_uint(sub_tree, hf_cba_acco_conn_qos_value,
879 tvb, 0, 0, conn->qosvalue);
880 PROTO_ITEM_SET_GENERATED(item);
881 item = proto_tree_add_uint(sub_tree, hf_cba_connect_in,
882 tvb, 0, 0, conn->packet_connect);
883 PROTO_ITEM_SET_GENERATED(item);
884 item = proto_tree_add_uint(sub_tree, hf_cba_data_first_in,
885 tvb, 0, 0, conn->packet_first);
886 PROTO_ITEM_SET_GENERATED(item);
887 item = proto_tree_add_uint(sub_tree, hf_cba_data_last_in,
888 tvb, 0, 0, conn->packet_last);
889 PROTO_ITEM_SET_GENERATED(item);
890 item = proto_tree_add_uint(sub_tree, hf_cba_disconnect_in,
891 tvb, 0, 0, conn->packet_disconnect);
892 PROTO_ITEM_SET_GENERATED(item);
893 item = proto_tree_add_uint(sub_tree, hf_cba_disconnectme_in,
894 tvb, 0, 0, conn->packet_disconnectme);
895 PROTO_ITEM_SET_GENERATED(item);
901 static cba_connection_t *
902 cba_connection_connect(packet_info *pinfo, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev, cba_frame_t *cons_frame,
903 guint16 qostype, guint16 qosvalue, const char *provitem, guint32 consid, guint16 length,
904 guint16 *typedesc, guint16 typedesclen)
907 cba_connection_t *conn;
910 /* find connection */
911 if(cons_frame != NULL) {
912 /* SRT: search in frame */
913 for(cba_iter = cons_frame->conns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
914 conn = cba_iter->data;
915 if(conn->consid == consid) {
920 /* DCOM: search in ldev */
921 for(cba_iter = cons_ldev->consconns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
922 conn = cba_iter->data;
923 if( conn->consid == consid &&
924 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
930 conn = se_alloc(sizeof(cba_connection_t));
932 conn->consparentacco = cons_ldev;
933 conn->provparentacco = prov_ldev;
934 conn->parentframe = cons_frame;
936 conn->packet_connect = pinfo->fd->num;
937 conn->packet_disconnect = 0;
938 conn->packet_disconnectme = 0;
939 conn->packet_first = 0;
940 conn->packet_last = 0;
942 conn->consid = consid;
943 conn->provitem = se_strdup(provitem);
944 conn->typedesclen = typedesclen;
945 conn->typedesc = typedesc;
946 conn->qostype = qostype;
947 conn->qosvalue = qosvalue;
948 conn->length = length;
953 if(cons_frame != NULL) {
954 conn->frame_offset = cons_frame->offset;
955 conn->length = length;
956 cons_frame->offset += length;
957 cons_frame->conns = g_list_append(cons_frame->conns, conn);
959 conn->frame_offset = 0;
960 cons_ldev->consconns = g_list_append(cons_ldev->consconns, conn);
961 prov_ldev->provconns = g_list_append(prov_ldev->provconns, conn);
969 cba_connection_disconnect(packet_info *pinfo, cba_connection_t *conn)
971 /* XXX - detect multiple disconnects? */
972 if(conn->packet_disconnect == 0) {
973 conn->packet_disconnect = pinfo->fd->num;
976 if(conn->packet_disconnect != pinfo->fd->num) {
977 g_warning("connection_disconnect#%u: already disconnected",
978 conn->packet_disconnect);
984 cba_connection_disconnectme(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_ldev_t *prov_ldev)
987 cba_connection_t *conn;
990 for(conns = cons_ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
993 if( conn->provparentacco == prov_ldev &&
994 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
996 cba_connection_info(tvb, pinfo, tree, conn);
998 if(conn->packet_disconnectme == 0) {
999 conn->packet_disconnectme = pinfo->fd->num;
1002 if(conn->packet_disconnectme != pinfo->fd->num) {
1003 g_warning("connection_disconnectme#%u: already disconnectme'd",
1004 conn->packet_disconnectme);
1011 static cba_connection_t *
1012 cba_connection_find_by_provid(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_ldev_t *prov_ldev, guint32 provid)
1015 cba_connection_t *conn;
1018 for(cba_iter = prov_ldev->provconns; cba_iter != NULL; cba_iter = g_list_next(cba_iter)) {
1019 conn = cba_iter->data;
1020 if( conn->provid == provid &&
1021 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
1030 cba_connection_incoming_data(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, cba_connection_t *conn)
1032 if(conn->packet_first == 0) {
1033 conn->packet_first = pinfo->fd->num;
1036 if( pinfo->fd->num > conn->packet_last &&
1037 cba_packet_in_range(pinfo, conn->packet_connect, conn->packet_disconnect, conn->packet_disconnectme)) {
1038 conn->packet_last = pinfo->fd->num;
1043 /* dissect a response containing an array of hresults (e.g: ICBAAccoMgt::RemoveConnections) */
1045 dissect_HResultArray_resp(tvbuff_t *tvb, int offset,
1046 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1050 guint32 u32ArraySize = 0;
1055 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1057 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1061 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1065 u32Tmp = u32ArraySize;
1067 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1068 &u32HResult, u32Idx);
1073 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1076 if (check_col(pinfo->cinfo, COL_INFO)) {
1077 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1079 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1087 dissect_ICBAAccoServer_SetActivation_resp(tvbuff_t *tvb, int offset,
1088 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1092 guint32 u32ArraySize = 0;
1098 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1100 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1101 PROTO_ITEM_SET_GENERATED(item);
1102 pinfo->profinet_type = 1;
1104 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1108 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1112 u32Tmp = u32ArraySize;
1114 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1115 &u32HResult, u32Idx);
1120 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1123 if (check_col(pinfo->cinfo, COL_INFO)) {
1124 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1126 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1134 dissect_ICBAAccoServerSRT_Disconnect_resp(tvbuff_t *tvb, int offset,
1135 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1139 guint32 u32ArraySize = 0;
1145 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1147 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1148 PROTO_ITEM_SET_GENERATED(item);
1149 pinfo->profinet_type = 3;
1151 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1155 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1159 u32Tmp = u32ArraySize;
1161 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1162 &u32HResult, u32Idx);
1167 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1170 if (check_col(pinfo->cinfo, COL_INFO)) {
1171 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1173 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1181 dissect_ICBAAccoServerSRT_SetActivation_resp(tvbuff_t *tvb, int offset,
1182 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1186 guint32 u32ArraySize = 0;
1192 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1194 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1195 PROTO_ITEM_SET_GENERATED(item);
1196 pinfo->profinet_type = 3;
1198 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1202 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1206 u32Tmp = u32ArraySize;
1208 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1209 &u32HResult, u32Idx);
1214 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1217 if (check_col(pinfo->cinfo, COL_INFO)) {
1218 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1220 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1228 dissect_ICBAAccoServer_Connect_rqst(tvbuff_t *tvb, int offset,
1229 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1232 guint16 u16QoSValue;
1235 guint32 u32ArraySize;
1237 guint32 u32VariableOffset;
1238 proto_item *sub_item;
1239 proto_tree *sub_tree;
1240 guint32 u32SubStart;
1244 gchar szItem[1000] = { 0 };
1245 guint32 u32MaxItemLen = sizeof(szItem);
1246 gchar szCons[1000] = { 0 };
1247 guint32 u32MaxConsLen = sizeof(szCons);
1250 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1251 dcom_interface_t *cons_interf;
1252 cba_ldev_t *cons_ldev;
1253 cba_ldev_t *prov_ldev;
1254 cba_connection_t *conn;
1255 server_connect_call_t *call;
1258 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1260 /* get corresponding provider ldev */
1261 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1263 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1264 PROTO_ITEM_SET_GENERATED(item);
1265 pinfo->profinet_type = 2;
1267 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1268 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
1270 /* find the consumer ldev by it's name */
1271 cons_ldev = cba_acco_add(pinfo, szCons);
1273 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1274 hf_cba_acco_conn_qos_type, &u16QoSType);
1275 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1276 hf_cba_acco_conn_qos_value, &u16QoSValue);
1277 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
1278 hf_cba_acco_conn_state, &u8State);
1280 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
1281 if(cons_interf == NULL) {
1282 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1283 "Server_Connect: consumer interface invalid");
1286 /* "crosslink" consumer interface and it's object */
1287 if(cons_interf != NULL && cons_ldev != NULL) {
1288 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
1291 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1292 hf_cba_acco_count, &u32Count);
1294 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1297 /* link connections infos to the call */
1298 if(prov_ldev != NULL && cons_ldev != NULL) {
1299 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1300 call->conn_count = 0;
1302 call->conns = (cba_connection_t **) (call+1);
1303 info->call_data->private_data = call;
1308 u32VariableOffset = offset + u32ArraySize*16;
1310 /* array of CONNECTINs */
1312 while (u32ArraySize--) {
1313 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, FALSE);
1314 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
1315 u32SubStart = offset;
1318 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1321 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1322 hf_cba_acco_conn_provider_item, szItem, u32MaxItemLen);
1326 offset = dissect_dcom_VARTYPE(tvb, offset, pinfo, sub_tree, drep,
1330 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1333 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1334 hf_cba_acco_conn_epsilon);
1337 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1338 hf_cba_acco_conn_cons_id, &u32ConsID);
1340 /* add to object database */
1341 if(prov_ldev != NULL && cons_ldev != NULL) {
1342 conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL,
1343 u16QoSType, u16QoSValue, szItem, u32ConsID, 0,
1344 /* XXX - VarType must be translated to new type description if it includes an array (0x2000) */
1345 se_memdup(&u16VarType, 2), 1);
1347 cba_connection_info(tvb, pinfo, sub_tree, conn);
1352 /* add to current call */
1355 call->conns[u32Idx-1] = conn;
1358 /* update subtree header */
1359 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", VarType=%s",
1360 u32Idx, u32ConsID, szItem,
1361 val_to_str(u16VarType, dcom_variant_type_vals, "Unknown (0x%04x)") );
1362 proto_item_set_len(sub_item, offset - u32SubStart);
1367 if (check_col(pinfo->cinfo, COL_INFO)) {
1368 col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count);
1371 return u32VariableOffset;
1375 dissect_ICBAAccoServer2_Connect2_rqst(tvbuff_t *tvb, int offset,
1376 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1379 guint16 u16QoSValue;
1382 guint32 u32ArraySize;
1384 guint32 u32VariableOffset;
1385 proto_item *sub_item;
1386 proto_tree *sub_tree;
1387 guint32 u32SubStart;
1391 gchar szItem[1000] = { 0 };
1392 guint32 u32MaxItemLen = sizeof(szItem);
1393 gchar szCons[1000] = { 0 };
1394 guint32 u32MaxConsLen = sizeof(szCons);
1396 guint16 u16TypeDescLen;
1397 guint32 u32ArraySize2;
1399 guint16 u16VarType2 = -1;
1401 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1402 dcom_interface_t *cons_interf;
1403 cba_ldev_t *prov_ldev;
1404 cba_ldev_t *cons_ldev;
1405 cba_connection_t *conn;
1406 server_connect_call_t *call = NULL;
1407 guint16 typedesclen = 0;
1408 guint16 *typedesc = NULL;
1411 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1413 /* get corresponding provider ldev */
1414 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1416 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1417 PROTO_ITEM_SET_GENERATED(item);
1418 pinfo->profinet_type = 2;
1420 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1421 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
1423 /* find the consumer ldev by it's name */
1424 cons_ldev = cba_acco_add(pinfo, szCons);
1426 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1427 hf_cba_acco_conn_qos_type, &u16QoSType);
1428 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
1429 hf_cba_acco_conn_qos_value, &u16QoSValue);
1430 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
1431 hf_cba_acco_conn_state, &u8State);
1433 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, &u32Pointer);
1436 offset = dissect_dcom_MInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
1437 if(cons_interf == NULL) {
1438 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1439 "Server2_Connect2: consumer interface invalid");
1442 /* GetConnectionData do it this way */
1446 /* "crosslink" consumer interface and it's object */
1447 if(cons_interf != NULL && cons_ldev != NULL) {
1448 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
1451 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1452 hf_cba_acco_count, &u32Count);
1454 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1457 /* link connection infos to the call */
1458 if(prov_ldev != NULL && cons_ldev != NULL) {
1459 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1460 call->conn_count = 0;
1462 call->conns = (cba_connection_t **) (call+1);
1463 info->call_data->private_data = call;
1468 u32VariableOffset = offset + u32ArraySize*20;
1470 /* array of CONNECTINs */
1472 while (u32ArraySize--) {
1473 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, FALSE);
1474 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
1475 u32SubStart = offset;
1478 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1481 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1482 hf_cba_acco_conn_provider_item, szItem, u32MaxItemLen);
1486 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
1487 hf_cba_type_desc_len, &u16TypeDescLen);
1489 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1493 u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1496 /* limit the allocation to a reasonable size */
1497 if(u32ArraySize2 < 1000) {
1498 typedesc = se_alloc0(u32ArraySize2 * 2);
1499 typedesclen = u32ArraySize2;
1505 /* extended type description will build an array here */
1507 while (u32ArraySize2--) {
1508 /* ToBeDone: some of the type description values are counts */
1509 u32VariableOffset = dissect_dcom_VARTYPE(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1512 if(typedesc != NULL && u32Idx2 <= typedesclen) {
1513 typedesc[u32Idx2-1] = u16VarType;
1516 /* remember first VarType only */
1518 u16VarType2 = u16VarType;
1525 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
1528 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
1529 hf_cba_acco_conn_epsilon);
1532 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1533 hf_cba_acco_conn_cons_id, &u32ConsID);
1535 /* add to object database */
1536 if(prov_ldev != NULL && cons_ldev != NULL) {
1537 conn = cba_connection_connect(pinfo, cons_ldev, prov_ldev, /*cons_frame*/ NULL,
1538 u16QoSType, u16QoSValue, szItem, u32ConsID, 0,
1539 typedesc, typedesclen);
1541 cba_connection_info(tvb, pinfo, sub_tree, conn);
1546 /* add to current call */
1549 call->conns[u32Idx-1] = conn;
1552 /* update subtree header */
1553 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", TypeDesc=%s",
1554 u32Idx, u32ConsID, szItem,
1555 val_to_str(u16VarType2, dcom_variant_type_vals, "Unknown (0x%04x)") );
1556 proto_item_set_len(sub_item, offset - u32SubStart);
1561 if (check_col(pinfo->cinfo, COL_INFO)) {
1562 col_append_fstr(pinfo->cinfo, COL_INFO, ": Consumer=\"%s\" Cnt=%u", szCons, u32Count);
1565 return u32VariableOffset;
1570 dissect_ICBAAccoServer_Connect_resp(tvbuff_t *tvb, int offset,
1571 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1573 guint8 u8FirstConnect;
1575 guint32 u32ArraySize = 0;
1579 proto_item *sub_item;
1580 proto_tree *sub_tree;
1581 guint32 u32SubStart;
1583 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1584 server_connect_call_t *call = info->call_data->private_data;
1585 cba_connection_t *conn;
1588 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1591 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1592 "No request info, response data ignored");
1595 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1596 PROTO_ITEM_SET_GENERATED(item);
1597 pinfo->profinet_type = 1;
1599 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
1600 hf_cba_acco_server_first_connect, &u8FirstConnect);
1602 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1606 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1609 /* array of CONNECTOUTs */
1610 while(u32ArraySize--) {
1611 sub_item = proto_tree_add_item(tree, hf_cba_connectout, tvb, offset, 8, FALSE);
1612 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectout);
1613 u32SubStart = offset;
1615 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
1616 hf_cba_acco_conn_prov_id, &u32ProvID);
1618 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
1619 &u32HResult, u32Idx);
1621 /* put response data into the connection */
1622 if(call && u32Idx <= call->conn_count) {
1623 conn = call->conns[u32Idx-1];
1624 conn->provid = u32ProvID;
1625 conn->connret = u32HResult;
1627 cba_connection_info(tvb, pinfo, sub_tree, conn);
1630 proto_item_append_text(sub_item, "[%u]: ProvID=0x%x %s",
1632 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1633 proto_item_set_len(sub_item, offset - u32SubStart);
1639 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1642 /* this might be a global HRESULT */
1643 while(call && u32Idx <= call->conn_count) {
1644 conn = call->conns[u32Idx-1];
1646 conn->connret = u32HResult;
1650 if (check_col(pinfo->cinfo, COL_INFO)) {
1651 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u -> %s",
1652 (u8FirstConnect) ? "First" : "NotFirst",
1654 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1662 dissect_ICBAAccoServer_Disconnect_rqst(tvbuff_t *tvb, int offset,
1663 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1666 guint32 u32ArraySize;
1670 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1671 cba_ldev_t *prov_ldev;
1672 cba_connection_t *conn;
1673 server_connect_call_t *call;
1676 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1678 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1679 PROTO_ITEM_SET_GENERATED(item);
1680 pinfo->profinet_type = 2;
1682 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1683 hf_cba_acco_count, &u32Count);
1685 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1688 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1690 /* link connection infos to the call */
1691 if(prov_ldev != NULL) {
1692 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
1693 call->conn_count = 0;
1695 call->conns = (cba_connection_t **) (call+1);
1696 info->call_data->private_data = call;
1702 while (u32ArraySize--) {
1703 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
1704 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
1706 /* add to current call */
1708 conn = cba_connection_find_by_provid(tvb, pinfo, tree, prov_ldev, u32ProvID);
1710 call->conns[u32Idx-1] = conn;
1716 /* update column info now */
1717 if (check_col(pinfo->cinfo, COL_INFO)) {
1718 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
1726 dissect_ICBAAccoServer_Disconnect_resp(tvbuff_t *tvb, int offset,
1727 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1731 guint32 u32ArraySize = 0;
1735 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1736 server_connect_call_t *call = info->call_data->private_data;
1737 cba_connection_t *conn;
1740 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1743 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
1744 "No request info, response data ignored");
1747 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1748 PROTO_ITEM_SET_GENERATED(item);
1749 pinfo->profinet_type = 1;
1751 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
1755 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1759 u32Tmp = u32ArraySize;
1761 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
1762 &u32HResult, u32Idx);
1764 /* mark this connection as disconnected */
1765 if(call && u32Idx <= call->conn_count) {
1766 conn = call->conns[u32Idx-1];
1768 cba_connection_disconnect(pinfo, conn);
1776 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1779 if (check_col(pinfo->cinfo, COL_INFO)) {
1780 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
1782 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1790 dissect_ICBAAccoServerSRT_Disconnect_rqst(tvbuff_t *tvb, int offset,
1791 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1794 guint32 u32ArraySize;
1800 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1802 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
1803 PROTO_ITEM_SET_GENERATED(item);
1804 pinfo->profinet_type = 4;
1806 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
1807 hf_cba_acco_count, &u32Count);
1809 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
1813 while (u32ArraySize--) {
1814 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
1815 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
1819 /* update column info now */
1820 if (check_col(pinfo->cinfo, COL_INFO)) {
1821 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
1829 dissect_ICBAAccoServer_DisconnectMe_rqst(tvbuff_t *tvb, int offset,
1830 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1833 guint32 u32MaxStr = sizeof(szStr);
1835 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1836 cba_ldev_t *prov_ldev;
1837 cba_ldev_t *cons_ldev;
1838 server_disconnectme_call_t *call;
1841 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1843 /* get corresponding provider ldev */
1844 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1846 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
1847 PROTO_ITEM_SET_GENERATED(item);
1848 pinfo->profinet_type = 2;
1850 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1851 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
1853 /* find the consumer ldev by it's name */
1854 cons_ldev = cba_acco_add(pinfo, szStr);
1856 if(prov_ldev != NULL && cons_ldev != NULL) {
1857 call = se_alloc(sizeof(server_disconnectme_call_t));
1858 call->cons = cons_ldev;
1859 call->prov = prov_ldev;
1860 info->call_data->private_data = call;
1863 /* update column info now */
1864 if (check_col(pinfo->cinfo, COL_INFO)) {
1865 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
1873 dissect_ICBAAccoServer_DisconnectMe_resp(tvbuff_t *tvb, int offset,
1874 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1878 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1879 server_disconnectme_call_t *call;
1882 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1884 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1885 PROTO_ITEM_SET_GENERATED(item);
1886 pinfo->profinet_type = 1;
1888 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1891 call = info->call_data->private_data;
1893 cba_connection_disconnectme(tvb, pinfo, tree, call->cons, call->prov);
1896 if (check_col(pinfo->cinfo, COL_INFO)) {
1897 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1898 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1906 dissect_ICBAAccoServerSRT_DisconnectMe_rqst(tvbuff_t *tvb, int offset,
1907 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1910 guint32 u32MaxStr = sizeof(szStr);
1912 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1913 cba_ldev_t *prov_ldev;
1914 cba_ldev_t *cons_ldev;
1915 server_disconnectme_call_t *call;
1918 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
1920 /* get corresponding provider ldev */
1921 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
1923 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
1924 PROTO_ITEM_SET_GENERATED(item);
1925 pinfo->profinet_type = 4;
1927 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
1928 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
1930 /* find the consumer ldev by it's name */
1931 cons_ldev = cba_acco_add(pinfo, szStr);
1933 if(prov_ldev != NULL && cons_ldev != NULL) {
1934 call = se_alloc(sizeof(server_disconnectme_call_t));
1935 call->cons = cons_ldev;
1936 call->prov = prov_ldev;
1937 info->call_data->private_data = call;
1940 /* update column info now */
1941 if (check_col(pinfo->cinfo, COL_INFO)) {
1942 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
1950 dissect_ICBAAccoServerSRT_DisconnectMe_resp(tvbuff_t *tvb, int offset,
1951 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1955 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
1956 server_disconnectme_call_t *call;
1959 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1961 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
1962 PROTO_ITEM_SET_GENERATED(item);
1963 pinfo->profinet_type = 3;
1965 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1968 call = info->call_data->private_data;
1970 cba_frame_disconnectme(tvb, pinfo, tree, call->cons, call->prov);
1973 if (check_col(pinfo->cinfo, COL_INFO)) {
1974 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
1975 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
1983 dissect_ICBAAccoServer_Ping_resp(tvbuff_t *tvb, int offset,
1984 packet_info *pinfo, proto_tree *tree, guint8 *drep)
1990 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
1992 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
1993 PROTO_ITEM_SET_GENERATED(item);
1994 pinfo->profinet_type = 1;
1996 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
1999 if (check_col(pinfo->cinfo, COL_INFO)) {
2000 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2001 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2009 dissect_ICBAAccoServer_SetActivation_rqst(tvbuff_t *tvb, int offset,
2010 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2014 guint32 u32ArraySize;
2020 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2022 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
2023 PROTO_ITEM_SET_GENERATED(item);
2024 pinfo->profinet_type = 2;
2026 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2027 hf_cba_acco_conn_state, &u8State);
2029 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2030 hf_cba_acco_count, &u32Count);
2032 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2036 while (u32ArraySize--) {
2037 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2038 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2042 /* update column info now */
2043 if (check_col(pinfo->cinfo, COL_INFO)) {
2044 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2052 dissect_ICBAAccoServerSRT_SetActivation_rqst(tvbuff_t *tvb, int offset,
2053 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2057 guint32 u32ArraySize;
2063 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2065 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2066 PROTO_ITEM_SET_GENERATED(item);
2067 pinfo->profinet_type = 4;
2069 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2070 hf_cba_acco_conn_state, &u8State);
2072 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2073 hf_cba_acco_count, &u32Count);
2075 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2079 while (u32ArraySize--) {
2080 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2081 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2085 /* update column info now */
2086 if (check_col(pinfo->cinfo, COL_INFO)) {
2087 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2095 dissect_ICBAAccoServer_Ping_rqst(tvbuff_t *tvb, int offset,
2096 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2099 guint32 u32MaxStr = sizeof(szStr);
2103 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2105 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
2106 PROTO_ITEM_SET_GENERATED(item);
2107 pinfo->profinet_type = 2;
2109 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
2110 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
2112 /* update column info now */
2113 if (check_col(pinfo->cinfo, COL_INFO)) {
2114 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
2122 dissect_ICBAAccoServerSRT_ConnectCR_rqst(tvbuff_t *tvb, int offset,
2123 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2125 gchar szCons[1000] = { 0 };
2126 guint32 u32MaxConsLen = sizeof(szCons);
2128 guint16 u16QoSValue;
2129 guint8 u8ConsMac[6];
2131 guint16 u16CRLength;
2134 guint32 u32ArraySize;
2136 proto_item *item = NULL;
2137 proto_tree *flags_tree = NULL;
2138 proto_item *sub_item;
2139 proto_tree *sub_tree;
2140 guint32 u32SubStart;
2141 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2142 dcom_interface_t *cons_interf;
2143 cba_ldev_t *prov_ldev;
2144 cba_ldev_t *cons_ldev;
2146 server_frame_call_t *call;
2149 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2151 /* get corresponding provider ldev */
2152 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2154 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2155 PROTO_ITEM_SET_GENERATED(item);
2156 pinfo->profinet_type = 4;
2159 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
2160 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
2162 /* find the consumer ldev by it's name */
2163 cons_ldev = cba_acco_add(pinfo, szCons);
2165 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
2166 hf_cba_acco_conn_qos_type, &u16QoSType);
2167 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
2168 hf_cba_acco_conn_qos_value, &u16QoSValue);
2170 offset = dissect_dcom_PMInterfacePointer(tvb, offset, pinfo, tree, drep, 0, &cons_interf);
2171 if(cons_interf == NULL) {
2172 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2173 "ServerSRT_ConnectCR: consumer interface invalid");
2176 /* "crosslink" consumer interface and it's object */
2177 if(cons_interf != NULL && cons_ldev != NULL) {
2178 cba_ldev_link_acco(pinfo, cons_ldev, cons_interf);
2181 /* ConsumerMAC (big-endian, 1byte-aligned) */
2182 tvb_memcpy(tvb, u8ConsMac, offset, 6);
2184 proto_tree_add_ether(tree, hf_cba_acco_serversrt_cons_mac, tvb,
2185 offset, 6, u8ConsMac);
2188 /* add flags subtree */
2189 offset = dissect_dcom_DWORD(tvb, offset, pinfo, NULL /*tree*/, drep,
2190 0 /* hfindex */, &u32Flags);
2192 item = proto_tree_add_uint_format_value(tree, hf_cba_acco_serversrt_cr_flags,
2193 tvb, offset, 4, u32Flags,
2194 "0x%02x (%s, %s)", u32Flags,
2195 (u32Flags & 0x2) ? "Reconfigure" : "not Reconfigure",
2196 (u32Flags & 0x1) ? "Timestamped" : "not Timestamped");
2197 flags_tree = proto_item_add_subtree(item, ett_cba_acco_serversrt_cr_flags);
2198 proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_reconfigure, tvb, offset, 4, u32Flags);
2199 proto_tree_add_boolean(flags_tree, hf_cba_acco_serversrt_cr_flags_timestamped, tvb, offset, 4, u32Flags);
2202 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2203 hf_cba_acco_count, &u32Count);
2205 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2208 /* link frame infos to the call */
2209 if(prov_ldev != NULL && cons_ldev != NULL && u32ArraySize < 100) {
2210 call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *));
2211 call->frame_count = 0;
2212 call->frames = (cba_frame_t **) (call+1);
2213 info->call_data->private_data = call;
2219 while (u32ArraySize--) {
2220 /* array of CONNECTINCRs */
2221 sub_item = proto_tree_add_item(tree, hf_cba_connectincr, tvb, offset, 0, FALSE);
2222 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectincr);
2223 u32SubStart = offset;
2225 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2226 hf_cba_acco_serversrt_cr_id, &u16CRID);
2228 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2229 hf_cba_acco_serversrt_cr_length, &u16CRLength);
2231 /* add to object database */
2232 if(prov_ldev != NULL && cons_ldev != NULL) {
2233 frame = cba_frame_connect(pinfo, cons_ldev, prov_ldev, u16QoSType, u16QoSValue, u8ConsMac, u16CRID, u16CRLength);
2235 cba_frame_info(tvb, pinfo, sub_tree, frame);
2240 /* add to current call */
2242 call->frame_count++;
2243 call->frames[u32Idx-1] = frame;
2246 /* update subtree header */
2247 proto_item_append_text(sub_item, "[%u]: CRID=0x%x, CRLength=%u",
2248 u32Idx, u16CRID, u16CRLength);
2249 proto_item_set_len(sub_item, offset - u32SubStart);
2255 /* update column info now */
2256 if (check_col(pinfo->cinfo, COL_INFO)) {
2257 col_append_fstr(pinfo->cinfo, COL_INFO, ": %sConsCRID=0x%x Len=%u QoS=%u",
2258 (u32Flags & 0x2) ? "Reco " : "", u16CRID, u16CRLength, u16QoSValue);
2266 dissect_ICBAAccoServerSRT_ConnectCR_resp(tvbuff_t *tvb, int offset,
2267 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2269 guint8 u8FirstConnect;
2270 guint8 u8ProvMac[6];
2271 guint32 u32ProvCRID = 0;
2273 guint32 u32ArraySize;
2276 proto_item *sub_item;
2277 proto_tree *sub_tree;
2278 guint32 u32SubStart;
2280 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2281 server_frame_call_t *call = info->call_data->private_data;
2285 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2288 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2289 "No request info, response data ignored");
2292 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2293 PROTO_ITEM_SET_GENERATED(item);
2294 pinfo->profinet_type = 3;
2296 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
2297 hf_cba_acco_server_first_connect, &u8FirstConnect);
2299 /* ProviderMAC (big-endian, 1byte-aligned) */
2300 tvb_memcpy(tvb, u8ProvMac, offset, 6);
2302 proto_tree_add_ether(tree, hf_cba_acco_serversrt_prov_mac, tvb,
2303 offset, 6, u8ProvMac);
2307 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2311 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2314 while (u32ArraySize--) {
2315 /* array of CONNECTOUTCRs */
2316 sub_item = proto_tree_add_item(tree, hf_cba_connectoutcr, tvb, offset, 0, FALSE);
2317 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectoutcr);
2318 u32SubStart = offset;
2320 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2321 hf_cba_acco_prov_crid, &u32ProvCRID);
2323 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2326 /* put response data into the frame */
2327 if(call && u32Idx <= call->frame_count) {
2328 frame = call->frames[u32Idx-1];
2329 frame->provcrid = u32ProvCRID;
2330 frame->conncrret = u32HResult;
2332 cba_frame_info(tvb, pinfo, sub_tree, frame);
2335 /* update subtree header */
2336 proto_item_append_text(sub_item, "[%u]: ProvCRID=0x%x, %s",
2337 u32Idx, u32ProvCRID,
2338 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2339 proto_item_set_len(sub_item, offset - u32SubStart);
2345 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2348 /* this might be a global HRESULT */
2349 while(call && u32Idx <= call->frame_count) {
2350 frame = call->frames[u32Idx-1];
2351 frame->provcrid = 0;
2352 frame->conncrret = u32HResult;
2356 if (check_col(pinfo->cinfo, COL_INFO)) {
2357 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s PCRID=0x%x -> %s",
2358 (u8FirstConnect) ? "FirstCR" : "NotFirstCR",
2360 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2368 dissect_ICBAAccoServerSRT_DisconnectCR_rqst(tvbuff_t *tvb, int offset,
2369 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2372 guint32 u32ArraySize;
2374 guint32 u32ProvCRID;
2376 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2377 cba_ldev_t *prov_ldev;
2379 server_frame_call_t *call;
2382 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2384 /* get corresponding provider ldev */
2385 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2387 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2388 PROTO_ITEM_SET_GENERATED(item);
2389 pinfo->profinet_type = 4;
2391 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2392 hf_cba_acco_count, &u32Count);
2394 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2397 /* link frame infos to the call */
2398 if(prov_ldev != NULL) {
2399 call = se_alloc(sizeof(server_frame_call_t) + u32ArraySize * sizeof(cba_frame_t *));
2400 call->frame_count = 0;
2401 call->frames = (cba_frame_t **) (call+1);
2402 info->call_data->private_data = call;
2408 while (u32ArraySize--) {
2409 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2410 hf_cba_acco_prov_crid, &u32ProvCRID, u32Idx);
2412 /* find frame and add it to current call */
2414 frame = cba_frame_find_by_provcrid(pinfo, prov_ldev, u32ProvCRID);
2415 call->frame_count++;
2416 call->frames[u32Idx-1] = frame;
2422 /* update column info now */
2423 if (check_col(pinfo->cinfo, COL_INFO)) {
2424 col_append_fstr(pinfo->cinfo, COL_INFO, ": PCRID=0x%x",
2433 dissect_ICBAAccoServerSRT_DisconnectCR_resp(tvbuff_t *tvb, int offset,
2434 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2438 guint32 u32ArraySize = 0;
2442 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2443 server_frame_call_t *call = info->call_data->private_data;
2447 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2449 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2450 PROTO_ITEM_SET_GENERATED(item);
2451 pinfo->profinet_type = 3;
2453 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2457 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2461 u32Tmp = u32ArraySize;
2463 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, tree, drep,
2464 &u32HResult, u32Idx);
2465 /* put response data into the frame */
2466 if(call && u32Idx <= call->frame_count) {
2467 frame = call->frames[u32Idx-1];
2469 cba_frame_disconnect(pinfo, frame);
2477 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2480 if (check_col(pinfo->cinfo, COL_INFO)) {
2481 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2482 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2490 dissect_ICBAAccoServerSRT_Connect_rqst(tvbuff_t *tvb, int offset,
2491 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2493 guint32 u32ProvCRID;
2495 guint8 u8LastConnect;
2497 guint32 u32ArraySize;
2498 guint32 u32VariableOffset;
2500 proto_item *sub_item;
2501 proto_tree *sub_tree;
2502 guint32 u32SubStart;
2504 gchar szProvItem[1000] = { 0 };
2505 guint32 u32MaxProvItemLen = sizeof(szProvItem);
2506 guint16 u16TypeDescLen;
2507 guint32 u32ArraySize2;
2509 guint16 u16VarType2 = -1;
2512 guint16 u16RecordLength;
2514 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2515 cba_ldev_t *prov_ldev;
2516 cba_frame_t *frame = NULL;
2517 cba_connection_t *conn;
2518 guint16 typedesclen = 0;
2519 guint16 *typedesc = NULL;
2520 server_connect_call_t *call;
2523 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2525 /* get corresponding provider ldev */
2526 prov_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
2528 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
2529 PROTO_ITEM_SET_GENERATED(item);
2530 pinfo->profinet_type = 4;
2532 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2533 hf_cba_acco_prov_crid, &u32ProvCRID);
2535 frame = cba_frame_find_by_provcrid(pinfo, prov_ldev, u32ProvCRID);
2538 cba_frame_info(tvb, pinfo, tree, frame);
2541 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
2542 hf_cba_acco_conn_state, &u8State);
2544 offset = dissect_dcom_BYTE(tvb, offset, pinfo, tree, drep,
2545 hf_cba_acco_serversrt_last_connect, &u8LastConnect);
2548 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2549 hf_cba_acco_count, &u32Count);
2551 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2554 /* link connections infos to the call */
2556 call = se_alloc(sizeof(server_connect_call_t) + u32ArraySize * sizeof(cba_connection_t *));
2557 call->conn_count = 0;
2558 call->frame = frame;
2559 call->conns = (cba_connection_t **) (call+1);
2560 info->call_data->private_data = call;
2565 u32VariableOffset = offset + u32ArraySize*20;
2568 while (u32ArraySize--) {
2569 /* array of CONNECTINs */
2570 sub_item = proto_tree_add_item(tree, hf_cba_connectin, tvb, offset, 0, FALSE);
2571 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectin);
2572 u32SubStart = offset;
2575 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2578 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2579 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
2583 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2584 hf_cba_type_desc_len, &u16TypeDescLen);
2586 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2590 u32VariableOffset = dissect_dcom_dcerpc_array_size(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2593 typedesc = se_alloc0(u32ArraySize2 * 2);
2594 typedesclen = u32ArraySize2;
2596 /* extended type description will build an array here */
2598 while (u32ArraySize2--) {
2599 /* ToBeDone: some of the type description values are counts */
2600 u32VariableOffset = dissect_dcom_VARTYPE(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2603 if(u32Idx2 <= typedesclen) {
2604 typedesc[u32Idx2-1] = u16VarType;
2607 /* remember first VarType only */
2609 u16VarType2 = u16VarType;
2616 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2617 hf_cba_acco_conn_cons_id, &u32ConsID);
2620 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2621 hf_cba_acco_serversrt_record_length, &u16RecordLength);
2623 /* add to object database */
2625 conn = cba_connection_connect(pinfo, frame->consparent, frame->provparent, frame,
2626 frame->qostype, frame->qosvalue, szProvItem, u32ConsID, u16RecordLength,
2627 typedesc, typedesclen);
2629 cba_connection_info(tvb, pinfo, sub_tree, conn);
2634 /* add to current call */
2637 call->conns[u32Idx-1] = conn;
2640 /* update subtree header */
2641 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x, ProvItem=\"%s\", TypeDesc=%s",
2642 u32Idx, u32ConsID, szProvItem,
2643 val_to_str(u16VarType2, dcom_variant_type_vals, "Unknown (0x%04x)") );
2644 proto_item_set_len(sub_item, offset - u32SubStart);
2650 /* update column info now */
2651 if (check_col(pinfo->cinfo, COL_INFO)) {
2652 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s Cnt=%u PCRID=0x%x",
2653 (u8LastConnect) ? "LastOfCR" : "",
2658 return u32VariableOffset;
2663 dissect_ICBAAccoServerSRT_Connect_resp(tvbuff_t *tvb, int offset,
2664 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2667 guint32 u32ArraySize;
2669 proto_item *sub_item;
2670 proto_tree *sub_tree;
2671 guint32 u32SubStart;
2675 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
2676 server_connect_call_t *call = info->call_data->private_data;
2677 cba_connection_t *conn;
2680 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2683 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
2684 "No request info, response data ignored");
2687 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
2688 PROTO_ITEM_SET_GENERATED(item);
2689 pinfo->profinet_type = 3;
2691 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2694 if(call && call->frame != NULL) {
2695 cba_frame_info(tvb, pinfo, tree, call->frame);
2699 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2702 /* array of CONNECTOUTs */
2703 while(u32ArraySize--) {
2704 sub_item = proto_tree_add_item(tree, hf_cba_connectout, tvb, offset, 8, FALSE);
2705 sub_tree = proto_item_add_subtree(sub_item, ett_cba_connectout);
2706 u32SubStart = offset;
2708 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2709 hf_cba_acco_conn_prov_id, &u32ProvID);
2711 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2712 &u32HResult, u32Idx);
2714 /* put response data into the frame */
2715 if(call && u32Idx <= call->conn_count) {
2716 conn = call->conns[u32Idx-1];
2717 conn->provid = u32ProvID;
2718 conn->connret = u32HResult;
2720 cba_connection_info(tvb, pinfo, sub_tree, conn);
2723 proto_item_append_text(sub_item, "[%u]: ProvID=0x%x %s",
2725 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2726 proto_item_set_len(sub_item, offset - u32SubStart);
2732 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2735 /* this might be a global HRESULT */
2736 while(call && u32Idx <= call->conn_count) {
2737 conn = call->conns[u32Idx-1];
2739 conn->connret = u32HResult;
2743 if (check_col(pinfo->cinfo, COL_INFO)) {
2744 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
2746 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2754 dissect_Server_GetProvIDs_resp(tvbuff_t *tvb, int offset,
2755 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2759 guint32 u32ArraySize;
2765 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2767 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2768 hf_cba_acco_count, &u32Count);
2770 if (check_col(pinfo->cinfo, COL_INFO)) {
2772 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ProvID=", u32Count);
2774 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2778 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2781 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2785 while (u32ArraySize--) {
2786 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo,
2788 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2790 if (check_col(pinfo->cinfo, COL_INFO)) {
2792 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ProvID);
2793 } else if (u32Idx < 10) {
2794 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ProvID);
2795 } else if (u32Idx == 10) {
2796 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
2804 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
2807 if (check_col(pinfo->cinfo, COL_INFO)) {
2808 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2809 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2817 dissect_Server_GetProvConnections_rqst(tvbuff_t *tvb, int offset,
2818 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2821 guint32 u32ArraySize;
2826 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
2828 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2829 hf_cba_acco_count, &u32Count);
2831 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
2835 while (u32ArraySize--) {
2836 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
2837 hf_cba_acco_conn_prov_id, &u32ProvID, u32Idx);
2841 /* update column info now */
2842 if (check_col(pinfo->cinfo, COL_INFO)) {
2843 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
2851 dissect_Server_GetProvConnections_resp(tvbuff_t *tvb, int offset,
2852 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2855 guint32 u32TmpCount;
2857 guint32 u32VariableOffset;
2859 proto_item *sub_item;
2860 proto_tree *sub_tree;
2861 guint32 u32SubStart;
2862 gchar szCons[1000] = { 0 };
2863 guint32 u32MaxConsLen = sizeof(szCons);
2864 gchar szProvItem[1000] = { 0 };
2865 guint32 u32MaxProvItemLen = sizeof(szProvItem);
2868 guint16 u16QoSValue;
2873 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
2875 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
2878 u32VariableOffset = offset;
2881 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
2882 hf_cba_acco_count, &u32Count);
2884 u32VariableOffset = offset + u32Count*28;
2886 /* array fixed part (including pointers to variable part) */
2887 u32TmpCount = u32Count;
2889 while (u32TmpCount--) {
2890 sub_item = proto_tree_add_item(tree, hf_cba_getprovconnout, tvb, offset, 0, FALSE);
2891 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getprovconnout);
2892 u32SubStart = offset;
2895 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2898 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2899 hf_cba_acco_conn_consumer, szCons, u32MaxConsLen);
2901 /* wszProviderItem */
2902 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2905 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2906 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
2909 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
2910 hf_cba_acco_conn_cons_id, &u32ConsID);
2913 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
2916 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
2917 hf_cba_acco_conn_epsilon);
2921 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2922 hf_cba_acco_conn_qos_type, &u16QoSType);
2924 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
2925 hf_cba_acco_conn_qos_value, &u16QoSValue);
2927 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
2928 hf_cba_acco_conn_state, &u8State);
2930 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
2931 &u32HResult, u32Idx);
2933 proto_item_append_text(sub_item, "[%u]: %s",
2935 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2936 proto_item_set_len(sub_item, offset - u32SubStart);
2942 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
2945 if (check_col(pinfo->cinfo, COL_INFO)) {
2946 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
2947 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
2950 return u32VariableOffset;
2954 #define CBA_MRSH_VERSION_DCOM 0x1
2955 #define CBA_MRSH_VERSION_SRT_WITH_CONSID 0x10
2956 #define CBA_MRSH_VERSION_SRT_WITHOUT_CONSID 0x11
2960 dissect_CBA_Connection_Data(tvbuff_t *tvb,
2961 packet_info *pinfo, proto_tree *tree, cba_ldev_t *cons_ldev, cba_frame_t *frame)
2965 guint16 u16CountFix;
2969 proto_item *sub_item;
2970 proto_tree *sub_tree;
2971 proto_item *conn_data_item = NULL;
2972 proto_tree *conn_data_tree = NULL;
2973 proto_item *item = NULL;
2981 gboolean qc_reported = FALSE;
2983 int qc_uncertain = 0;
2986 cba_connection_t *conn;
2990 /*** ALL data in this buffer is NOT aligned and always little endian ordered ***/
2993 conn_data_item = proto_tree_add_item(tree, hf_cba_acco_cb_conn_data, tvb, offset, 0, FALSE);
2994 conn_data_tree = proto_item_add_subtree(conn_data_item, ett_ICBAAccoCallback_Buffer);
2997 /* add buffer header */
2998 u8Version = tvb_get_guint8 (tvb, offset);
2999 if (conn_data_tree) {
3000 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_version, tvb, offset, 1, TRUE);
3004 u8Flags = tvb_get_guint8 (tvb, offset);
3005 if (conn_data_tree) {
3006 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_flags, tvb, offset, 1, TRUE);
3010 u16Count = tvb_get_letohs (tvb, offset);
3011 if (conn_data_tree) {
3012 proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_count, tvb, offset, 2, TRUE);
3015 u16CountFix = u16Count;
3017 /* show meta information */
3019 cba_frame_info(tvb, pinfo, conn_data_tree, frame);
3021 if(cons_ldev && cons_ldev->name) {
3022 item = proto_tree_add_string(conn_data_tree, hf_cba_acco_conn_consumer, tvb, offset, 0, cons_ldev->name);
3023 PROTO_ITEM_SET_GENERATED(item);
3027 /* update column info now */
3029 if (check_col(pinfo->cinfo, COL_INFO))
3030 col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u", u16Count);
3033 /* is this an OnDataChanged buffer format (version), we know? */
3034 if (u8Version != CBA_MRSH_VERSION_DCOM &&
3035 u8Version != CBA_MRSH_VERSION_SRT_WITH_CONSID &&
3036 u8Version != CBA_MRSH_VERSION_SRT_WITHOUT_CONSID)
3041 /* Timestamps are currently unused -> flags must be zero */
3048 while (u16Count--) {
3049 /* find next record header */
3050 u16Len = tvb_get_letohs (tvb, offset);
3052 /* trapped inside an empty hole? -> try to find next record header */
3054 (u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID ||
3055 u8Version == CBA_MRSH_VERSION_SRT_WITHOUT_CONSID))
3058 offset_hole = offset;
3059 /* length smaller or larger than possible -> must be a hole */
3060 while (u16Len == 0) {
3062 u16Len = tvb_get_letohs(tvb, offset);
3063 /* this is a bit tricky here! we know: */
3064 /* u16Len must be greater than 3 (min. size of header itself) */
3065 /* u16Len must be a lot smaller than 0x300 (max. size of frame) */
3066 /* -> if we found a length larger than 0x300, */
3067 /* this must be actually the high byte, so do one more step */
3068 if (u16Len > 0x300) {
3072 proto_tree_add_none_format(conn_data_tree, hf_cba_acco_cb_item_hole, tvb,
3073 offset_hole, offset - offset_hole,
3074 "Hole(--): -------------, offset=%2u, length=%2u",
3075 offset_hole, offset - offset_hole);
3078 /* add callback-item subtree */
3079 sub_item = proto_tree_add_item(conn_data_tree, hf_cba_acco_cb_item, tvb, offset, 0, FALSE);
3080 sub_tree = proto_item_add_subtree(sub_item, ett_ICBAAccoCallback_Item);
3082 item_offset = offset;
3084 /* add item header fields */
3086 proto_tree_add_item(sub_tree, hf_cba_acco_cb_item_length, tvb, offset, 2, TRUE);
3091 if (u8Version == CBA_MRSH_VERSION_DCOM ||
3092 u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID)
3094 u32ID = tvb_get_letohl (tvb, offset);
3096 proto_tree_add_item(sub_tree, hf_cba_acco_conn_cons_id, tvb, offset, 4, TRUE);
3104 u8QC = tvb_get_guint8 (tvb, offset);
3106 item = proto_tree_add_item(sub_tree, hf_cba_acco_qc, tvb, offset, 1, TRUE);
3111 if( u8QC != 0x80 && /* GoodNonCascOk */
3112 u8QC != 0x1C && /* BadOutOfService (usually permanent, so don't report for every frame) */
3114 expert_add_info_format(pinfo, item, PI_RESPONSE_CODE, PI_CHAT, "%s QC: %s",
3115 u8Version == CBA_MRSH_VERSION_DCOM ? "DCOM" : "SRT",
3116 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"));
3131 /* user data length is item length without headers */
3132 u16DataLen = u16Len - u16HdrLen;
3134 /* append text to subtree header */
3135 if (u8Version == CBA_MRSH_VERSION_DCOM ||
3136 u8Version == CBA_MRSH_VERSION_SRT_WITH_CONSID)
3138 proto_item_append_text(sub_item,
3139 "[%2u]: ConsID=0x%08x, offset=%2u, length=%2u (user-length=%2u), QC=%s (0x%02x)",
3140 u32ItemIdx, u32ID, offset - u16HdrLen, u16Len, u16DataLen,
3141 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"), u8QC );
3143 proto_item_append_text(sub_item,
3144 "[%2u]: ConsID=-, offset=%2u, length=%2u (user-length=%2u), QC=%s (0x%02x)",
3145 u32ItemIdx, offset - u16HdrLen, u16Len, u16DataLen,
3146 val_to_str(u8QC, cba_acco_qc_vals, "Unknown (0x%02x)"), u8QC );
3148 proto_item_set_len(sub_item, u16Len);
3150 /* hexdump of user data */
3151 proto_tree_add_bytes(sub_tree, hf_cba_acco_cb_item_data, tvb, offset, u16DataLen,
3152 tvb_get_ptr(tvb, offset, u16DataLen));
3153 offset += u16DataLen;
3155 if(frame != NULL ) {
3156 /* find offset in SRT */
3157 /* XXX - expensive! */
3158 cba_frame_incoming_data(tvb, pinfo, sub_tree, frame);
3159 for(conns = frame->conns; conns != NULL; conns = g_list_next(conns)) {
3161 if(conn->frame_offset == item_offset) {
3162 cba_connection_info(tvb, pinfo, sub_tree, conn);
3167 /* find consID in ldev */
3168 /* XXX - expensive! */
3169 if(cons_ldev != NULL) {
3170 for(conns = cons_ldev->consconns; conns != NULL; conns = g_list_next(conns)) {
3172 if(conn->consid == u32ID) {
3173 cba_connection_info(tvb, pinfo, sub_tree, conn);
3174 cba_connection_incoming_data(tvb, pinfo, sub_tree, conn);
3184 if (u8Version == 1) {
3185 proto_item_append_text(conn_data_item,
3186 ": Version=0x%x (DCOM), Flags=0x%x, Count=%u",
3187 u8Version, u8Flags, u16CountFix);
3189 proto_item_append_text(conn_data_item,
3190 ": Version=0x%x (SRT), Flags=0x%x, Count=%u, Items=%u, Holes=%u",
3191 u8Version, u8Flags, u16CountFix, u32ItemIdx-1, u32HoleIdx-1);
3193 proto_item_set_len(conn_data_item, offset);
3195 if (check_col(pinfo->cinfo, COL_INFO))
3196 col_append_fstr(pinfo->cinfo, COL_INFO, ", QC (G:%u,U:%u,B:%u)",
3197 qc_good, qc_uncertain, qc_bad);
3204 dissect_CBA_Connection_Data_heur(tvbuff_t *tvb,
3205 packet_info *pinfo, proto_tree *tree)
3212 /* the tvb will NOT contain the frame_id here! */
3213 u16FrameID = GPOINTER_TO_UINT(pinfo->private_data);
3215 /* frame id must be in valid range (cyclic Real-Time, class=1 or class=2) */
3216 if (u16FrameID < 0x8000 || u16FrameID >= 0xfb00) {
3220 u8Version = tvb_get_guint8 (tvb, 0);
3221 u8Flags = tvb_get_guint8 (tvb, 1);
3223 /* version and flags must be ok */
3224 if(u8Version != 0x11 || u8Flags != 0x00) {
3228 if (check_col(pinfo->cinfo, COL_PROTOCOL))
3229 col_add_str(pinfo->cinfo, COL_PROTOCOL, "PN-CBA");
3231 frame = cba_frame_find_by_cons(pinfo, pinfo->dl_dst.data, u16FrameID);
3233 dissect_CBA_Connection_Data(tvb, pinfo, tree, frame ? frame->consparent : NULL, frame);
3240 dissect_ICBAAccoCallback_OnDataChanged_rqst(tvbuff_t *tvb, int offset,
3241 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3244 guint32 u32ArraySize;
3247 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3248 cba_ldev_t *cons_ldev;
3251 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3253 /* get corresponding provider ldev */
3254 cons_ldev = cba_ldev_find(pinfo, pinfo->net_dst.data, &info->call_data->object_uuid);
3256 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
3257 PROTO_ITEM_SET_GENERATED(item);
3258 pinfo->profinet_type = 1;
3261 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3262 hf_cba_acco_cb_length, &u32Length);
3265 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3268 /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
3269 /* dissect PROFINET component data (without header) */
3270 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
3272 offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, cons_ldev, NULL /* frame */);
3275 /* tvb_free(next_tvb);*/
3282 dissect_ICBAAccoCallback_OnDataChanged_resp(tvbuff_t *tvb, int offset,
3283 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3289 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3291 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
3292 PROTO_ITEM_SET_GENERATED(item);
3293 pinfo->profinet_type = 2;
3295 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3298 if (check_col(pinfo->cinfo, COL_INFO)) {
3299 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3300 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3308 dissect_ICBAAccoCallback_Gnip_rqst(tvbuff_t *tvb, int offset,
3309 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3314 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3316 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, FALSE);
3317 PROTO_ITEM_SET_GENERATED(item);
3318 pinfo->profinet_type = 3;
3325 dissect_ICBAAccoCallback_Gnip_resp(tvbuff_t *tvb, int offset,
3326 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3332 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3334 item = proto_tree_add_boolean (tree, hf_cba_acco_srt_call, tvb, offset, 0, TRUE);
3335 PROTO_ITEM_SET_GENERATED(item);
3336 pinfo->profinet_type = 4;
3338 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3341 if (check_col(pinfo->cinfo, COL_INFO)) {
3342 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3343 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3351 dissect_ICBAAccoServer2_GetConnectionData_rqst(tvbuff_t *tvb, int offset,
3352 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3355 guint32 u32MaxStr = sizeof(szStr);
3357 cba_ldev_t *cons_ldev;
3358 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3362 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3364 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, TRUE);
3365 PROTO_ITEM_SET_GENERATED(item);
3366 pinfo->profinet_type = 2;
3368 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
3369 hf_cba_acco_conn_consumer, szStr, u32MaxStr);
3371 cons_ldev = cba_acco_add(pinfo, szStr);
3373 /* link ldev to the call */
3374 if(cons_ldev != NULL) {
3375 call = se_alloc(sizeof(cba_ldev_t *));
3377 info->call_data->private_data = call;
3380 /* update column info now */
3381 if (check_col(pinfo->cinfo, COL_INFO)) {
3382 col_append_fstr(pinfo->cinfo, COL_INFO, " Consumer=\"%s\"", szStr);
3390 dissect_ICBAAccoServer2_GetConnectionData_resp(tvbuff_t *tvb, int offset,
3391 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3394 guint32 u32ArraySize;
3399 dcerpc_info *info = (dcerpc_info *)pinfo->private_data;
3400 cba_ldev_t **call = info->call_data->private_data;
3401 cba_ldev_t *cons_ldev = (call!=NULL) ? *call : NULL;
3404 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3406 if(cons_ldev == NULL) {
3407 expert_add_info_format(pinfo, NULL, PI_UNDECODED, PI_NOTE,
3408 "No request info, response data ignored");
3411 item = proto_tree_add_boolean (tree, hf_cba_acco_dcom_call, tvb, offset, 0, FALSE);
3412 PROTO_ITEM_SET_GENERATED(item);
3413 pinfo->profinet_type = 1;
3416 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3417 hf_cba_acco_cb_length, &u32Length);
3419 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3423 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3426 /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
3427 /* dissect PROFINET component data (without header) */
3428 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
3430 offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, (call != NULL) ? *call : NULL, NULL /* frame */);
3433 /* tvb_free(next_tvb);*/
3436 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3439 /* update column info now */
3440 if (check_col(pinfo->cinfo, COL_INFO)) {
3441 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3442 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3450 dissect_ICBAAccoMgt_AddConnections_rqst(tvbuff_t *tvb, int offset,
3451 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3453 gchar szConsumer[1000] = { 0 };
3454 guint32 u32MaxConsLen = sizeof(szConsumer);
3456 guint16 u16QoSValue;
3459 guint32 u32ArraySize;
3461 guint16 u16Persistence;
3462 gchar szConsItem[1000] = { 0 };
3463 guint32 u32MaxConsItemLen = sizeof(szConsItem);
3464 gchar szProvItem[1000] = { 0 };
3465 guint32 u32MaxProvItemLen = sizeof(szProvItem);
3466 guint32 u32VariableOffset;
3467 proto_item *sub_item;
3468 proto_tree *sub_tree;
3469 guint32 u32SubStart;
3473 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3475 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
3476 hf_cba_acco_conn_provider, szConsumer, u32MaxConsLen);
3477 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
3478 hf_cba_acco_conn_qos_type, &u16QoSType);
3479 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
3480 hf_cba_acco_conn_qos_value, &u16QoSValue);
3481 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
3482 hf_cba_acco_conn_state, &u8State);
3484 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3485 hf_cba_acco_count, &u32Count);
3487 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3490 u32VariableOffset = offset + u32ArraySize * 20;
3493 while (u32ArraySize--) {
3494 sub_item = proto_tree_add_item(tree, hf_cba_addconnectionin, tvb, offset, 0, FALSE);
3495 sub_tree = proto_item_add_subtree(sub_item, ett_cba_addconnectionin);
3496 u32SubStart = offset;
3498 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3501 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3502 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
3504 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3507 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3508 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
3510 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3511 hf_cba_acco_conn_persist, &u16Persistence);
3513 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3516 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3517 hf_cba_acco_conn_substitute);
3519 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3522 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3523 hf_cba_acco_conn_epsilon);
3525 proto_item_append_text(sub_item, "[%u]: ConsItem=\"%s\" ProvItem=\"%s\" %s Pers=%u",
3526 u32Idx, szConsItem, szProvItem,
3527 val_to_str(u16Persistence, cba_persist_vals, "Unknown (0x%02x)"), u16Persistence);
3528 proto_item_set_len(sub_item, offset - u32SubStart);
3533 /* update column info now */
3534 if (check_col(pinfo->cinfo, COL_INFO)) {
3535 col_append_fstr(pinfo->cinfo, COL_INFO, ": Prov=\"%s\" State=%s Cnt=%u",
3537 val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"),
3541 return u32VariableOffset;
3546 dissect_ICBAAccoMgt_AddConnections_resp(tvbuff_t *tvb, int offset,
3547 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3550 guint32 u32ArraySize = 0;
3552 guint16 u16ConnVersion;
3553 guint32 u32HResult = 0;
3554 guint32 u32Count = 0;
3556 proto_item *sub_item;
3557 proto_tree *sub_tree;
3558 guint32 u32SubStart;
3561 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3563 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3567 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3570 u32Count = u32ArraySize;
3572 while (u32ArraySize--) {
3573 sub_item = proto_tree_add_item(tree, hf_cba_addconnectionout, tvb, offset, 0, FALSE);
3574 sub_tree = proto_item_add_subtree(sub_item, ett_cba_addconnectionout);
3575 u32SubStart = offset;
3577 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3578 hf_cba_acco_conn_cons_id, &u32ConsID);
3580 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3581 hf_cba_acco_conn_version, &u16ConnVersion);
3583 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3584 &u32HResult, u32Idx);
3586 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x Version=%u %s",
3587 u32Idx, u32ConsID, u16ConnVersion,
3588 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3589 proto_item_set_len(sub_item, offset - u32SubStart);
3594 /* update column info now */
3595 if (check_col(pinfo->cinfo, COL_INFO)) {
3596 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3600 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3603 /* update column info now */
3604 if (check_col(pinfo->cinfo, COL_INFO)) {
3605 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3606 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3614 dissect_ICBAAccoMgt_RemoveConnections_rqst(tvbuff_t *tvb, int offset,
3615 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3618 guint32 u32ArraySize;
3623 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3625 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3626 hf_cba_acco_count, &u32Count);
3628 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3632 while (u32ArraySize--) {
3633 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3634 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3638 /* update column info now */
3639 if (check_col(pinfo->cinfo, COL_INFO)) {
3640 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3648 dissect_ICBAAccoMgt_SetActivationState_rqst(tvbuff_t *tvb, int offset,
3649 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3653 guint32 u32ArraySize;
3658 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
3660 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, tree, drep,
3661 hf_cba_acco_conn_state, &u8State);
3663 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3664 hf_cba_acco_count, &u32Count);
3666 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3670 while (u32ArraySize--) {
3671 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
3672 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3676 /* update column info now */
3677 if (check_col(pinfo->cinfo, COL_INFO)) {
3678 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3686 dissect_ICBAAccoMgt_GetInfo_resp(tvbuff_t *tvb, int offset,
3687 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3694 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3696 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3697 hf_cba_acco_info_max, &u32Max);
3699 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3700 hf_cba_acco_info_curr, &u32CurCnt);
3702 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3705 if (check_col(pinfo->cinfo, COL_INFO))
3706 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u/%u -> %s",
3708 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3715 dissect_ICBAAccoMgt_GetIDs_resp(tvbuff_t *tvb, int offset,
3716 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3720 guint32 u32ArraySize;
3726 proto_item *sub_item;
3727 proto_tree *sub_tree;
3728 guint32 u32SubStart;
3731 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3733 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3734 hf_cba_acco_count, &u32Count);
3736 if (check_col(pinfo->cinfo, COL_INFO)) {
3738 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count);
3740 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3744 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3747 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3751 while (u32ArraySize--) {
3752 sub_item = proto_tree_add_item(tree, hf_cba_getidout, tvb, offset, 0, FALSE);
3753 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getidout);
3754 u32SubStart = offset;
3756 offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
3757 hf_cba_acco_conn_cons_id, &u32ConsID);
3758 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3759 hf_cba_acco_conn_state, &u8State);
3760 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3761 hf_cba_acco_conn_version, &u16Version);
3762 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3763 &u32HResult, u32Idx);
3765 proto_item_append_text(sub_item, "[%u]: ConsID=0x%x State=%s Version=%u %s",
3767 val_to_str(u8State, cba_acco_conn_state_vals, "Unknown (0x%02x)"),
3769 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3770 proto_item_set_len(sub_item, offset - u32SubStart);
3772 if (check_col(pinfo->cinfo, COL_INFO)) {
3774 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID);
3775 } else if (u32Idx < 10) {
3776 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID);
3777 } else if (u32Idx == 10) {
3778 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
3786 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3789 if (check_col(pinfo->cinfo, COL_INFO)) {
3790 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3791 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3799 dissect_ICBAAccoMgt2_GetConsIDs_resp(tvbuff_t *tvb, int offset,
3800 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3804 guint32 u32ArraySize;
3810 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3812 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3813 hf_cba_acco_count, &u32Count);
3815 if (check_col(pinfo->cinfo, COL_INFO)) {
3817 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u ConsID=", u32Count);
3819 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
3823 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3826 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
3830 while (u32ArraySize--) {
3831 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo,
3833 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
3835 if (check_col(pinfo->cinfo, COL_INFO)) {
3837 col_append_fstr(pinfo->cinfo, COL_INFO, "0x%x", u32ConsID);
3838 } else if (u32Idx < 10) {
3839 col_append_fstr(pinfo->cinfo, COL_INFO, ",0x%x", u32ConsID);
3840 } else if (u32Idx == 10) {
3841 col_append_fstr(pinfo->cinfo, COL_INFO, ",...");
3849 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
3852 if (check_col(pinfo->cinfo, COL_INFO)) {
3853 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3854 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3862 dissect_ICBAAccoMgt2_GetConsConnections_resp(tvbuff_t *tvb, int offset,
3863 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3866 guint32 u32TmpCount;
3871 guint16 u16QoSValue;
3873 guint16 u16Persistence;
3874 proto_item *sub_item;
3875 proto_tree *sub_tree;
3876 guint32 u32SubStart;
3878 guint32 u32VariableOffset;
3879 gchar szProv[1000] = { 0 };
3880 guint32 u32MaxProvLen = sizeof(szProv);
3881 gchar szProvItem[1000] = { 0 };
3882 guint32 u32MaxProvItemLen = sizeof(szProvItem);
3883 gchar szConsItem[1000] = { 0 };
3884 guint32 u32MaxConsItemLen = sizeof(szConsItem);
3887 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3889 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3892 u32VariableOffset = offset;
3895 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
3896 hf_cba_acco_count, &u32Count);
3898 u32VariableOffset = offset + u32Count*32;
3900 /* array fixed part (including pointers to variable part) */
3901 u32TmpCount = u32Count;
3903 while (u32TmpCount--) {
3904 sub_item = proto_tree_add_item(tree, hf_cba_getconsconnout, tvb, offset, 0, FALSE);
3905 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
3906 u32SubStart = offset;
3908 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3911 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3912 hf_cba_acco_conn_provider, szProv, u32MaxProvLen);
3914 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3917 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3918 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
3920 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3923 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3924 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
3926 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3929 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3930 hf_cba_acco_conn_substitute);
3932 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
3935 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
3936 hf_cba_acco_conn_epsilon);
3939 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3940 hf_cba_acco_conn_qos_type, &u16QoSType);
3941 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3942 hf_cba_acco_conn_qos_value, &u16QoSValue);
3943 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
3944 hf_cba_acco_conn_state, &u8State);
3945 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
3946 hf_cba_acco_conn_persist, &u16Persistence);
3947 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
3948 &u32HResult, u32Idx);
3950 proto_item_append_text(sub_item, "[%u]: %s",
3952 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3953 proto_item_set_len(sub_item, offset - u32SubStart);
3959 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
3962 if (check_col(pinfo->cinfo, COL_INFO)) {
3963 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
3964 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
3967 return u32VariableOffset;
3972 dissect_ICBAAccoMgt2_DiagConsConnections_resp(tvbuff_t *tvb, int offset,
3973 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3976 guint32 u32TmpCount;
3980 guint16 u16Persistence;
3981 guint16 u16ConnVersion;
3982 proto_item *sub_item;
3983 proto_tree *sub_tree;
3984 proto_item *state_item;
3985 guint32 u32SubStart;
3987 guint32 u32VariableOffset;
3988 guint32 u32ConnErrorState;
3991 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
3993 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
3996 u32VariableOffset = offset;
3999 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4000 hf_cba_acco_count, &u32Count);
4002 u32VariableOffset = offset + u32Count*16;
4004 /* array fixed part (including pointers to variable part) */
4005 u32TmpCount = u32Count;
4007 while (u32TmpCount--) {
4008 sub_item = proto_tree_add_item(tree, hf_cba_diagconsconnout, tvb, offset, 0, FALSE);
4009 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
4010 u32SubStart = offset;
4012 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
4013 hf_cba_acco_conn_state, &u8State);
4014 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4015 hf_cba_acco_conn_persist, &u16Persistence);
4016 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4017 hf_cba_acco_conn_version, &u16ConnVersion);
4018 /* connection state */
4019 /* offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
4020 hf_cba_acco_conn_error_state, &u32ConnErrorState);*/
4021 offset = dissect_dcom_HRESULT_item(tvb, offset, pinfo, sub_tree, drep,
4022 &u32ConnErrorState, hf_cba_acco_conn_error_state, &state_item);
4023 proto_item_set_text(state_item, "ConnErrorState: %s (0x%x)",
4024 val_to_str(u32ConnErrorState, dcom_hresult_vals, "Unknown (0x%08x)"),
4027 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4028 &u32HResult, u32Idx);
4030 proto_item_append_text(sub_item, "[%u]: %s",
4032 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4033 proto_item_set_len(sub_item, offset - u32SubStart);
4039 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4042 if (check_col(pinfo->cinfo, COL_INFO)) {
4043 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
4044 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4047 return u32VariableOffset;
4052 dissect_ICBAAccoMgt_GetConnections_rqst(tvbuff_t *tvb, int offset,
4053 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4057 guint32 u32ArraySize;
4061 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4063 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4064 hf_cba_acco_count, &u32Count);
4066 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4070 while (u32ArraySize--){
4071 offset = dissect_dcom_indexed_DWORD(tvb, offset, pinfo, tree, drep,
4072 hf_cba_acco_conn_cons_id, &u32ConsID, u32Idx);
4081 dissect_ICBAAccoMgt_GetConnections_resp(tvbuff_t *tvb, int offset,
4082 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4085 guint32 u32TmpCount;
4090 guint16 u16QoSValue;
4092 guint16 u16Persistence;
4093 guint16 u16ConnVersion;
4094 proto_item *sub_item;
4095 proto_tree *sub_tree;
4096 guint32 u32SubStart;
4098 guint32 u32VariableOffset;
4099 gchar szProv[1000] = { 0 };
4100 guint32 u32MaxProvLen = sizeof(szProv);
4101 gchar szProvItem[1000] = { 0 };
4102 guint32 u32MaxProvItemLen = sizeof(szProvItem);
4103 gchar szConsItem[1000] = { 0 };
4104 guint32 u32MaxConsItemLen = sizeof(szConsItem);
4107 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4109 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4112 u32VariableOffset = offset;
4115 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4116 hf_cba_acco_count, &u32Count);
4118 u32VariableOffset = offset + u32Count*36;
4120 /* array fixed part (including pointers to variable part) */
4121 u32TmpCount = u32Count;
4123 while (u32TmpCount--) {
4124 sub_item = proto_tree_add_item(tree, hf_cba_getconnectionout, tvb, offset, 0, FALSE);
4125 sub_tree = proto_item_add_subtree(sub_item, ett_cba_getconnectionout);
4126 u32SubStart = offset;
4128 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4131 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4132 hf_cba_acco_conn_provider, szProv, u32MaxProvLen);
4134 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4137 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4138 hf_cba_acco_conn_provider_item, szProvItem, u32MaxProvItemLen);
4140 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4143 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4144 hf_cba_acco_conn_consumer_item, szConsItem, u32MaxConsItemLen);
4146 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4149 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4150 hf_cba_acco_conn_substitute);
4152 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4155 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4156 hf_cba_acco_conn_epsilon);
4159 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4160 hf_cba_acco_conn_qos_type, &u16QoSType);
4161 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4162 hf_cba_acco_conn_qos_value, &u16QoSValue);
4163 offset = dissect_dcom_BOOLEAN(tvb, offset, pinfo, sub_tree, drep,
4164 hf_cba_acco_conn_state, &u8State);
4165 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4166 hf_cba_acco_conn_persist, &u16Persistence);
4167 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4168 hf_cba_acco_conn_version, &u16ConnVersion);
4169 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4170 &u32HResult, u32Idx);
4172 proto_item_append_text(sub_item, "[%u]: %s",
4174 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4175 proto_item_set_len(sub_item, offset - u32SubStart);
4181 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4184 if (check_col(pinfo->cinfo, COL_INFO)) {
4185 col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s",
4186 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4189 return u32VariableOffset;
4194 dissect_ICBAAccoMgt_ReviseQoS_rqst(tvbuff_t *tvb, int offset,
4195 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4198 guint16 u16QoSValue;
4200 guint32 u32MaxStr = sizeof(szStr);
4203 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4205 offset = dissect_dcom_LPWSTR(tvb, offset, pinfo, tree, drep,
4206 hf_cba_acco_rtauto, szStr, u32MaxStr);
4208 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4209 hf_cba_acco_conn_qos_type, &u16QoSType);
4211 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4212 hf_cba_acco_conn_qos_value, &u16QoSValue);
4214 if (check_col(pinfo->cinfo, COL_INFO)) {
4215 col_append_fstr(pinfo->cinfo, COL_INFO, ": RTAuto=\"%s\" QoSType=%s QoSValue=%u",
4217 val_to_str(u16QoSType, cba_qos_type_vals, "Unknown (0x%04x)"),
4226 dissect_ICBAAccoMgt_ReviseQoS_resp(tvbuff_t *tvb, int offset,
4227 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4229 guint16 u16QoSValue;
4233 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4235 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4236 hf_cba_acco_conn_qos_value, &u16QoSValue);
4238 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4241 if (check_col(pinfo->cinfo, COL_INFO))
4242 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s",
4244 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4251 dissect_ICBAAccoMgt_get_PingFactor_resp(tvbuff_t *tvb, int offset,
4252 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4258 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4260 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4261 hf_cba_acco_ping_factor, &u16PF);
4263 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4266 if (check_col(pinfo->cinfo, COL_INFO))
4267 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u -> %s",
4269 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4276 dissect_ICBAAccoMgt_put_PingFactor_rqst(tvbuff_t *tvb, int offset,
4277 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4282 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4284 offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
4285 hf_cba_acco_ping_factor, &u16PF);
4287 if (check_col(pinfo->cinfo, COL_INFO))
4288 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u", u16PF);
4296 dissect_ICBAAccoMgt_get_CDBCookie_resp(tvbuff_t *tvb, int offset,
4297 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4303 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4305 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4306 hf_cba_acco_cdb_cookie, &u32Cookie);
4308 offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep,
4311 if (check_col(pinfo->cinfo, COL_INFO)) {
4312 col_append_fstr(pinfo->cinfo, COL_INFO, ": CDBCookie=0x%x -> %s",
4314 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4322 dissect_ICBAAccoMgt_GetDiagnosis_rqst(tvbuff_t *tvb, int offset,
4323 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4326 guint32 u32InLength;
4327 guint32 u32ArraySize;
4330 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4332 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4333 hf_cba_acco_diag_req, &u32Request);
4335 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4336 hf_cba_acco_diag_in_length, &u32InLength);
4338 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4341 if(u32ArraySize != 0) {
4342 proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32InLength, FALSE);
4345 if (check_col(pinfo->cinfo, COL_INFO)) {
4346 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s: %u bytes",
4347 val_to_str(u32Request, cba_acco_diag_req_vals, "Unknown request (0x%08x)"),
4356 dissect_ICBAAccoMgt_GetDiagnosis_resp(tvbuff_t *tvb, int offset,
4357 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4359 guint32 u32OutLength;
4362 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4364 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4365 hf_cba_acco_diag_out_length, &u32OutLength);
4367 if(u32OutLength != 0) {
4368 proto_tree_add_item(tree, hf_cba_acco_diag_data, tvb, offset, u32OutLength, FALSE);
4371 if (check_col(pinfo->cinfo, COL_INFO)) {
4372 col_append_fstr(pinfo->cinfo, COL_INFO, ": %u bytes",
4381 dissect_ICBAAccoSync_ReadItems_rqst(tvbuff_t *tvb, int offset,
4382 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4386 guint32 u32MaxStr = sizeof(szStr);
4388 guint32 u32ArraySize;
4389 guint32 u32VariableOffset;
4393 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4395 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4396 hf_cba_acco_count, &u32Count);
4398 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4401 u32VariableOffset = offset + u32ArraySize*4;
4404 while (u32ArraySize--) {
4405 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4408 u32VariableOffset = dissect_dcom_indexed_LPWSTR(tvb, u32VariableOffset, pinfo, tree, drep,
4409 hf_cba_acco_item, szStr, u32MaxStr, u32Idx);
4415 if (check_col(pinfo->cinfo, COL_INFO)) {
4416 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4419 return u32VariableOffset;
4426 dissect_ICBAAccoSync_ReadItems_resp(tvbuff_t *tvb, int offset,
4427 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4431 guint32 u32ArraySize;
4434 proto_item *sub_item;
4435 proto_tree *sub_tree;
4436 guint32 u32SubStart;
4437 guint32 u32VariableOffset;
4441 offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
4443 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
4445 u32VariableOffset = offset;
4448 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4451 u32VariableOffset = offset + u32ArraySize * 20;
4453 u32Tmp = u32ArraySize;
4455 sub_item = proto_tree_add_item(tree, hf_cba_readitemout, tvb, offset, 0, FALSE);
4456 sub_tree = proto_item_add_subtree(sub_item, ett_cba_readitemout);
4457 u32SubStart = offset;
4459 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4462 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep, hf_cba_acco_data);
4465 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4466 hf_cba_acco_qc, &u16QC);
4467 offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
4468 hf_cba_acco_time_stamp, NULL);
4470 offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
4471 &u32HResult, u32Idx);
4473 proto_item_append_text(sub_item, "[%u]: QC=%s (0x%02x) %s",
4475 val_to_str(u16QC, cba_acco_qc_vals, "Unknown"),
4477 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4478 proto_item_set_len(sub_item, offset - u32SubStart);
4484 u32VariableOffset = dissect_dcom_HRESULT(tvb, u32VariableOffset, pinfo, tree, drep,
4487 if (check_col(pinfo->cinfo, COL_INFO)) {
4488 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u -> %s",
4490 val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") );
4493 return u32VariableOffset;
4498 dissect_ICBAAccoSync_WriteItems_rqst(tvbuff_t *tvb, int offset,
4499 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4502 guint32 u32ArraySize;
4504 guint32 u32MaxStr = sizeof(szStr);
4506 guint32 u32VariableOffset;
4507 proto_item *sub_item;
4508 proto_tree *sub_tree;
4509 guint32 u32SubStart;
4513 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4515 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4516 hf_cba_acco_count, &u32Count);
4518 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4521 u32VariableOffset = offset + u32ArraySize * 8;
4523 while(u32ArraySize--) {
4524 sub_item = proto_tree_add_item(tree, hf_cba_writeitemin, tvb, offset, 0, FALSE);
4525 sub_tree = proto_item_add_subtree(sub_item, ett_cba_writeitemin);
4526 u32SubStart = offset;
4528 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4531 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4532 hf_cba_acco_item, szStr, u32MaxStr);
4534 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4537 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4541 proto_item_append_text(sub_item, "[%u]: Item=\"%s\"", u32Idx, szStr);
4542 proto_item_set_len(sub_item, offset - u32SubStart);
4547 if (check_col(pinfo->cinfo, COL_INFO)) {
4548 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4551 return u32VariableOffset;
4557 dissect_ICBAAccoSync_WriteItemsQCD_rqst(tvbuff_t *tvb, int offset,
4558 packet_info *pinfo, proto_tree *tree, guint8 *drep)
4561 guint32 u32ArraySize;
4563 guint32 u32MaxStr = sizeof(szStr);
4565 guint32 u32VariableOffset;
4566 proto_item *sub_item;
4567 proto_tree *sub_tree;
4568 guint32 u32SubStart;
4572 offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
4574 offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep,
4575 hf_cba_acco_count, &u32Count);
4577 offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep,
4580 u32VariableOffset = offset + u32ArraySize * 20;
4582 while(u32ArraySize--) {
4583 sub_item = proto_tree_add_item(tree, hf_cba_writeitemin, tvb, offset, 0, FALSE);
4584 sub_tree = proto_item_add_subtree(sub_item, ett_cba_writeitemin);
4585 u32SubStart = offset;
4587 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4590 u32VariableOffset = dissect_dcom_LPWSTR(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4591 hf_cba_acco_item, szStr, u32MaxStr);
4594 offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep,
4597 u32VariableOffset = dissect_dcom_VARIANT(tvb, u32VariableOffset, pinfo, sub_tree, drep,
4601 offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
4602 hf_cba_acco_qc, &u16QC);
4604 offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
4605 hf_cba_acco_time_stamp, NULL);
4607 proto_item_append_text(sub_item, "[%u]: Item=\"%s\" QC=%s (0x%02x)",
4609 val_to_str(u16QC, cba_acco_qc_vals, "Unknown"), u16QC);
4611 proto_item_set_len(sub_item, offset - u32SubStart);
4615 if (check_col(pinfo->cinfo, COL_INFO)) {
4616 col_append_fstr(pinfo->cinfo, COL_INFO, ": Cnt=%u", u32Count);
4619 return u32VariableOffset;
4627 /* sub dissector table of ICBAAccoMgt / ICBAAccoMgt2 interface */
4628 static dcerpc_sub_dissector ICBAAccoMgt_dissectors[] = {
4629 { 0, "QueryInterface", NULL, NULL},
4630 { 1, "AddRef", NULL, NULL },
4631 { 2, "Release", NULL, NULL },
4633 { 3, "AddConnections", dissect_ICBAAccoMgt_AddConnections_rqst, dissect_ICBAAccoMgt_AddConnections_resp },
4634 { 4, "RemoveConnections", dissect_ICBAAccoMgt_RemoveConnections_rqst, dissect_HResultArray_resp },
4635 { 5, "ClearConnections", dissect_dcom_simple_rqst, dissect_dcom_simple_resp },
4636 { 6, "SetActivationState", dissect_ICBAAccoMgt_SetActivationState_rqst, dissect_HResultArray_resp },
4637 { 7, "GetInfo", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_GetInfo_resp },
4638 { 8, "GetIDs", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_GetIDs_resp },
4639 { 9, "GetConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt_GetConnections_resp },
4640 {10, "ReviseQoS", dissect_ICBAAccoMgt_ReviseQoS_rqst, dissect_ICBAAccoMgt_ReviseQoS_resp },
4641 {11, "get_PingFactor", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_get_PingFactor_resp },
4642 {12, "put_PingFactor", dissect_ICBAAccoMgt_put_PingFactor_rqst, dissect_dcom_simple_resp },
4643 {13, "get_CDBCookie", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt_get_CDBCookie_resp },
4645 {14, "GetConsIDs", dissect_dcom_simple_rqst, dissect_ICBAAccoMgt2_GetConsIDs_resp },
4646 {15, "GetConsConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt2_GetConsConnections_resp },
4647 {16, "DiagConsConnections", dissect_ICBAAccoMgt_GetConnections_rqst, dissect_ICBAAccoMgt2_DiagConsConnections_resp },
4648 {17, "GetProvIDs", dissect_dcom_simple_rqst, dissect_Server_GetProvIDs_resp },
4649 {18, "GetProvConnections", dissect_Server_GetProvConnections_rqst, dissect_Server_GetProvConnections_resp },
4650 {19, "GetDiagnosis", dissect_ICBAAccoMgt_GetDiagnosis_rqst, dissect_ICBAAccoMgt_GetDiagnosis_resp },
4651 { 0, NULL, NULL, NULL },
4655 /* sub dissector table of ICBAAccoCallback interface */
4656 static dcerpc_sub_dissector ICBAAccoCallback_dissectors[] = {
4657 { 0, "QueryInterface", NULL, NULL },
4658 { 1, "AddRef", NULL, NULL },
4659 { 2, "Release", NULL, NULL },
4661 { 3, "OnDataChanged", dissect_ICBAAccoCallback_OnDataChanged_rqst, dissect_ICBAAccoCallback_OnDataChanged_resp },
4663 { 4, "Gnip", dissect_ICBAAccoCallback_Gnip_rqst, dissect_ICBAAccoCallback_Gnip_resp },
4664 { 0, NULL, NULL, NULL },
4668 /* sub dissector table of ICBAAccoServer interface */
4669 static dcerpc_sub_dissector ICBAAccoServer_dissectors[] = {
4670 { 0, "QueryInterface", NULL, NULL },
4671 { 1, "AddRef", NULL, NULL },
4672 { 2, "Release", NULL, NULL },
4674 { 3, "Connect", dissect_ICBAAccoServer_Connect_rqst, dissect_ICBAAccoServer_Connect_resp },
4675 { 4, "Disconnect", dissect_ICBAAccoServer_Disconnect_rqst, dissect_ICBAAccoServer_Disconnect_resp },
4676 { 5, "DisconnectMe", dissect_ICBAAccoServer_DisconnectMe_rqst, dissect_ICBAAccoServer_DisconnectMe_resp },
4677 { 6, "SetActivation", dissect_ICBAAccoServer_SetActivation_rqst, dissect_ICBAAccoServer_SetActivation_resp },
4678 { 7, "Ping", dissect_ICBAAccoServer_Ping_rqst, dissect_ICBAAccoServer_Ping_resp },
4680 { 8, "Connect2", dissect_ICBAAccoServer2_Connect2_rqst, dissect_ICBAAccoServer_Connect_resp },
4681 { 9, "GetConnectionData", dissect_ICBAAccoServer2_GetConnectionData_rqst, dissect_ICBAAccoServer2_GetConnectionData_resp },
4682 { 0, NULL, NULL, NULL },
4686 /* sub dissector table of ICBAAccoServerSRT interface (stage 2 only) */
4687 static dcerpc_sub_dissector ICBAAccoServerSRT_dissectors[] = {
4688 { 0, "QueryInterface", NULL, NULL },
4689 { 1, "AddRef", NULL, NULL },
4690 { 2, "Release", NULL, NULL },
4692 { 3, "ConnectCR", dissect_ICBAAccoServerSRT_ConnectCR_rqst, dissect_ICBAAccoServerSRT_ConnectCR_resp },
4693 { 4, "DisconnectCR", dissect_ICBAAccoServerSRT_DisconnectCR_rqst, dissect_ICBAAccoServerSRT_DisconnectCR_resp },
4694 { 5, "Connect", dissect_ICBAAccoServerSRT_Connect_rqst, dissect_ICBAAccoServerSRT_Connect_resp },
4695 { 6, "Disconnect", dissect_ICBAAccoServerSRT_Disconnect_rqst, dissect_ICBAAccoServerSRT_Disconnect_resp },
4696 { 7, "DisconnectMe", dissect_ICBAAccoServerSRT_DisconnectMe_rqst, dissect_ICBAAccoServerSRT_DisconnectMe_resp },
4697 { 8, "SetActivation", dissect_ICBAAccoServerSRT_SetActivation_rqst, dissect_ICBAAccoServerSRT_SetActivation_resp },
4698 { 0, NULL, NULL, NULL },
4702 /* sub dissector table of ICBAAccoSync interface */
4703 static dcerpc_sub_dissector ICBAAccoSync_dissectors[] = {
4704 { 0, "QueryInterface", NULL, NULL },
4705 { 1, "AddRef", NULL, NULL },
4706 { 2, "Release", NULL, NULL },
4708 { 3, "ReadItems", dissect_ICBAAccoSync_ReadItems_rqst, dissect_ICBAAccoSync_ReadItems_resp },
4709 { 4, "WriteItems", dissect_ICBAAccoSync_WriteItems_rqst, dissect_HResultArray_resp },
4710 { 5, "WriteItemsQCD", dissect_ICBAAccoSync_WriteItemsQCD_rqst, dissect_HResultArray_resp },
4711 { 0, NULL, NULL, NULL },
4715 /* register protocol */
4717 proto_register_dcom_cba_acco (void)
4719 static gint *ett3[3];
4720 static gint *ett4[4];
4721 static gint *ett5[5];
4724 static hf_register_info hf_cba_acco_array[] = {
4725 { &hf_cba_acco_opnum,
4726 { "Operation", "cba.acco.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, "Operation", HFILL }},
4727 { &hf_cba_acco_ping_factor,
4728 { "PingFactor", "cba.acco.ping_factor", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4729 { &hf_cba_acco_count,
4730 { "Count", "cba.acco.count", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
4731 { &hf_cba_acco_info_max,
4732 { "Max", "cba.acco.info_max", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
4733 { &hf_cba_acco_info_curr,
4734 { "Current", "cba.acco.info_curr", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
4735 { &hf_cba_acco_rtauto,
4736 { "RTAuto", "cba.acco.rtauto", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
4737 { &hf_cba_acco_item,
4738 { "Item", "cba.acco.item", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
4739 { &hf_cba_acco_data,
4740 { "Data", "cba.acco.data", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4742 { "QualityCode", "cba.acco.qc", FT_UINT8, BASE_HEX, VALS(cba_acco_qc_vals), 0x0, "", HFILL }},
4743 { &hf_cba_acco_time_stamp,
4744 { "TimeStamp", "cba.acco.time_stamp", FT_UINT64, BASE_DEC, NULL, 0x0, "", HFILL }},
4745 { &hf_cba_readitemout,
4746 { "ReadItemOut", "cba.acco.readitemout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4747 { &hf_cba_writeitemin,
4748 { "WriteItemIn", "cba.acco.writeitemin", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4749 { &hf_cba_acco_cdb_cookie,
4750 { "CDBCookie", "cba.acco.cdb_cookie", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},
4751 /* dcom_hresult_vals from packet-dcom.h doesn't work here, as length is unknown! */
4752 { &hf_cba_acco_conn_error_state,
4753 { "ConnErrorState", "cba.acco.conn_error_state", FT_UINT32, BASE_HEX, NULL /*VALS(dcom_hresult_vals)*/, 0x0, "", HFILL }},
4754 { &hf_cba_acco_diag_req,
4755 { "Request", "cba.acco.diag_req", FT_UINT32, BASE_HEX, VALS(cba_acco_diag_req_vals), 0x0, "", HFILL }},
4756 { &hf_cba_acco_diag_in_length,
4757 { "InLength", "cba.acco.diag_in_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
4758 { &hf_cba_acco_diag_out_length,
4759 { "OutLength", "cba.acco.diag_out_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
4760 { &hf_cba_acco_diag_data,
4761 { "Data", "cba.acco.diag_data", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }},
4762 { &hf_cba_acco_dcom_call,
4763 { "DcomRuntime", "cba.acco.dcom", FT_BOOLEAN, BASE_NONE, TFS(&cba_acco_call_flags), 0x0, "This is a DCOM runtime context", HFILL }},
4764 { &hf_cba_acco_srt_call,
4765 { "SrtRuntime", "cba.acco.srt", FT_BOOLEAN, BASE_NONE, TFS(&cba_acco_call_flags), 0x0, "This is an SRT runtime context", HFILL }}
4769 static hf_register_info hf_cba_acco_server[] = {
4770 { &hf_cba_acco_server_pICBAAccoCallback,
4771 { "pICBAAccoCallback", "cba.acco.server_pICBAAccoCallback", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }},
4772 { &hf_cba_acco_server_first_connect,
4773 { "FirstConnect", "cba.acco.server_first_connect", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
4774 { &hf_cba_getprovconnout,
4775 { "GETPROVCONNOUT", "cba.acco.getprovconnout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4776 { &hf_cba_acco_serversrt_prov_mac,
4777 { "ProviderMAC", "cba.acco.serversrt_prov_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL }},
4778 { &hf_cba_acco_serversrt_cons_mac,
4779 { "ConsumerMAC", "cba.acco.serversrt_cons_mac", FT_ETHER, BASE_NONE, NULL, 0x0, "", HFILL }},
4780 { &hf_cba_acco_serversrt_cr_id,
4781 { "ConsumerCRID", "cba.acco.serversrt_cr_id", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }},
4782 { &hf_cba_acco_serversrt_cr_length,
4783 { "CRLength", "cba.acco.serversrt_cr_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4784 { &hf_cba_acco_serversrt_cr_flags,
4785 { "Flags", "cba.acco.serversrt_cr_flags", FT_UINT32, BASE_HEX, 0, 0x0, "", HFILL }},
4786 { &hf_cba_acco_serversrt_cr_flags_timestamped,
4787 { "Timestamped", "cba.acco.serversrt_cr_flags_timestamped", FT_BOOLEAN, 32, TFS (&acco_flags_set_truth), 0x1, "", HFILL }},
4788 { &hf_cba_acco_serversrt_cr_flags_reconfigure,
4789 { "Reconfigure", "cba.acco.serversrt_cr_flags_reconfigure", FT_BOOLEAN, 32, TFS (&acco_flags_set_truth), 0x2, "", HFILL }},
4790 { &hf_cba_type_desc_len,
4791 { "TypeDescLen", "cba.acco.type_desc_len", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4792 { &hf_cba_acco_serversrt_record_length,
4793 { "RecordLength", "cba.acco.serversrt_record_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4794 { &hf_cba_acco_serversrt_action,
4795 { "Action", "cba.acco.serversrt_action", FT_UINT32, BASE_DEC, VALS(cba_acco_serversrt_action_vals), 0x0, "", HFILL }},
4796 { &hf_cba_acco_serversrt_last_connect,
4797 { "LastConnect", "cba.acco.serversrt_last_connect", FT_UINT8, BASE_DEC, VALS(cba_acco_serversrt_last_connect_vals), 0x0, "", HFILL }},
4800 static hf_register_info hf_cba_connectcr_array[] = {
4801 { &hf_cba_acco_prov_crid,
4802 { "ProviderCRID", "cba.acco.prov_crid", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},
4805 static hf_register_info hf_cba_connect_array[] = {
4806 { &hf_cba_addconnectionin,
4807 { "ADDCONNECTIONIN", "cba.acco.addconnectionin", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4808 { &hf_cba_addconnectionout,
4809 { "ADDCONNECTIONOUT", "cba.acco.addconnectionout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4811 { "GETIDOUT", "cba.acco.getidout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4812 { &hf_cba_getconnectionout,
4813 { "GETCONNECTIONOUT", "cba.acco.getconnectionout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4814 { &hf_cba_getconsconnout,
4815 { "GETCONSCONNOUT", "cba.acco.getconsconnout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4816 { &hf_cba_diagconsconnout,
4817 { "DIAGCONSCONNOUT", "cba.acco.diagconsconnout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4818 { &hf_cba_connectincr,
4819 { "CONNECTINCR", "cba.acco.connectincr", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4820 { &hf_cba_connectoutcr,
4821 { "CONNECTOUTCR", "cba.acco.connectoutcr", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4822 { &hf_cba_connectin,
4823 { "CONNECTIN", "cba.acco.connectin", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4824 { &hf_cba_connectout,
4825 { "CONNECTOUT", "cba.acco.connectout", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},
4826 { &hf_cba_acco_conn_prov_id,
4827 { "ProviderID", "cba.acco.conn_prov_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},
4828 { &hf_cba_acco_conn_cons_id,
4829 { "ConsumerID", "cba.acco.conn_cons_id", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }},
4830 { &hf_cba_acco_conn_version,
4831 { "ConnVersion", "cba.acco.conn_version", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }},
4832 { &hf_cba_acco_conn_consumer,
4833 { "Consumer", "cba.acco.conn_consumer", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
4834 { &hf_cba_acco_conn_qos_type,
4835 { "QoSType", "cba.acco.conn_qos_type", FT_UINT16, BASE_HEX, VALS(cba_qos_type_vals), 0x0, "", HFILL }},
4836 { &hf_cba_acco_conn_qos_value,
4837 { "QoSValue", "cba.acco.conn_qos_value", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4838 { &hf_cba_acco_conn_state,
4839 { "State", "cba.acco.conn_state", FT_UINT8, BASE_HEX, VALS(cba_acco_conn_state_vals), 0x0, "", HFILL }},
4840 { &hf_cba_acco_conn_provider,
4841 { "Provider", "cba.acco.conn_provider", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
4842 { &hf_cba_acco_conn_provider_item,
4843 { "ProviderItem", "cba.acco.conn_provider_item", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
4844 { &hf_cba_acco_conn_consumer_item,
4845 { "ConsumerItem", "cba.acco.conn_consumer_item", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }},
4846 { &hf_cba_acco_conn_persist,
4847 { "Persistence", "cba.acco.conn_persist", FT_UINT16, BASE_HEX, VALS(cba_persist_vals), 0x0, "", HFILL }},
4848 { &hf_cba_acco_conn_epsilon,
4849 { "Epsilon", "cba.acco.conn_epsilon", FT_NONE, BASE_DEC, NULL, 0x0, "", HFILL }},
4850 { &hf_cba_acco_conn_substitute,
4851 { "Substitute", "cba.acco.conn_substitute", FT_NONE, BASE_DEC, NULL, 0x0, "", HFILL }},
4854 static hf_register_info hf_cba_acco_cb[] = {
4855 { &hf_cba_acco_cb_length,
4856 { "Length", "cba.acco.cb_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
4857 { &hf_cba_acco_cb_version,
4858 { "Version", "cba.acco.cb_version", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
4859 { &hf_cba_acco_cb_flags,
4860 { "Flags", "cba.acco.cb_flags", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }},
4861 { &hf_cba_acco_cb_count,
4862 { "Count", "cba.acco.cb_count", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4863 { &hf_cba_acco_cb_conn_data,
4864 { "CBA Connection data", "cba.acco.cb_conn_data", FT_NONE, BASE_DEC, NULL, 0x0, "", HFILL }},
4865 { &hf_cba_acco_cb_item,
4866 { "Item", "cba.acco.cb_item", FT_NONE, BASE_DEC, NULL, 0x0, "", HFILL }},
4867 { &hf_cba_acco_cb_item_hole,
4868 { "Hole", "cba.acco.cb_item_hole", FT_NONE, BASE_DEC, NULL, 0x0, "", HFILL }},
4869 { &hf_cba_acco_cb_item_length,
4870 { "Length", "cba.acco.cb_item_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }},
4871 { &hf_cba_acco_cb_item_data,
4872 { "Data(Hex)", "cba.acco.cb_item_data", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }},
4873 { &hf_cba_connect_in,
4874 { "Connect in frame", "cba.connect_in", FT_FRAMENUM, BASE_NONE,
4875 NULL, 0, "This connection Connect was in the packet with this number", HFILL }},
4876 { &hf_cba_disconnect_in,
4877 { "Disconnect in frame", "cba.disconnect_in", FT_FRAMENUM, BASE_NONE,
4878 NULL, 0, "This connection Disconnect was in the packet with this number", HFILL }},
4879 { &hf_cba_connectcr_in,
4880 { "ConnectCR in frame", "cba.connect_in", FT_FRAMENUM, BASE_NONE,
4881 NULL, 0, "This frame ConnectCR was in the packet with this number", HFILL }},
4882 { &hf_cba_disconnectcr_in,
4883 { "DisconnectCR in frame", "cba.disconnect_in", FT_FRAMENUM, BASE_NONE,
4884 NULL, 0, "This frame DisconnectCR was in the packet with this number", HFILL }},
4885 { &hf_cba_disconnectme_in,
4886 { "DisconnectMe in frame", "cba.disconnectme_in", FT_FRAMENUM, BASE_NONE,
4887 NULL, 0, "This connection/frame DisconnectMe was in the packet with this number", HFILL }},
4888 { &hf_cba_data_first_in,
4889 { "First data in frame", "cba.data_first_in", FT_FRAMENUM, BASE_NONE,
4890 NULL, 0, "The first data of this connection/frame in the packet with this number", HFILL }},
4891 { &hf_cba_data_last_in,
4892 { "Last data in frame", "cba.data_last_in", FT_FRAMENUM, BASE_NONE,
4893 NULL, 0, "The last data of this connection/frame in the packet with this number", HFILL }},
4896 ett5[0] = &ett_ICBAAccoMgt;
4897 ett5[1] = &ett_cba_addconnectionin;
4898 ett5[2] = &ett_cba_addconnectionout;
4899 ett5[3] = &ett_cba_getidout;
4900 ett5[4] = &ett_cba_getconnectionout;
4901 proto_ICBAAccoMgt = proto_register_protocol ("ICBAAccoMgt", "ICBAAccoMgt", "cba_acco_mgt");
4902 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_acco_array, array_length(hf_cba_acco_array));
4903 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_connect_array, array_length(hf_cba_connect_array));
4904 proto_register_field_array(proto_ICBAAccoMgt, hf_cba_connectcr_array, array_length(hf_cba_connectcr_array));
4905 proto_register_subtree_array (ett5, array_length (ett5));
4907 proto_ICBAAccoMgt2 = proto_register_protocol ("ICBAAccoMgt2", "ICBAAccoMgt2", "cba_acco_mgt2");
4909 ett3[0] = &ett_ICBAAccoCallback;
4910 ett3[1] = &ett_ICBAAccoCallback_Item;
4911 ett3[2] = &ett_ICBAAccoCallback_Buffer;
4912 proto_ICBAAccoCallback = proto_register_protocol ("ICBAAccoCallback", "ICBAAccoCB", "cba_acco_cb");
4913 proto_register_field_array(proto_ICBAAccoCallback, hf_cba_acco_cb, array_length(hf_cba_acco_cb));
4914 proto_register_subtree_array (ett3, array_length (ett3));
4916 proto_ICBAAccoCallback2 = proto_register_protocol ("ICBAAccoCallback2", "ICBAAccoCB2", "cba_acco_cb2");
4918 ett4[0] = &ett_ICBAAccoServer;
4919 ett4[1] = &ett_cba_connectin;
4920 ett4[2] = &ett_cba_connectout;
4921 ett4[3] = &ett_cba_getprovconnout;
4922 proto_ICBAAccoServer = proto_register_protocol ("ICBAAccoServer", "ICBAAccoServ", "cba_acco_server");
4923 proto_register_field_array(proto_ICBAAccoServer, hf_cba_acco_server, array_length(hf_cba_acco_server));
4924 proto_register_subtree_array (ett4, array_length (ett4));
4926 proto_ICBAAccoServer2 = proto_register_protocol ("ICBAAccoServer2", "ICBAAccoServ2", "cba_acco_server2");
4928 ett4[0] = &ett_ICBAAccoServerSRT;
4929 ett4[1] = &ett_cba_acco_serversrt_cr_flags;
4930 ett4[2] = &ett_cba_connectincr;
4931 ett4[3] = &ett_cba_connectoutcr;
4932 proto_ICBAAccoServerSRT = proto_register_protocol ("ICBAAccoServerSRT", "ICBAAccoServSRT", "cba_acco_server_srt");
4933 proto_register_subtree_array (ett4, array_length (ett4));
4935 ett5[0] = &ett_ICBAAccoSync;
4936 ett5[1] = &ett_cba_readitemout;
4937 ett5[2] = &ett_cba_writeitemin;
4938 ett5[3] = &ett_cba_frame_info;
4939 ett5[4] = &ett_cba_conn_info;
4940 proto_ICBAAccoSync = proto_register_protocol ("ICBAAccoSync", "ICBAAccoSync", "cba_acco_sync");
4941 proto_register_subtree_array (ett5, array_length (ett5));
4945 /* handoff protocol */
4947 proto_reg_handoff_dcom_cba_acco (void)
4949 /* Register the interfaces */
4950 dcerpc_init_uuid(proto_ICBAAccoMgt, ett_ICBAAccoMgt,
4951 &uuid_ICBAAccoMgt, ver_ICBAAccoMgt, ICBAAccoMgt_dissectors, hf_cba_acco_opnum);
4953 dcerpc_init_uuid(proto_ICBAAccoMgt2, ett_ICBAAccoMgt,
4954 &uuid_ICBAAccoMgt2, ver_ICBAAccoMgt2, ICBAAccoMgt_dissectors, hf_cba_acco_opnum);
4956 dcerpc_init_uuid(proto_ICBAAccoCallback, ett_ICBAAccoCallback,
4957 &uuid_ICBAAccoCallback, ver_ICBAAccoCallback, ICBAAccoCallback_dissectors, hf_cba_acco_opnum);
4959 dcerpc_init_uuid(proto_ICBAAccoCallback2, ett_ICBAAccoCallback,
4960 &uuid_ICBAAccoCallback2, ver_ICBAAccoCallback2, ICBAAccoCallback_dissectors, hf_cba_acco_opnum);
4962 dcerpc_init_uuid(proto_ICBAAccoServer, ett_ICBAAccoServer,
4963 &uuid_ICBAAccoServer, ver_ICBAAccoServer, ICBAAccoServer_dissectors, hf_cba_acco_opnum);
4965 dcerpc_init_uuid(proto_ICBAAccoServer2, ett_ICBAAccoServer,
4966 &uuid_ICBAAccoServer2, ver_ICBAAccoServer2, ICBAAccoServer_dissectors, hf_cba_acco_opnum);
4968 dcerpc_init_uuid(proto_ICBAAccoServerSRT, ett_ICBAAccoServerSRT,
4969 &uuid_ICBAAccoServerSRT, ver_ICBAAccoServerSRT, ICBAAccoServerSRT_dissectors, hf_cba_acco_opnum);
4971 dcerpc_init_uuid(proto_ICBAAccoSync, ett_ICBAAccoSync,
4972 &uuid_ICBAAccoSync, ver_ICBAAccoSync, ICBAAccoSync_dissectors, hf_cba_acco_opnum);
4975 heur_dissector_add("pn_rt", dissect_CBA_Connection_Data_heur, proto_ICBAAccoServer);