2001-07-20 20:56:18 +00:00
/* packet-coseventcomm.c
2008-05-09 07:07:50 +00:00
*
* $ Id $
*
2001-07-20 20:56:18 +00:00
* Routines for IDL dissection
*
2006-05-31 00:23:01 +00:00
* Autogenerated from idl2wrs
2001-07-20 20:56:18 +00:00
* Copyright 2001 Frank Singleton < frank . singleton @ ericsson . com >
*/
/*
2006-05-21 05:12:17 +00:00
* Wireshark - Network traffic analyzer
2001-07-20 20:56:18 +00:00
* By Gerald Combs
2006-05-29 16:32:08 +00:00
* Copyright 1999 - 2006 Gerald Combs
2001-07-20 20:56:18 +00:00
*/
2005-06-25 18:20:13 +00:00
2011-11-29 19:36:53 +00:00
static int hf_operationrequest = - 1 ; /* Request_Operation field */
2001-07-20 20:56:18 +00:00
/*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
2005-06-25 18:20:13 +00:00
*
2001-07-20 20:56:18 +00:00
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
2005-06-25 18:20:13 +00:00
*
2001-07-20 20:56:18 +00:00
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include <gmodule.h>
# include <string.h>
# include <glib.h>
2002-01-21 07:37:49 +00:00
# include <epan/packet.h>
# include <epan/proto.h>
2004-07-18 18:06:47 +00:00
# include <epan/dissectors/packet-giop.h>
2001-07-20 20:56:18 +00:00
2003-09-05 07:44:50 +00:00
# ifndef ENABLE_STATIC
2001-07-20 20:56:18 +00:00
G_MODULE_EXPORT const gchar version [ ] = " 0.0.1 " ;
# endif
2007-03-27 20:57:58 +00:00
# ifdef _MSC_VER
/* disable warning: "unreference local variable" */
# pragma warning(disable:4101)
# endif
2001-07-20 20:56:18 +00:00
2005-06-25 18:20:13 +00:00
static proto_tree * start_dissecting ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * ptree , int * offset ) ;
2002-01-30 18:55:39 +00:00
/* Struct prototype declaration Start */
2005-06-25 18:20:13 +00:00
2002-01-30 18:55:39 +00:00
/* Struct prototype declaration End */
2005-06-25 18:20:13 +00:00
2002-01-30 18:55:39 +00:00
/* Union prototype declaration Start */
2005-06-25 18:20:13 +00:00
2002-01-30 18:55:39 +00:00
/* Union prototype declaration End */
2005-06-25 18:20:13 +00:00
2002-01-30 18:55:39 +00:00
2001-07-20 20:56:18 +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 */
/* Initialise the Registered fields */
/* TODO - Use registered fields */
/*
* IDL Operations Start
*/
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
static const char CosEventComm_PushConsumer_push_op [ ] = " push " ;
static const char CosEventComm_PushConsumer_disconnect_push_consumer_op [ ] = " disconnect_push_consumer " ;
static const char CosEventComm_PushSupplier_disconnect_push_supplier_op [ ] = " disconnect_push_supplier " ;
static const char CosEventComm_PullSupplier_pull_op [ ] = " pull " ;
static const char CosEventComm_PullSupplier_try_pull_op [ ] = " try_pull " ;
static const char CosEventComm_PullSupplier_disconnect_pull_supplier_op [ ] = " disconnect_pull_supplier " ;
static const char CosEventComm_PullConsumer_disconnect_pull_consumer_op [ ] = " disconnect_pull_consumer " ;
/*
* IDL Operations End
*/
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
/* Begin Exception (containing members) String Declare */
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
/* End Exception (containing members) String Declare */
2002-01-30 18:55:39 +00:00
/*
* IDL Attributes Start
*/
2005-06-24 12:43:32 +00:00
2002-01-30 18:55:39 +00:00
/*
* IDL Attributes End
*/
2005-06-25 18:20:13 +00:00
2002-01-30 18:55:39 +00:00
/*
* IDL Enums Start
*/
2005-06-24 12:43:32 +00:00
2002-01-30 18:55:39 +00:00
/*
* IDL Enums End
*/
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Begin Exception Helper Functions */
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
/* End Exception Helper Functions */
/*
* Main delegator for exception handling
*
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static gboolean decode_user_exception ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * ptree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
/*gboolean stream_is_big_endian _U_;*/ /* big endianess */
2005-06-25 18:20:13 +00:00
proto_tree * tree _U_ ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
if ( ! header - > exception_id )
return FALSE ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
return FALSE ; /* user exception not found */
}
2005-06-25 18:20:13 +00:00
2002-01-30 18:55:39 +00:00
/* Begin Attribute Helper Functions */
/* End Attribute Helper Functions */
2001-07-20 20:56:18 +00:00
/*
* IDL : omg . org / CosEventComm / PushConsumer / push : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PushConsumer_push ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
get_CDR_any ( tvb , tree , offset , stream_is_big_endian , boundary , header ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Function returns void */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
/*
* IDL : omg . org / CosEventComm / PushConsumer / disconnect_push_consumer : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PushConsumer_disconnect_push_consumer ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Function returns void */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
/*
* IDL : omg . org / CosEventComm / PushSupplier / disconnect_push_supplier : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PushSupplier_disconnect_push_supplier ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Function returns void */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
/*
* IDL : omg . org / CosEventComm / PullSupplier / pull : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PullSupplier_pull ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
get_CDR_any ( tvb , tree , offset , stream_is_big_endian , boundary , header ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
/*
* IDL : omg . org / CosEventComm / PullSupplier / try_pull : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PullSupplier_try_pull ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
guint8 u_octet1 ;
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
get_CDR_any ( tvb , tree , offset , stream_is_big_endian , boundary , header ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
u_octet1 = get_CDR_boolean ( tvb , offset ) ;
if ( tree ) {
proto_tree_add_text ( tree , tvb , * offset - 1 , 1 , " has_event = %u " , u_octet1 ) ;
}
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
/*
* IDL : omg . org / CosEventComm / PullSupplier / disconnect_pull_supplier : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PullSupplier_disconnect_pull_supplier ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Function returns void */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
/*
* IDL : omg . org / CosEventComm / PullConsumer / disconnect_pull_consumer : 1.0
*/
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
static void decode_CosEventComm_PullConsumer_disconnect_pull_consumer ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , int * offset _U_ , MessageHeader * header , gchar * operation _U_ , gboolean stream_is_big_endian _U_ ) {
2001-07-20 20:56:18 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations Begin */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Operation specific Variable declarations End */
2002-08-28 20:41:00 +00:00
2011-11-18 12:39:35 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Reply :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
switch ( header - > rep_status ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case NO_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Function returns void */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case USER_EXCEPTION :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown Exception */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown Exception " ) ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
/* Unknown GIOP Message */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
g_warning ( " Unknown GIOP Message " ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
} /* switch(header->message_type) */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
2005-06-25 18:20:13 +00:00
/*
* 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 .
*/
static proto_tree * start_dissecting ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * ptree , int * offset ) {
2001-07-20 20:56:18 +00:00
proto_item * ti = NULL ;
proto_tree * tree = NULL ; /* init later, inside if(tree) */
2009-08-09 06:26:46 +00:00
col_set_str ( pinfo - > cinfo , COL_PROTOCOL , " COSEVENTCOMM " ) ;
2005-06-25 18:20:13 +00:00
/*
* 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 ) ;
*/
2002-01-30 18:55:39 +00:00
2001-07-20 20:56:18 +00:00
if ( ptree ) {
2010-05-24 06:06:17 +00:00
ti = proto_tree_add_item ( ptree , proto_coseventcomm , tvb , * offset , - 1 , ENC_NA ) ;
2005-06-25 18:20:13 +00:00
tree = proto_item_add_subtree ( ti , ett_coseventcomm ) ;
}
return tree ;
}
2001-07-20 20:56:18 +00:00
2006-04-17 18:10:23 +00:00
static gboolean dissect_coseventcomm ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * ptree , int * offset , MessageHeader * header , gchar * operation , gchar * idlname ) {
2005-06-25 18:20:13 +00:00
2011-11-18 12:39:35 +00:00
gboolean stream_is_big_endian ; /* big endianess */
2005-06-25 18:20:13 +00:00
proto_tree * tree _U_ ;
2011-11-29 19:36:53 +00:00
# define process_RequestOperation(){ \
proto_item * pi ; \
if ( header - > message_type = = Reply ) { col_append_fstr ( pinfo - > cinfo , COL_INFO , " op = %s " , operation ) ; } ; /* fill-up info column */ \
pi = proto_tree_add_string_format_value ( ptree , hf_operationrequest , tvb , 0 , 0 , operation , " %s " , operation ) ; PROTO_ITEM_SET_GENERATED ( pi ) ; /* fill-up the field */ \
} ;
2001-07-20 20:56:18 +00:00
2011-11-18 12:39:35 +00:00
stream_is_big_endian = is_big_endian ( header ) ; /* get endianess */
2001-07-20 20:56:18 +00:00
/* If we have a USER Exception, then decode it and return */
if ( ( header - > message_type = = Reply ) & & ( header - > rep_status = = USER_EXCEPTION ) ) {
2011-11-18 12:39:35 +00:00
return decode_user_exception ( tvb , pinfo , ptree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
}
switch ( header - > message_type ) {
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case Request :
case Reply :
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PushConsumer_push_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PushConsumer " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PushConsumer_push ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PushConsumer_disconnect_push_consumer_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PushConsumer " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PushConsumer_disconnect_push_consumer ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PushSupplier_disconnect_push_supplier_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PushSupplier " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PushSupplier_disconnect_push_supplier ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PullSupplier_pull_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PullSupplier " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PullSupplier_pull ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PullSupplier_try_pull_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PullSupplier " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PullSupplier_try_pull ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PullSupplier_disconnect_pull_supplier_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PullSupplier " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PullSupplier_disconnect_pull_supplier ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
if ( strcmp ( operation , CosEventComm_PullConsumer_disconnect_pull_consumer_op ) = = 0
& & ( ! idlname | | strcmp ( idlname , " CosEventComm/PullConsumer " ) = = 0 ) ) {
2011-11-29 19:36:53 +00:00
process_RequestOperation ( ) ; /* fill-up Request_Operation field & info column */
2005-06-25 18:20:13 +00:00
tree = start_dissecting ( tvb , pinfo , ptree , offset ) ;
2011-11-18 12:39:35 +00:00
decode_CosEventComm_PullConsumer_disconnect_pull_consumer ( tvb , pinfo , tree , offset , header , operation , stream_is_big_endian ) ;
2001-07-20 20:56:18 +00:00
return TRUE ;
}
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
break ;
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
case CancelRequest :
case LocateRequest :
case LocateReply :
case CloseConnection :
case MessageError :
case Fragment :
return FALSE ; /* not handled yet */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
default :
return FALSE ; /* not handled yet */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
} /* switch */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
return FALSE ;
} /* End of main dissector */
2006-05-28 16:32:49 +00:00
/* Register the protocol with Wireshark */
2001-07-20 20:56:18 +00:00
void proto_register_giop_coseventcomm ( void ) {
/* setup list of header fields */
static hf_register_info hf [ ] = {
2011-11-29 19:36:53 +00:00
/* field that indicates the currently ongoing request/reply exchange */
{ & hf_operationrequest , { " Request_Operation " , " COSEVENTCOMM.Request_Operation " , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL } } ,
2001-07-20 20:56:18 +00:00
/* no fields yet */
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
} ;
/* setup protocol subtree array */
static gint * ett [ ] = {
& ett_coseventcomm ,
} ;
/* Register the protocol name and description */
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
proto_coseventcomm = proto_register_protocol ( " Coseventcomm Dissector Using GIOP API " , " COSEVENTCOMM " , " giop-coseventcomm " ) ;
proto_register_field_array ( proto_coseventcomm , hf , array_length ( hf ) ) ;
2011-11-29 19:36:53 +00:00
2001-07-20 20:56:18 +00:00
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
2005-06-25 18:20:13 +00:00
2001-07-20 20:56:18 +00:00
}
/* register me as handler for these interfaces */
void proto_register_handoff_giop_coseventcomm ( void ) {
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Register for Explicit Dissection */
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
register_giop_user_module ( dissect_coseventcomm , " COSEVENTCOMM " , " CosEventComm/PullConsumer " , proto_coseventcomm ) ; /* explicit dissector */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Register for Explicit Dissection */
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
register_giop_user_module ( dissect_coseventcomm , " COSEVENTCOMM " , " CosEventComm/PullSupplier " , proto_coseventcomm ) ; /* explicit dissector */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Register for Explicit Dissection */
2002-08-28 20:41:00 +00:00
2006-04-17 18:10:23 +00:00
register_giop_user_module ( dissect_coseventcomm , " COSEVENTCOMM " , " CosEventComm/PushConsumer " , proto_coseventcomm ) ; /* explicit dissector */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Register for Explicit Dissection */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
register_giop_user_module ( dissect_coseventcomm , " COSEVENTCOMM " , " CosEventComm/PushSupplier " , proto_coseventcomm ) ; /* explicit dissector */
2002-08-28 20:41:00 +00:00
2005-06-24 12:43:32 +00:00
2001-07-20 20:56:18 +00:00
/* Register for Heuristic Dissection */
2002-08-28 20:41:00 +00:00
2005-06-25 18:20:13 +00:00
register_giop_user ( dissect_coseventcomm , " COSEVENTCOMM " , proto_coseventcomm ) ; /* heuristic dissector */
2002-08-28 20:41:00 +00:00
2001-07-20 20:56:18 +00:00
}
2003-09-05 07:44:50 +00:00
# ifndef ENABLE_STATIC
2001-07-20 20:56:18 +00:00
G_MODULE_EXPORT void
2005-03-07 02:44:41 +00:00
plugin_register ( void )
2005-03-05 06:28:10 +00:00
{
2001-07-20 20:56:18 +00:00
if ( proto_coseventcomm = = - 1 ) {
proto_register_giop_coseventcomm ( ) ;
}
}
2005-03-07 02:44:41 +00:00
G_MODULE_EXPORT void
plugin_reg_handoff ( void ) {
proto_register_handoff_giop_coseventcomm ( ) ;
}
2001-07-20 20:56:18 +00:00
# endif