ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 7348] When listing protocols available for "Decode As", pl

Date: Fri, 13 Jul 2012 05:33:15 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7348

--- Comment #6 from Michael Mann <mmann78@xxxxxxxxxxxx> 2012-07-13 05:33:14 PDT ---
(In reply to comment #5)
> It seems the sort bug is more extensive than I had thought.
> Running "tshark -d sortbug==true" will give the idea.
> And I didn't test all 261 of them, but ...
> sip.hdr is apparently valid, so it seems strange that "tshark -d
> sip.hdr==foo,bar" would yield this output (where <nothing> is added by me):
> tshark: Unknown protocol -- "bar"
> tshark: Valid protocols for layer type "sip.hdr" are:
> <nothing>

That's because a dissector table is registered for "sip.hdr", but no
subdissectors are registered to it.  Perhaps this is a hook for (proprietary)
plug-ins?  Or left for future expansion?


> Or that "tshark -d hnbap.ies==0,dups" would yield:
> tshark: Unknown protocol -- "dups"
> tshark: Valid protocols for layer type "hnbap.ies" are:
>         hnbap (UTRAN Iuh interface HNBAP signalling)
>         hnbap (UTRAN Iuh interface HNBAP signalling)
>         (19 more of these)

I don't know enough about the ASN.1 compiler, but you can blame the
auto-generated code for this architecture (cursory look says its overkill to
have all of the subdissesctors and not a simple switch statement)


The problem in general is that most of these structures are stored in
GHashTable structures and can't be "sorted" on insert. On "error", tshark just
walks the tables (using "for_each" functions) outputting the data (in the order
they were inserted).   The protocols for "Decode As" are a GSList, so you can
"sort on insert" (and I do have a patch that will sort by "filter name" instead
of "short name")
I don't think we really want to
a) switch structures from GHashTable to GSList so they can be (easily) sorted
b) Resort the table on each "for_each" function.  This would certainly affect
areas outside of printing out tables.

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