From c.David via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6527
[obnox/wireshark/wip.git] / tools / wireshark_gen.py
index c3844aed6336acef2d1cacdfa022811eb72f8786..e5ed281aac0e4070769510f76aadde8ffa5c226c 100755 (executable)
@@ -1720,13 +1720,13 @@ void proto_register_giop_@dissector_name@(void) {
 
    /* setup list of header fields */
 
-#if 0
    static hf_register_info hf[] = {
+        /* field that indicates the currently ongoing request/reply exchange */
+               {&hf_operationrequest, {"Request_Operation","@protocol_name@.Request_Operation",FT_STRING,BASE_NONE,NULL,0x0,NULL,HFILL}},
 
       /* no fields yet */
 
    };
-#endif
 
    /* setup protocol subtree array */
 
@@ -1738,9 +1738,8 @@ void proto_register_giop_@dissector_name@(void) {
 
    proto_@dissector_name@ = proto_register_protocol(\"@description@\" , \"@protocol_name@\", \"giop-@dissector_name@\" );
 
-#if 0
    proto_register_field_array(proto_@dissector_name@, hf, array_length(hf));
-#endif
+
    proto_register_subtree_array(ett,array_length(ett));
 
 }
@@ -1752,6 +1751,7 @@ void proto_register_giop_@dissector_name@(void) {
     template_op_delegate_code = """\
 if (strcmp(operation, @sname@_op) == 0
     && (!idlname || strcmp(idlname, \"@interface@\") == 0)) {
+   process_RequestOperation();  /* fill-up Request_Operation field & info column */
    tree = start_dissecting(tvb, pinfo, ptree, offset);
    decode_@sname@(tvb, pinfo, tree, offset, header, operation, stream_is_big_endian);
    return TRUE;
@@ -2054,6 +2054,8 @@ for (i_@aname@=0; i_@aname@ < @aval@; i_@aname@++) {
  * Copyright 1999 - 2006 Gerald Combs
  */
 
+static int hf_operationrequest = -1;/* Request_Operation field */
+
 """
 
 
@@ -2145,6 +2147,11 @@ static gboolean dissect_@dissname@(tvbuff_t *tvb, packet_info *pinfo, proto_tree
 
     gboolean stream_is_big_endian;                        /* big endianess */
     proto_tree *tree _U_;
+#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 */ \\
+   };
 
     stream_is_big_endian = is_big_endian(header);         /* get endianess  */