2012-06-01 15:57:05 +00:00
|
|
|
/* packet-coseventcomm.c
|
|
|
|
*
|
|
|
|
* Routines for IDL dissection
|
|
|
|
*
|
|
|
|
* Autogenerated from idl2wrs
|
|
|
|
* Copyright 2001 Frank Singleton <frank.singleton@ericsson.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Wireshark - Network traffic analyzer
|
2020-04-28 18:39:32 +00:00
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
2012-06-01 15:57:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2012-06-01 15:57:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/proto.h>
|
|
|
|
#include <epan/dissectors/packet-giop.h>
|
2012-08-08 03:29:51 +00:00
|
|
|
#include <epan/expert.h>
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2019-05-17 01:16:48 +00:00
|
|
|
#include "ws_diag_control.h"
|
|
|
|
#include "ws_compiler_tests.h"
|
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
/* disable warning: "unreference local variable" */
|
|
|
|
#pragma warning(disable:4101)
|
|
|
|
#endif
|
|
|
|
|
2019-05-17 01:16:48 +00:00
|
|
|
/* XXX this should be autogenerated, or the warnings fixed in the generator */
|
|
|
|
DIAG_OFF(unused-function)
|
|
|
|
DIAG_OFF(unused-variable)
|
|
|
|
#if WS_IS_AT_LEAST_GNUC_VERSION(6,0)
|
|
|
|
DIAG_OFF(unused-const-variable)
|
2013-12-03 05:22:47 +00:00
|
|
|
#endif
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2013-12-04 09:53:51 +00:00
|
|
|
void proto_register_giop_coseventcomm(void);
|
|
|
|
void proto_reg_handoff_giop_coseventcomm(void);
|
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
/* Initialise the protocol and subtree pointers */
|
|
|
|
static int proto_coseventcomm = -1;
|
|
|
|
static gint ett_coseventcomm = -1;
|
|
|
|
|
|
|
|
|
|
|
|
/* Initialise the initial Alignment */
|
|
|
|
static guint32 boundary = GIOP_HEADER_SIZE; /* initial value */
|
|
|
|
|
2012-11-05 03:36:07 +00:00
|
|
|
static int hf_operationrequest = -1;/* Request_Operation field */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2012-11-05 03:36:07 +00:00
|
|
|
/* Operation filters */
|
|
|
|
static int hf_CosEventComm_PullSupplier_try_pull_has_event = -1;
|
|
|
|
/* User exception filters */
|
2013-05-24 18:09:57 +00:00
|
|
|
/* Expert info filters */
|
|
|
|
static expert_field ei_coseventcomm_unknown_giop_msg = EI_INIT;
|
|
|
|
static expert_field ei_coseventcomm_unknown_exception = EI_INIT;
|
|
|
|
static expert_field ei_coseventcomm_unknown_reply_status = EI_INIT;
|
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2012-11-05 03:36:07 +00:00
|
|
|
static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset);
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Begin Exception Helper Functions */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* End Exception Helper Functions */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Main delegator for exception handling
|
|
|
|
*
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static gboolean
|
2012-12-26 10:28:03 +00:00
|
|
|
decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *ptree _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
proto_tree *tree _U_;
|
|
|
|
|
|
|
|
if (!header->exception_id)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
return FALSE; /* user exception not found */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PushConsumer/push:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PushConsumer_push(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
2012-11-05 03:36:07 +00:00
|
|
|
get_CDR_any(tvb, pinfo, tree, item, offset, stream_is_big_endian, boundary, header);
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
|
|
|
/* Function returns void */
|
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PushConsumer/disconnect_push_consumer:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PushConsumer_disconnect_push_consumer(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
|
|
|
/* Function returns void */
|
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PushSupplier/disconnect_push_supplier:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PushSupplier_disconnect_push_supplier(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
|
|
|
/* Function returns void */
|
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PullSupplier/pull:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PullSupplier_pull(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
2012-11-05 03:36:07 +00:00
|
|
|
get_CDR_any(tvb, pinfo, tree, item, offset, stream_is_big_endian, boundary, header);
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PullSupplier/try_pull:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PullSupplier_try_pull(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
2012-11-05 03:36:07 +00:00
|
|
|
get_CDR_any(tvb, pinfo, tree, item, offset, stream_is_big_endian, boundary, header);
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2012-10-11 14:42:33 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_CosEventComm_PullSupplier_try_pull_has_event, tvb, *offset-1, 1, get_CDR_boolean(tvb,offset));
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PullSupplier/disconnect_pull_supplier:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PullSupplier_disconnect_pull_supplier(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
|
|
|
/* Function returns void */
|
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* IDL:omg.org/CosEventComm/PullConsumer/disconnect_pull_consumer:1.0
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static void
|
2019-05-17 01:16:48 +00:00
|
|
|
decode_CosEventComm_PullConsumer_disconnect_pull_consumer(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, int *offset _U_, MessageHeader *header, const gchar *operation _U_, gboolean stream_is_big_endian _U_)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
switch(header->message_type) {
|
|
|
|
case Request:
|
|
|
|
break;
|
|
|
|
case Reply:
|
|
|
|
switch(header->rep_status) {
|
|
|
|
case NO_EXCEPTION:
|
|
|
|
/* Function returns void */
|
|
|
|
|
|
|
|
break;
|
|
|
|
case USER_EXCEPTION:
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown Exception */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_exception, "Unknown exception %d", header->rep_status);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
2012-11-05 03:36:07 +00:00
|
|
|
} /* switch(header->rep_status) */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Unknown GIOP Message */
|
2013-09-08 23:47:06 +00:00
|
|
|
expert_add_info_format(pinfo, item, &ei_coseventcomm_unknown_giop_msg, "Unknown GIOP message %d", header->message_type);
|
2012-06-01 15:57:05 +00:00
|
|
|
break;
|
|
|
|
} /* switch(header->message_type) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called once we accept the packet as being for us; it sets the
|
|
|
|
* Protocol and Info columns and creates the top-level protocol
|
|
|
|
* tree item.
|
|
|
|
*/
|
2012-07-08 03:29:49 +00:00
|
|
|
static proto_tree *
|
|
|
|
start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset)
|
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
proto_tree *tree = NULL; /* init later, inside if(tree) */
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "COSEVENTCOMM");
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do not clear COL_INFO, as nothing is being written there by
|
|
|
|
* this dissector yet. So leave it as is from the GIOP dissector.
|
|
|
|
* TODO: add something useful to COL_INFO
|
|
|
|
* col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (ptree) {
|
2015-04-21 18:12:59 +00:00
|
|
|
ti = proto_tree_add_item(ptree, proto_coseventcomm, tvb, *offset, tvb_reported_length_remaining(tvb, *offset), ENC_NA);
|
2012-06-01 15:57:05 +00:00
|
|
|
tree = proto_item_add_subtree(ti, ett_coseventcomm);
|
|
|
|
}
|
|
|
|
return tree;
|
|
|
|
}
|
|
|
|
|
2012-10-11 14:42:33 +00:00
|
|
|
static proto_item*
|
2012-12-26 10:28:03 +00:00
|
|
|
process_RequestOperation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, MessageHeader *header, const gchar *operation)
|
2012-09-05 12:45:54 +00:00
|
|
|
{
|
|
|
|
proto_item *pi;
|
|
|
|
if(header->message_type == Reply) {
|
|
|
|
/* fill-up info column */
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " op = %s",operation);
|
2012-11-05 03:36:07 +00:00
|
|
|
}
|
2012-09-05 12:45:54 +00:00
|
|
|
/* fill-up the field */
|
2012-10-11 14:42:33 +00:00
|
|
|
pi=proto_tree_add_string(ptree, hf_operationrequest, tvb, 0, 0, operation);
|
2019-04-03 21:32:30 +00:00
|
|
|
proto_item_set_generated(pi);
|
2012-10-11 14:42:33 +00:00
|
|
|
return pi;
|
2012-09-05 12:45:54 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
static gboolean
|
2012-12-26 10:28:03 +00:00
|
|
|
dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, const gchar *operation, gchar *idlname)
|
2012-07-08 03:29:49 +00:00
|
|
|
{
|
2019-05-17 01:16:48 +00:00
|
|
|
proto_item *item _U_;
|
|
|
|
proto_tree *tree _U_;
|
2012-11-05 03:36:07 +00:00
|
|
|
gboolean stream_is_big_endian = is_big_endian(header); /* get endianess */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
|
|
|
/* If we have a USER Exception, then decode it and return */
|
|
|
|
if ((header->message_type == Reply) && (header->rep_status == USER_EXCEPTION)) {
|
|
|
|
return decode_user_exception(tvb, pinfo, ptree, offset, header, operation, stream_is_big_endian);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(header->message_type) {
|
|
|
|
|
|
|
|
case Request:
|
|
|
|
case Reply:
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "push") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PushConsumer") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PushConsumer_push(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "disconnect_push_consumer") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PushConsumer") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PushConsumer_disconnect_push_consumer(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "disconnect_push_supplier") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PushSupplier") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PushSupplier_disconnect_push_supplier(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "pull") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PullSupplier") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PullSupplier_pull(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "try_pull") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PullSupplier") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PullSupplier_try_pull(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "disconnect_pull_supplier") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PullSupplier") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PullSupplier_disconnect_pull_supplier(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2012-07-08 03:29:49 +00:00
|
|
|
if (strcmp(operation, "disconnect_pull_consumer") == 0
|
2012-06-01 15:57:05 +00:00
|
|
|
&& (!idlname || strcmp(idlname, "CosEventComm/PullConsumer") == 0)) {
|
2013-12-03 13:38:56 +00:00
|
|
|
item = process_RequestOperation(tvb, pinfo, ptree, header, operation); /* fill-up Request_Operation field & info column */
|
|
|
|
tree = start_dissecting(tvb, pinfo, ptree, offset);
|
|
|
|
decode_CosEventComm_PullConsumer_disconnect_pull_consumer(tvb, pinfo, tree, item, offset, header, operation, stream_is_big_endian);
|
|
|
|
return TRUE;
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CancelRequest:
|
|
|
|
case LocateRequest:
|
|
|
|
case LocateReply:
|
|
|
|
case CloseConnection:
|
|
|
|
case MessageError:
|
|
|
|
case Fragment:
|
|
|
|
return FALSE; /* not handled yet */
|
|
|
|
|
|
|
|
default:
|
|
|
|
return FALSE; /* not handled yet */
|
|
|
|
|
|
|
|
} /* switch */
|
|
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
} /* End of main dissector */
|
|
|
|
|
|
|
|
|
|
|
|
/* Register the protocol with Wireshark */
|
2012-11-05 03:36:07 +00:00
|
|
|
void proto_register_giop_coseventcomm(void)
|
|
|
|
{
|
2013-12-03 13:38:56 +00:00
|
|
|
/* setup list of header fields */
|
|
|
|
static hf_register_info hf[] = {
|
2012-06-01 15:57:05 +00:00
|
|
|
/* field that indicates the currently ongoing request/reply exchange */
|
2013-12-03 13:38:56 +00:00
|
|
|
{&hf_operationrequest, {"Request_Operation","giop-coseventcomm.Request_Operation",FT_STRING,BASE_NONE,NULL,0x0,NULL,HFILL}},
|
2012-10-11 14:42:33 +00:00
|
|
|
/* Operation filters */
|
|
|
|
{&hf_CosEventComm_PullSupplier_try_pull_has_event, {"has_event","giop-coseventcomm.PullSupplier.try_pull.has_event",FT_BOOLEAN,8,NULL,0x01,NULL,HFILL}},
|
|
|
|
/* Attribute filters */
|
|
|
|
/* Struct filters */
|
|
|
|
/* User exception filters */
|
|
|
|
/* Union filters */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
};
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_coseventcomm_unknown_giop_msg, { "giop-coseventcomm.unknown_giop_msg", PI_PROTOCOL, PI_WARN, "Unknown GIOP message", EXPFILL }},
|
|
|
|
{ &ei_coseventcomm_unknown_exception, { "giop-coseventcomm.unknown_exception", PI_PROTOCOL, PI_WARN, "Unknown exception", EXPFILL }},
|
|
|
|
{ &ei_coseventcomm_unknown_reply_status, { "giop-coseventcomm.unknown_reply_status", PI_PROTOCOL, PI_WARN, "Unknown reply status", EXPFILL }},
|
|
|
|
};
|
2013-05-24 18:09:57 +00:00
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
/* setup protocol subtree array */
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_coseventcomm,
|
|
|
|
};
|
2012-06-01 15:57:05 +00:00
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
expert_module_t* expert_coseventcomm;
|
2013-05-24 18:09:57 +00:00
|
|
|
|
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_coseventcomm = proto_register_protocol("Coseventcomm Dissector Using GIOP API" , "COSEVENTCOMM", "giop-coseventcomm" );
|
|
|
|
proto_register_field_array(proto_coseventcomm, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-24 18:09:57 +00:00
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
expert_coseventcomm = expert_register_protocol(proto_coseventcomm);
|
|
|
|
expert_register_field_array(expert_coseventcomm, ei, array_length(ei));
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* register me as handler for these interfaces */
|
2012-11-05 03:36:07 +00:00
|
|
|
void proto_reg_handoff_giop_coseventcomm(void)
|
|
|
|
{
|
2012-06-01 15:57:05 +00:00
|
|
|
/* Register for Explicit Dissection */
|
|
|
|
register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PullConsumer", proto_coseventcomm ); /* explicit dissector */
|
2013-12-03 13:38:56 +00:00
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
/* Register for Explicit Dissection */
|
|
|
|
register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PullSupplier", proto_coseventcomm ); /* explicit dissector */
|
2013-12-03 13:38:56 +00:00
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
/* Register for Explicit Dissection */
|
|
|
|
register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PushConsumer", proto_coseventcomm ); /* explicit dissector */
|
2013-12-03 13:38:56 +00:00
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
/* Register for Explicit Dissection */
|
|
|
|
register_giop_user_module(dissect_coseventcomm, "COSEVENTCOMM", "CosEventComm/PushSupplier", proto_coseventcomm ); /* explicit dissector */
|
2013-12-03 13:38:56 +00:00
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
/* Register for Heuristic Dissection */
|
|
|
|
register_giop_user(dissect_coseventcomm, "COSEVENTCOMM" ,proto_coseventcomm); /* heuristic dissector */
|
2013-12-03 13:38:56 +00:00
|
|
|
|
2012-06-01 15:57:05 +00:00
|
|
|
}
|
|
|
|
|
2013-12-03 13:38:56 +00:00
|
|
|
/*
|
2020-04-28 18:39:32 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2013-12-03 13:38:56 +00:00
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|