Wireshark-dev: Re: [Wireshark-dev] Modifying custom giop dissector

Date: Wed, 27 Nov 2013 07:59:17 -0500 (EST)
So are you generating the dissector and then manually modifying it with your "timecodeString" function?  If so, then I believe you want proto_tree_add_*_format_value
 
Using your example:
 
int s_octet4 = get_CDR_long(tvb,offset,stream_is_big_endian, boundary);
    proto_tree_add_int_format_value(tree,
hf_QuentinTimeline_CombinedTrackSegment_portTimecode, tvb, *offset-4, 4,
octet4, "%s", timecodeString(octet4));
 
 
-----Original Message-----
From: andy.ling <andy.ling@xxxxxxxxxxx>
To: wireshark-dev <wireshark-dev@xxxxxxxxxxxxx>
Sent: Wed, Nov 27, 2013 6:38 am
Subject: [Wireshark-dev] Modifying custom giop dissector

We have a custom CORBA dissector, the source code of which is generated 
from our IDL using omniorb

c:\Python27\omniorb\omniORB-4.1.6\bin\x86_win32\omniidl -p 
c:\wireshark-1.10.3\tools -b wireshark_be q_quentin.idl > packet-quentin.c

I am in the process of building this for wireshark 1.10.3. The last 
version it was built for was 1.6.5, so it's been a while.

Some of the CORBA return values are INTs, but have a "special" meaning. 
Previously I added my own function to convert these INTs to a string and 
made a simple change to the decode function. e.g.

    s_octet4 = get_CDR_long(tvb,offset,stream_is_big_endian, boundary);
    if (tree) {
 
proto_tree_add_text(tree,tvb,*offset-4,4,"CombinedTrackSegment_portTimecode 
= %s",timecodeString(s_octet4));
    }

Where timecodeString is my function.

Looking at the source code generated for 1.10.3 and everything has 
changed. It says something like

    proto_tree_add_int(tree, 
hf_QuentinTimeline_CombinedTrackSegment_portTimecode, tvb, *offset-4, 4, 
get_CDR_long(tvb,offset,stream_is_big_endian, boundary));

Adding my custom decoder isn't so straight forward. So the question. What 
is the best way of providing a custom function for some of the return 
results?

Thanks for any help

Andy Ling

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe