Eliminate a lot of function-local variables by not storing the result of

(several of the) get_CDR_*() functions: instead call the function directly
in the proto_tree_add_text() calls.

Eliminate a lot of global variables that are only later used in (a single)
strcmp().

All the GIOP dissectors are built-in now; don't include the (#if'd out) plugin
registration code in the generated dissector.

Try to clean up the formatting of the generated code a bit.

Regenerate the IDL dissectors; as noted in r39932, this seems to involve a
lot of function re-ordering in packet-parlay.c (making the delta bigger).


These changes decrease the time to compile packet-parlay.c by, on my system,
about half.  But it still complains:

variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without

and it still takes "too long."

svn path=/trunk/; revision=43609
This commit is contained in:
Jeff Morriss 2012-07-08 03:29:49 +00:00
parent 5f90f658fe
commit a2c4716670
5 changed files with 9322 additions and 10726 deletions

View File

@ -12,7 +12,7 @@
/*
* Wireshark - Network traffic analyzer
* By Gerald Combs
* Copyright 1999 - 2006 Gerald Combs
* Copyright 1999 - 2012 Gerald Combs
*/
static int hf_operationrequest = -1;/* Request_Operation field */
@ -47,7 +47,6 @@ static int hf_operationrequest = -1;/* Request_Operation field */
#include <epan/proto.h>
#include <epan/dissectors/packet-giop.h>
#ifdef _MSC_VER
/* disable warning: "unreference local variable" */
#pragma warning(disable:4101)
@ -70,7 +69,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
/* Union prototype declaration End */
/* Initialise the protocol and subtree pointers */
static int proto_coseventcomm = -1;
@ -88,32 +86,10 @@ static guint32 boundary = GIOP_HEADER_SIZE; /* initial value */
/* TODO - Use registered fields */
/*
* IDL Operations Start
*/
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
*/
/* Begin Exception (containing members) String Declare */
/* End Exception (containing members) String Declare */
/*
* IDL Attributes Start
*/
/*
* IDL Attributes End
@ -122,11 +98,11 @@ static const char CosEventComm_PullConsumer_disconnect_pull_consumer_op[] = "dis
/*
* IDL Enums Start
*/
/*
* IDL Enums End
*/
/* Begin Exception Helper Functions */
@ -137,8 +113,9 @@ static const char CosEventComm_PullConsumer_disconnect_pull_consumer_op[] = "dis
* Main delegator for exception handling
*
*/
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_) {
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_)
{
/*gboolean stream_is_big_endian _U_;*/ /* big endianess */
proto_tree *tree _U_;
@ -161,7 +138,9 @@ static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
* IDL:omg.org/CosEventComm/PushConsumer/push:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
@ -221,7 +200,9 @@ static void decode_CosEventComm_PushConsumer_push(tvbuff_t *tvb _U_, packet_info
* IDL:omg.org/CosEventComm/PushConsumer/disconnect_push_consumer:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
@ -279,7 +260,9 @@ static void decode_CosEventComm_PushConsumer_disconnect_push_consumer(tvbuff_t *
* IDL:omg.org/CosEventComm/PushSupplier/disconnect_push_supplier:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
@ -337,7 +320,9 @@ static void decode_CosEventComm_PushSupplier_disconnect_push_supplier(tvbuff_t *
* IDL:omg.org/CosEventComm/PullSupplier/pull:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
@ -395,12 +380,13 @@ static void decode_CosEventComm_PullSupplier_pull(tvbuff_t *tvb _U_, packet_info
* IDL:omg.org/CosEventComm/PullSupplier/try_pull:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
guint8 u_octet1;
/* Operation specific Variable declarations End */
@ -419,9 +405,8 @@ static void decode_CosEventComm_PullSupplier_try_pull(tvbuff_t *tvb _U_, packet_
get_CDR_any(tvb,tree,offset,stream_is_big_endian, boundary, header);
u_octet1 = get_CDR_boolean(tvb,offset);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-1,1,"has_event = %u",u_octet1);
proto_tree_add_text(tree,tvb,*offset-1,1,"has_event = %u",get_CDR_boolean(tvb,offset));
}
break;
@ -459,7 +444,9 @@ static void decode_CosEventComm_PullSupplier_try_pull(tvbuff_t *tvb _U_, packet_
* IDL:omg.org/CosEventComm/PullSupplier/disconnect_pull_supplier:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
@ -517,7 +504,9 @@ static void decode_CosEventComm_PullSupplier_disconnect_pull_supplier(tvbuff_t *
* IDL:omg.org/CosEventComm/PullConsumer/disconnect_pull_consumer:1.0
*/
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_) {
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_)
{
/* Operation specific Variable declarations Begin */
@ -576,7 +565,9 @@ static void decode_CosEventComm_PullConsumer_disconnect_pull_consumer(tvbuff_t *
* 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) {
static proto_tree *
start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset)
{
proto_item *ti = NULL;
proto_tree *tree = NULL; /* init later, inside if(tree) */
@ -597,7 +588,9 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return tree;
}
static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname) {
static gboolean
dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname)
{
gboolean stream_is_big_endian; /* big endianess */
proto_tree *tree _U_;
@ -622,7 +615,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
case Request:
case Reply:
if (strcmp(operation, CosEventComm_PushConsumer_push_op) == 0
if (strcmp(operation, "push") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PushConsumer") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -630,7 +623,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return TRUE;
}
if (strcmp(operation, CosEventComm_PushConsumer_disconnect_push_consumer_op) == 0
if (strcmp(operation, "disconnect_push_consumer") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PushConsumer") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -638,7 +631,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return TRUE;
}
if (strcmp(operation, CosEventComm_PushSupplier_disconnect_push_supplier_op) == 0
if (strcmp(operation, "disconnect_push_supplier") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PushSupplier") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -646,7 +639,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return TRUE;
}
if (strcmp(operation, CosEventComm_PullSupplier_pull_op) == 0
if (strcmp(operation, "pull") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PullSupplier") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -654,7 +647,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return TRUE;
}
if (strcmp(operation, CosEventComm_PullSupplier_try_pull_op) == 0
if (strcmp(operation, "try_pull") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PullSupplier") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -662,7 +655,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return TRUE;
}
if (strcmp(operation, CosEventComm_PullSupplier_disconnect_pull_supplier_op) == 0
if (strcmp(operation, "disconnect_pull_supplier") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PullSupplier") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -670,7 +663,7 @@ static gboolean dissect_coseventcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tr
return TRUE;
}
if (strcmp(operation, CosEventComm_PullConsumer_disconnect_pull_consumer_op) == 0
if (strcmp(operation, "disconnect_pull_consumer") == 0
&& (!idlname || strcmp(idlname, "CosEventComm/PullConsumer") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -765,4 +758,3 @@ void proto_reg_handoff_giop_coseventcomm(void) {
}

View File

@ -12,7 +12,7 @@
/*
* Wireshark - Network traffic analyzer
* By Gerald Combs
* Copyright 1999 - 2006 Gerald Combs
* Copyright 1999 - 2012 Gerald Combs
*/
static int hf_operationrequest = -1;/* Request_Operation field */
@ -61,12 +61,10 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
/* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */
static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_);
/* Struct = IDL:omg.org/CosNaming/Binding:1.0 */
static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_);
@ -79,7 +77,6 @@ static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U
/* Union prototype declaration End */
/* Initialise the protocol and subtree pointers */
static int proto_cosnaming = -1;
@ -97,40 +94,10 @@ static guint32 boundary = GIOP_HEADER_SIZE; /* initial value */
/* TODO - Use registered fields */
/*
* IDL Operations Start
*/
static const char CosNaming_NamingContext_bind_op[] = "bind" ;
static const char CosNaming_NamingContext_rebind_op[] = "rebind" ;
static const char CosNaming_NamingContext_bind_context_op[] = "bind_context" ;
static const char CosNaming_NamingContext_rebind_context_op[] = "rebind_context" ;
static const char CosNaming_NamingContext_resolve_op[] = "resolve" ;
static const char CosNaming_NamingContext_unbind_op[] = "unbind" ;
static const char CosNaming_NamingContext_new_context_op[] = "new_context" ;
static const char CosNaming_NamingContext_bind_new_context_op[] = "bind_new_context" ;
static const char CosNaming_NamingContext_destroy_op[] = "destroy" ;
static const char CosNaming_NamingContext_list_op[] = "list" ;
static const char CosNaming_BindingIterator_next_one_op[] = "next_one" ;
static const char CosNaming_BindingIterator_next_n_op[] = "next_n" ;
static const char CosNaming_BindingIterator_destroy_op[] = "destroy" ;
/*
* IDL Operations End
*/
/* Begin Exception (containing members) String Declare */
static const char user_exception_CosNaming_NamingContext_NotFound[] = "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0" ;
static const char user_exception_CosNaming_NamingContext_CannotProceed[] = "IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0" ;
/* End Exception (containing members) String Declare */
/*
* IDL Attributes Start
*/
/*
* IDL Attributes End
@ -139,40 +106,39 @@ static const char user_exception_CosNaming_NamingContext_CannotProceed[] = "IDL:
/*
* IDL Enums Start
*/
/*
* Enum = IDL:omg.org/CosNaming/BindingType:1.0
*/
static const value_string CosNaming_BindingType[] = {
{ 0, "nobject" },
{ 1, "ncontext" },
{ 0, "nobject" },
{ 1, "ncontext" },
{ 0, NULL },
};
/*
* Enum = IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0
*/
static const value_string CosNaming_NamingContext_NotFoundReason[] = {
{ 0, "missing_node" },
{ 1, "not_context" },
{ 2, "not_object" },
{ 0, "missing_node" },
{ 1, "not_context" },
{ 2, "not_object" },
{ 0, NULL },
};
/*
* IDL Enums End
*/
/* Begin Exception Helper Functions */
/* Exception = IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 */
static void decode_ex_CosNaming_NamingContext_NotFound(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_ex_CosNaming_NamingContext_NotFound(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
/* Operation specific Variable declarations Begin */
@ -209,8 +175,9 @@ static void decode_ex_CosNaming_NamingContext_NotFound(tvbuff_t *tvb _U_, packet
}
/* Exception = IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0 */
static void decode_ex_CosNaming_NamingContext_CannotProceed(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_ex_CosNaming_NamingContext_CannotProceed(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
/* Operation specific Variable declarations Begin */
@ -249,8 +216,9 @@ static void decode_ex_CosNaming_NamingContext_CannotProceed(tvbuff_t *tvb _U_, p
* Main delegator for exception handling
*
*/
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_) {
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_)
{
/*gboolean stream_is_big_endian _U_;*/ /* big endianess */
proto_tree *tree _U_;
@ -258,13 +226,13 @@ static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
if (!header->exception_id)
return FALSE;
if (strcmp(header->exception_id, user_exception_CosNaming_NamingContext_NotFound) == 0) {
if (strcmp(header->exception_id, "IDL:omg.org/CosNaming/NamingContext/NotFound:1.0") == 0) {
tree = start_dissecting(tvb, pinfo, ptree, offset);
decode_ex_CosNaming_NamingContext_NotFound(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian); /* IDL:omg.org/CosNaming/NamingContext/NotFound:1.0 */
return TRUE;
}
if (strcmp(header->exception_id, user_exception_CosNaming_NamingContext_CannotProceed) == 0) {
if (strcmp(header->exception_id, "IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0") == 0) {
tree = start_dissecting(tvb, pinfo, ptree, offset);
decode_ex_CosNaming_NamingContext_CannotProceed(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian); /* IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0 */
return TRUE;
@ -285,7 +253,9 @@ static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
* IDL:omg.org/CosNaming/NamingContext/bind:1.0
*/
static void decode_CosNaming_NamingContext_bind(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_) {
static void
decode_CosNaming_NamingContext_bind(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_)
{
/* Operation specific Variable declarations Begin */
@ -365,7 +335,9 @@ static void decode_CosNaming_NamingContext_bind(tvbuff_t *tvb _U_, packet_info *
* IDL:omg.org/CosNaming/NamingContext/rebind:1.0
*/
static void decode_CosNaming_NamingContext_rebind(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_) {
static void
decode_CosNaming_NamingContext_rebind(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_)
{
/* Operation specific Variable declarations Begin */
@ -445,7 +417,9 @@ static void decode_CosNaming_NamingContext_rebind(tvbuff_t *tvb _U_, packet_info
* IDL:omg.org/CosNaming/NamingContext/bind_context:1.0
*/
static void decode_CosNaming_NamingContext_bind_context(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_) {
static void
decode_CosNaming_NamingContext_bind_context(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_)
{
/* Operation specific Variable declarations Begin */
@ -525,7 +499,9 @@ static void decode_CosNaming_NamingContext_bind_context(tvbuff_t *tvb _U_, packe
* IDL:omg.org/CosNaming/NamingContext/rebind_context:1.0
*/
static void decode_CosNaming_NamingContext_rebind_context(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_) {
static void
decode_CosNaming_NamingContext_rebind_context(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_)
{
/* Operation specific Variable declarations Begin */
@ -605,7 +581,9 @@ static void decode_CosNaming_NamingContext_rebind_context(tvbuff_t *tvb _U_, pac
* IDL:omg.org/CosNaming/NamingContext/resolve:1.0
*/
static void decode_CosNaming_NamingContext_resolve(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_) {
static void
decode_CosNaming_NamingContext_resolve(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_)
{
/* Operation specific Variable declarations Begin */
@ -683,7 +661,9 @@ static void decode_CosNaming_NamingContext_resolve(tvbuff_t *tvb _U_, packet_inf
* IDL:omg.org/CosNaming/NamingContext/unbind:1.0
*/
static void decode_CosNaming_NamingContext_unbind(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_) {
static void
decode_CosNaming_NamingContext_unbind(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_)
{
/* Operation specific Variable declarations Begin */
@ -760,7 +740,9 @@ static void decode_CosNaming_NamingContext_unbind(tvbuff_t *tvb _U_, packet_info
* IDL:omg.org/CosNaming/NamingContext/new_context:1.0
*/
static void decode_CosNaming_NamingContext_new_context(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_) {
static void
decode_CosNaming_NamingContext_new_context(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_)
{
/* Operation specific Variable declarations Begin */
@ -819,7 +801,9 @@ static void decode_CosNaming_NamingContext_new_context(tvbuff_t *tvb _U_, packet
* IDL:omg.org/CosNaming/NamingContext/bind_new_context:1.0
*/
static void decode_CosNaming_NamingContext_bind_new_context(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_) {
static void
decode_CosNaming_NamingContext_bind_new_context(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_)
{
/* Operation specific Variable declarations Begin */
@ -897,7 +881,9 @@ static void decode_CosNaming_NamingContext_bind_new_context(tvbuff_t *tvb _U_, p
* IDL:omg.org/CosNaming/NamingContext/destroy:1.0
*/
static void decode_CosNaming_NamingContext_destroy(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_) {
static void
decode_CosNaming_NamingContext_destroy(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_)
{
/* Operation specific Variable declarations Begin */
@ -955,12 +941,13 @@ static void decode_CosNaming_NamingContext_destroy(tvbuff_t *tvb _U_, packet_inf
* IDL:omg.org/CosNaming/NamingContext/list:1.0
*/
static void decode_CosNaming_NamingContext_list(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_) {
static void
decode_CosNaming_NamingContext_list(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_)
{
/* Operation specific Variable declarations Begin */
guint32 u_octet4;
guint32 u_octet4_loop_bl;
guint32 i_bl;
@ -971,9 +958,8 @@ static void decode_CosNaming_NamingContext_list(tvbuff_t *tvb _U_, packet_info *
case Request:
u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-4,4,"how_many = %u",u_octet4);
proto_tree_add_text(tree,tvb,*offset-4,4,"how_many = %u",get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary));
}
break;
@ -1041,12 +1027,13 @@ static void decode_CosNaming_NamingContext_list(tvbuff_t *tvb _U_, packet_info *
* IDL:omg.org/CosNaming/BindingIterator/next_one:1.0
*/
static void decode_CosNaming_BindingIterator_next_one(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_) {
static void
decode_CosNaming_BindingIterator_next_one(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_)
{
/* Operation specific Variable declarations Begin */
guint8 u_octet1;
/* Operation specific Variable declarations End */
@ -1063,9 +1050,8 @@ static void decode_CosNaming_BindingIterator_next_one(tvbuff_t *tvb _U_, packet_
case NO_EXCEPTION:
u_octet1 = get_CDR_boolean(tvb,offset);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-1,1,"Operation_Return_Value = %u",u_octet1);
proto_tree_add_text(tree,tvb,*offset-1,1,"Operation_Return_Value = %u",get_CDR_boolean(tvb,offset));
}
/* Begin struct "CosNaming_Binding" */
@ -1111,13 +1097,13 @@ static void decode_CosNaming_BindingIterator_next_one(tvbuff_t *tvb _U_, packet_
* IDL:omg.org/CosNaming/BindingIterator/next_n:1.0
*/
static void decode_CosNaming_BindingIterator_next_n(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_) {
static void
decode_CosNaming_BindingIterator_next_n(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_)
{
/* Operation specific Variable declarations Begin */
guint32 u_octet4;
guint8 u_octet1;
guint32 u_octet4_loop_bl;
guint32 i_bl;
@ -1128,9 +1114,8 @@ static void decode_CosNaming_BindingIterator_next_n(tvbuff_t *tvb _U_, packet_in
case Request:
u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-4,4,"how_many = %u",u_octet4);
proto_tree_add_text(tree,tvb,*offset-4,4,"how_many = %u",get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary));
}
break;
@ -1141,9 +1126,8 @@ static void decode_CosNaming_BindingIterator_next_n(tvbuff_t *tvb _U_, packet_in
case NO_EXCEPTION:
u_octet1 = get_CDR_boolean(tvb,offset);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-1,1,"Operation_Return_Value = %u",u_octet1);
proto_tree_add_text(tree,tvb,*offset-1,1,"Operation_Return_Value = %u",get_CDR_boolean(tvb,offset));
}
u_octet4_loop_bl = get_CDR_ulong(tvb, offset, stream_is_big_endian, boundary);
@ -1198,7 +1182,9 @@ static void decode_CosNaming_BindingIterator_next_n(tvbuff_t *tvb _U_, packet_in
* IDL:omg.org/CosNaming/BindingIterator/destroy:1.0
*/
static void decode_CosNaming_BindingIterator_destroy(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_) {
static void
decode_CosNaming_BindingIterator_destroy(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_)
{
/* Operation specific Variable declarations Begin */
@ -1253,8 +1239,9 @@ static void decode_CosNaming_BindingIterator_destroy(tvbuff_t *tvb _U_, packet_i
}
/* Struct = IDL:omg.org/CosNaming/NameComponent:1.0 */
static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
/* Operation specific Variable declarations Begin */
@ -1285,8 +1272,9 @@ static void decode_CosNaming_NameComponent_st(tvbuff_t *tvb _U_, packet_info *pi
}
/* Struct = IDL:omg.org/CosNaming/Binding:1.0 */
static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
/* Operation specific Variable declarations Begin */
@ -1327,7 +1315,9 @@ static void decode_CosNaming_Binding_st(tvbuff_t *tvb _U_, packet_info *pinfo _U
* 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) {
static proto_tree *
start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset)
{
proto_item *ti = NULL;
proto_tree *tree = NULL; /* init later, inside if(tree) */
@ -1348,7 +1338,9 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return tree;
}
static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname) {
static gboolean
dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname)
{
gboolean stream_is_big_endian; /* big endianess */
proto_tree *tree _U_;
@ -1373,7 +1365,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
case Request:
case Reply:
if (strcmp(operation, CosNaming_NamingContext_bind_op) == 0
if (strcmp(operation, "bind") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1381,7 +1373,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_rebind_op) == 0
if (strcmp(operation, "rebind") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1389,7 +1381,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_bind_context_op) == 0
if (strcmp(operation, "bind_context") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1397,7 +1389,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_rebind_context_op) == 0
if (strcmp(operation, "rebind_context") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1405,7 +1397,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_resolve_op) == 0
if (strcmp(operation, "resolve") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1413,7 +1405,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_unbind_op) == 0
if (strcmp(operation, "unbind") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1421,7 +1413,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_new_context_op) == 0
if (strcmp(operation, "new_context") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1429,7 +1421,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_bind_new_context_op) == 0
if (strcmp(operation, "bind_new_context") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1437,7 +1429,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_destroy_op) == 0
if (strcmp(operation, "destroy") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1445,7 +1437,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_NamingContext_list_op) == 0
if (strcmp(operation, "list") == 0
&& (!idlname || strcmp(idlname, "CosNaming/NamingContext") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1453,7 +1445,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_BindingIterator_next_one_op) == 0
if (strcmp(operation, "next_one") == 0
&& (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1461,7 +1453,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_BindingIterator_next_n_op) == 0
if (strcmp(operation, "next_n") == 0
&& (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1469,7 +1461,7 @@ static gboolean dissect_cosnaming(tvbuff_t *tvb, packet_info *pinfo, proto_tree
return TRUE;
}
if (strcmp(operation, CosNaming_BindingIterator_destroy_op) == 0
if (strcmp(operation, "destroy") == 0
&& (!idlname || strcmp(idlname, "CosNaming/BindingIterator") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1554,4 +1546,3 @@ void proto_reg_handoff_giop_cosnaming(void) {
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -127,8 +127,8 @@ class wireshark_gen_C:
#
# Some string constants for our templates
#
c_u_octet8 = "guint64 u_octet8;"
c_s_octet8 = "gint64 s_octet8;"
c_u_octet8 = "guint64 u_octet8;"
c_s_octet8 = "gint64 s_octet8;"
c_u_octet4 = "guint32 u_octet4;"
c_s_octet4 = "gint32 s_octet4;"
c_u_octet2 = "guint16 u_octet2;"
@ -198,8 +198,6 @@ class wireshark_gen_C:
self.genDeclares(oplist,atlist,enlist,stlist,unlist)
self.genProtocol()
self.genRegisteredFields()
self.genOpList(oplist) # string constant declares for operation names
self.genExList(oplist) # string constant declares for user exceptions
self.genAtList(atlist) # string constant declares for Attributes
self.genEnList(enlist) # string constant declares for Enums
@ -217,7 +215,8 @@ class wireshark_gen_C:
self.gen_proto_register()
self.gen_proto_reg_handoff(oplist)
self.gen_plugin_register()
# All the dissectors are now built-in
#self.gen_plugin_register()
#self.dumpvars() # debug
@ -361,59 +360,6 @@ class wireshark_gen_C:
self.st.out(self.template_main_dissector_end)
#
# genOpList
#
# in: oplist
#
# out: C code for IDL operations
#
# eg:
#
# static const char Penguin_Echo_echoShort_op[] = "echoShort" ;
#
def genOpList(self,oplist):
self.st.out(self.template_comment_operations_start)
for n in oplist:
sname = self.namespace(n, "_")
opname = n.identifier()
self.st.out(self.template_operations_declare, sname=sname, opname=opname)
self.st.out(self.template_comment_operations_end)
#
# genExList
#
# in: oplist
#
# out: C code for IDL User Exceptions that contain members
#
# eg:
#
# static const char user_exception_tux_bad_value[] = "IDL:tux/bad_value:1.0" ;
#
def genExList(self,oplist):
self.st.out(self.template_comment_user_exceptions_string_declare_start)
exlist = self.get_exceptionList(oplist) # grab list of ALL UNIQUE exception nodes
for ex in exlist:
if self.DEBUG:
print "XXX Exception " , ex.repoId()
print "XXX Exception Identifier" , ex.identifier()
print "XXX Exception Scoped Name" , ex.scopedName()
if (ex.members()): # only if has members
sname = self.namespace(ex, "_")
exname = ex.repoId()
self.st.out(self.template_user_exceptions_declare, sname=sname, exname=ex.repoId())
self.st.out(self.template_comment_user_exceptions_string_declare_end)
#
# genAtList
#
@ -846,7 +792,7 @@ class wireshark_gen_C:
iname = "/".join(op.scopedName()[:-1])
opname = op.identifier()
sname = self.namespace(op, "_")
self.st.out(self.template_op_delegate_code, interface=iname, sname=sname)
self.st.out(self.template_op_delegate_code, interface=iname, sname=sname, opname=opname)
#
# Delegator for Attributes
@ -1030,42 +976,33 @@ class wireshark_gen_C:
def get_CDR_ulong(self,pn):
self.st.out(self.template_get_CDR_ulong, varname=pn)
self.addvar(self.c_u_octet4)
def get_CDR_short(self,pn):
self.st.out(self.template_get_CDR_short, varname=pn)
self.addvar(self.c_s_octet2)
def get_CDR_void(self,pn):
self.st.out(self.template_get_CDR_void, varname=pn)
def get_CDR_long(self,pn):
self.st.out(self.template_get_CDR_long, varname=pn)
self.addvar(self.c_s_octet4)
def get_CDR_ushort(self,pn):
self.st.out(self.template_get_CDR_ushort, varname=pn)
self.addvar(self.c_u_octet2)
def get_CDR_float(self,pn):
self.st.out(self.template_get_CDR_float, varname=pn)
self.addvar(self.c_float)
def get_CDR_double(self,pn):
self.st.out(self.template_get_CDR_double, varname=pn)
self.addvar(self.c_double)
def get_CDR_longlong(self,pn):
self.st.out(self.template_get_CDR_longlong, varname=pn)
self.addvar(self.c_s_octet8)
def get_CDR_ulonglong(self,pn):
self.st.out(self.template_get_CDR_ulonglong, varname=pn)
self.addvar(self.c_u_octet8)
def get_CDR_boolean(self,pn):
self.st.out(self.template_get_CDR_boolean, varname=pn)
self.addvar(self.c_u_octet1)
def get_CDR_fixed(self,type,pn):
if self.DEBUG:
@ -1083,11 +1020,9 @@ class wireshark_gen_C:
def get_CDR_char(self,pn):
self.st.out(self.template_get_CDR_char, varname=pn)
self.addvar(self.c_u_octet1)
def get_CDR_octet(self,pn):
self.st.out(self.template_get_CDR_octet, varname=pn)
self.addvar(self.c_u_octet1)
def get_CDR_any(self,pn):
self.st.out(self.template_get_CDR_any, varname=pn)
@ -1096,8 +1031,6 @@ class wireshark_gen_C:
#self.st.out(self.template_get_CDR_enum, varname=pn)
sname = self.namespace(type.unalias(), "_")
self.st.out(self.template_get_CDR_enum_symbolic, valstringarray=sname,varname=pn)
self.addvar(self.c_u_octet4)
def get_CDR_string(self,pn):
@ -1124,8 +1057,6 @@ class wireshark_gen_C:
def get_CDR_sequence_len(self,pn):
self.st.out(self.template_get_CDR_sequence_length, seqname=pn)
self.addvar(self.c_u_octet4)
def get_CDR_union(self,type,pn):
@ -1604,18 +1535,6 @@ class wireshark_gen_C:
# Templates for C code
#
template_comment_operations_start = """\
/*
* IDL Operations Start
*/
"""
template_operations_declare = """static const char @sname@_op[] = \"@opname@\" ;"""
template_comment_operations_end = """
/*
* IDL Operations End
*/
"""
template_helper_function_comment = """\
/*
* @repoid@
@ -1628,7 +1547,9 @@ class wireshark_gen_C:
/* Operation specific Variable declarations End */
"""
template_helper_function_start = """\
static void decode_@sname@(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_) {
static void
decode_@sname@(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_)
{
"""
template_helper_function_end = """\
}
@ -1747,9 +1668,9 @@ void proto_register_giop_@dissector_name@(void) {
#
# template for delegation code
#
template_op_delegate_code = """\
if (strcmp(operation, @sname@_op) == 0
if (strcmp(operation, "@opname@") == 0
&& (!idlname || strcmp(idlname, \"@interface@\") == 0)) {
process_RequestOperation(); /* fill-up Request_Operation field & info column */
tree = start_dissecting(tvb, pinfo, ptree, offset);
@ -1794,7 +1715,7 @@ case NO_EXCEPTION:
"""
template_helper_switch_msgtype_reply_no_exception_end = """\
break;
"""
"""
template_helper_switch_msgtype_reply_user_exception_start = """\
case USER_EXCEPTION:
"""
@ -1843,78 +1764,67 @@ default:
break;
"""
#
# Templates for get_CDR_xxx accessors
#
template_get_CDR_ulong = """\
u_octet4 = get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-4,4,"@varname@ = %u",u_octet4);
proto_tree_add_text(tree,tvb,*offset-4,4,"@varname@ = %u",get_CDR_ulong(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_short = """\
s_octet2 = get_CDR_short(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-2,2,"@varname@ = %i",s_octet2);
proto_tree_add_text(tree,tvb,*offset-2,2,"@varname@ = %i",get_CDR_short(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_void = """\
/* Function returns void */
"""
template_get_CDR_long = """\
s_octet4 = get_CDR_long(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-4,4,"@varname@ = %i",s_octet4);
proto_tree_add_text(tree,tvb,*offset-4,4,"@varname@ = %i",get_CDR_long(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_ushort = """\
u_octet2 = get_CDR_ushort(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-2,2,"@varname@ = %u",u_octet2);
proto_tree_add_text(tree,tvb,*offset-2,2,"@varname@ = %u",get_CDR_ushort(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_float = """\
my_float = get_CDR_float(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-4,4,"@varname@ = %.6e",my_float);
proto_tree_add_text(tree,tvb,*offset-4,4,"@varname@ = %.6e",get_CDR_float(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_double = """\
my_double = get_CDR_double(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-8,8,"@varname@ = %.15e",my_double);
proto_tree_add_text(tree,tvb,*offset-8,8,"@varname@ = %.15e",get_CDR_double(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_longlong = """\
s_octet8 = get_CDR_long_long(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-8,8,"@varname@ = %" G_GINT64_MODIFIER "d",s_octet8);
proto_tree_add_text(tree,tvb,*offset-8,8,"@varname@ = %" G_GINT64_MODIFIER "d",get_CDR_long_long(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_ulonglong = """\
u_octet8 = get_CDR_ulong_long(tvb,offset,stream_is_big_endian, boundary);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-8,8,"@varname@ = %" G_GINT64_MODIFIER "u",u_octet8);
proto_tree_add_text(tree,tvb,*offset-8,8,"@varname@ = %" G_GINT64_MODIFIER "u",get_CDR_ulong_long(tvb,offset,stream_is_big_endian, boundary));
}
"""
template_get_CDR_boolean = """\
u_octet1 = get_CDR_boolean(tvb,offset);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-1,1,"@varname@ = %u",u_octet1);
proto_tree_add_text(tree,tvb,*offset-1,1,"@varname@ = %u",get_CDR_boolean(tvb,offset));
}
"""
template_get_CDR_char = """\
u_octet1 = get_CDR_char(tvb,offset);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-1,1,"@varname@ = %u",u_octet1);
proto_tree_add_text(tree,tvb,*offset-1,1,"@varname@ = %u",get_CDR_char(tvb,offset));
}
"""
template_get_CDR_octet = """\
u_octet1 = get_CDR_octet(tvb,offset);
if (tree) {
proto_tree_add_text(tree,tvb,*offset-1,1,"@varname@ = %u",u_octet1);
proto_tree_add_text(tree,tvb,*offset-1,1,"@varname@ = %u",get_CDR_octet(tvb,offset));
}
"""
template_get_CDR_any = """\
@ -2118,7 +2028,9 @@ static int hf_operationrequest = -1;/* Request_Operation field */
* 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) {
static proto_tree *
start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset)
{
proto_item *ti = NULL;
proto_tree *tree = NULL; /* init later, inside if(tree) */
@ -2139,7 +2051,9 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return tree;
}
static gboolean dissect_@dissname@(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname) {
static gboolean
dissect_@dissname@(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int *offset, MessageHeader *header, gchar *operation, gchar *idlname)
{
gboolean stream_is_big_endian; /* big endianess */
proto_tree *tree _U_;
@ -2218,25 +2132,6 @@ default:
#
# Templates for declaration of string constants for user exceptions.
#
template_comment_user_exceptions_string_declare_start = """\
/* Begin Exception (containing members) String Declare */
"""
template_user_exceptions_declare = """static const char user_exception_@sname@[] = \"@exname@\" ; """
template_comment_user_exceptions_string_declare_end = """\
/* End Exception (containing members) String Declare */
"""
#
# template for Main delegator for exception handling
#
@ -2246,8 +2141,9 @@ default:
* Main delegator for exception handling
*
*/
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_) {
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_)
{
/*gboolean stream_is_big_endian _U_;*/ /* big endianess */
proto_tree *tree _U_;
@ -2261,7 +2157,7 @@ static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
# template for exception delegation code body
#
template_ex_delegate_code = """\
if (strcmp(header->exception_id, user_exception_@sname@) == 0) {
if (strcmp(header->exception_id, "@exname@") == 0) {
tree = start_dissecting(tvb, pinfo, ptree, offset);
decode_ex_@sname@(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian); /* @exname@ */
return TRUE;
@ -2288,8 +2184,9 @@ if (strcmp(header->exception_id, user_exception_@sname@) == 0) {
template_exception_helper_function_start = """\
/* Exception = @exname@ */
static void decode_ex_@sname@(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_ex_@sname@(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
"""
template_exception_helper_function_end = """\
@ -2304,8 +2201,9 @@ static void decode_ex_@sname@(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t
template_struct_helper_function_start = """\
/* Struct = @stname@ */
static void decode_@sname@_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_@sname@_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
"""
template_struct_helper_function_end = """\
@ -2319,8 +2217,9 @@ static void decode_@sname@_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t
template_union_helper_function_start = """\
/* Union = @unname@ */
static void decode_@sname@_un(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_@sname@_un(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
"""
template_union_helper_function_end = """\
@ -2337,7 +2236,7 @@ static void decode_@sname@_un(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t
static const value_string @valstringname@[] = {
"""
template_value_string_entry = """\
{ @intval@, \"@description@\" }, """
{ @intval@, \"@description@\" },"""
template_value_string_end = """\
{ 0, NULL },
@ -2354,17 +2253,16 @@ static const value_string @valstringname@[] = {
/*
* IDL Enums Start
*/
"""
"""
template_comment_enums_end = """\
/*
* IDL Enums End
*/
"""
"""
template_comment_enum_comment = """\
/*
* Enum = @ename@
*/
"""
*/"""
@ -2377,7 +2275,7 @@ static const value_string @valstringname@[] = {
/*
* IDL Attributes Start
*/
"""
"""
#
# get/set accessor method names are language mapping dependant.
@ -2431,8 +2329,9 @@ if (strcmp(operation, set_@sname@_at) == 0 && (header->message_type == Request)
template_attribute_helper_function_start = """\
/* Attribute = @atname@ */
static void decode_@sname@_at(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_) {
static void
decode_@sname@_at(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_)
{
"""
template_attribute_helper_function_end = """\
@ -2472,7 +2371,7 @@ static void decode_@sname@_at(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t
/*
* IDL Union Start - @uname@
*/
"""
"""
template_comment_union_code_end = """
/*
* IDL union End - @uname@
@ -2482,7 +2381,7 @@ static void decode_@sname@_at(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t
/*
* IDL Union - Discriminant - @uname@
*/
"""
"""
#
# Cast Unions types to something appropriate
# Enum value cast to guint32, all others cast to gint32
@ -2514,11 +2413,11 @@ disc_s_@discname@ = (gint32) u_octet1; /* save guint1 discriminant and cast
"""
template_comment_union_code_label_compare_start = """\
if (disc_s_@discname@ == @labelval@) {
"""
"""
template_comment_union_code_label_compare_end = """\
return; /* End Compare for this discriminant type */
}
"""
"""
template_comment_union_code_label_default_start = """
@ -2526,7 +2425,7 @@ if (disc_s_@discname@ == @labelval@) {
"""
template_comment_union_code_label_default_end = """\
/* Default Union Case End */
"""
"""
#
# Templates for function prototypes.
@ -2546,7 +2445,6 @@ static proto_tree *start_dissecting(tvbuff_t *tvb, packet_info *pinfo, proto_tre
"""
template_prototype_struct_body = """
/* Struct = @stname@ */
static void decode_@name@_st(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_);
"""
template_decode_struct = """
@ -2558,14 +2456,10 @@ decode_@name@_st(tvb, pinfo, tree, offset, header, operation, stream_is_big_endi
"""
template_prototype_union_end = """
/* Union prototype declaration End */
"""
template_prototype_union_body = """
/* Union = @unname@ */
static void decode_@name@_un(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_, gboolean stream_is_big_endian _U_);
"""
template_decode_union = """
decode_@name@_un(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian);