Wireshark-bugs: [Wireshark-bugs] [Bug 4603] New: Custom data column as String in addition to HEX

Date: Sun, 21 Mar 2010 10:22:18 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4603

           Summary: Custom data column as String in addition to HEX
           Product: Wireshark
           Version: 1.2.2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: patrik0carlsson@xxxxxxxxx


Build Information:
wireshark 1.2.2

Copyright 1998-2009 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.18.3, with GLib 2.22.2, with libpcap 1.0.0, with libz
1.2.3.3, with POSIX capabilities (Linux), with libpcre 7.8, with SMI 0.4.8,
with
c-ares 1.6.0, with Lua 5.1, with GnuTLS 2.8.3, with Gcrypt 1.4.4, with MIT
Kerberos, with GeoIP, with PortAudio V19-devel (built Jun 20 2009 13:28:51),
without AirPcap.

Running on Linux 2.6.31-20-generic-pae, with libpcap version 1.0.0, GnuTLS
2.8.3, Gcrypt 1.4.4.

Built using gcc 4.4.1.

--
The packet data is presented as HEX and ASCII in the hex-view when selecting
each packet, but for custom columns it is only possible to show data.data hex
content.

Stig Bjørlykke suggested that this could be easily pached to data.text and
similar. 

It took me 4 lines of code to cast the available data structure to the built in
string type and make it available as data.text for custom columns
which is very useful for simple text or XML based protocols.

Please review this addition and consider to add it to trunk. (with
documentation)

This can of course be extended to data.text.utf-8, data.base64 etc. but I
believe that would be better done as a generic option to convert all types of 
payloads like suggested in bug 1084.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1084

Basically I copied hf_data_data definition, the proto_tree_add_item() call and
added a line in the hf_register_info struct in teh packet-data.c file.

~/wireshark-1.2.2/epan/dissectors$ diff packet-data.c packet-data.bak
39a40
> static int hf_data_text = -1;
58a60
> 			proto_tree_add_item(data_tree, hf_data_text, tvb, 0, bytes, FALSE);
71a74,75
> 		{ &hf_data_text,
> 		  { "Text", "data.text", FT_STRING, BASE_NONE, NULL, 0x0, "Text", HFILL } },


  Best regards
     Patrik Carlsson

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.