In tshark 4.6 json output, how do you set device addresses to hex as in previous versions?

asked 2025-11-05 17:09:29 +0000

bpitch gravatar image

tshark 4.4 json output has the device addresses in hex. Can only get decimal representation in tshark 4.6. Is this a bug or intentional?

edit retag flag offensive close merge delete

Comments

Which protocol and field? Please update the question with a sample of the output.

Chuckc gravatar imageChuckc ( 2025-11-05 18:41:48 +0000 )edit

See attached screen-shot that shows the issue. The same pcapng file was run with tshark4.4 and tshark4.6. using the command "tshark -r diff_example.pcapng -T ek". The screenshot shows wpan - but the issue is also with BREDR and BLE.

bpitch gravatar imagebpitch ( 2025-11-05 22:54:09 +0000 )edit

Not able to upload a file - section from output on the above command -
tshark4.4: "wpan_wpan_dst_pan":"0x158a"
tshark4.6: "wpan_wpan_dst_pan":"5514"

bpitch gravatar imagebpitch ( 2025-11-05 22:57:40 +0000 )edit

Defined as hex (packet-ieee802154.c):

        { &hf_ieee802154_dst_panID,
        { "Destination PAN", "wpan.dst_pan", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

Changes to printing in 14709: tshark: Custom fields for -e based on field expressions seem to ignore base.
(epan/print.c):

                    str = fvalue_to_string_repr(NULL, fvals->pdata[j], FTREPR_DISPLAY, BASE_NONE);
                    format_field_values(fields, GUINT_TO_POINTER(i), str);


I added a comment to the merge request to see if these are related.

Chuckc gravatar imageChuckc ( 2025-11-06 16:20:48 +0000 )edit