Wireshark mailing list archives
Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1)
From: Pascal Quantin <pascal.quantin () gmail com>
Date: Thu, 11 Oct 2012 08:35:51 +0200
2012/10/11 Mike Morrin <morrinmike () gmail com>
On 11/10/2012 06:26, Pascal Quantin wrote:Le 11/10/2012 05:10, mmann78 () netscape net a écrit :Pascal, Did you settle on the value, value+1? I think I have the exact same problem in bug 7728 (https://bugs.wireshark.org/**bugzilla/show_bug.cgi?id=7768<https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7768> )Hi, right now I'm displaying the value like what we would do with a value_string array: computed value and raw value in parenthesis. It is the best trade-off I could think to so far: oct = tvb_get_guint8(tvb, curr_offset) & 0x0f; proto_tree_add_uint_format_**value(tf_tree, hf_gsm_a_sm_tft_pkt_flt_id, tvb, curr_offset, 1, oct, "%d (%d)", oct+1, oct); Any other idea is welcome. Why not use an hf with BASE_CUSTOM and write a custom display functionto format the string?
Hi Mike, you are right I could have used it. Given the low complexity of my display and the fact that it is called twice in the code, I'm not sure it is worth it though. But I should think more often to the existence of BASE_CUSTOM. Regards, Pascal.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1) mmann78 (Oct 10)
- Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1) Pascal Quantin (Oct 10)
- Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1) Mike Morrin (Oct 10)
- Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1) Pascal Quantin (Oct 10)
- Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1) Mike Morrin (Oct 10)
- Re: r45266: proto_tree_add_uint_format_value(..., value, ..., value + 1) Pascal Quantin (Oct 10)