diff options
author | Michael Mann <mmann78@netscape.net> | 2016-10-07 16:25:01 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-10-08 02:44:53 +0000 |
commit | 268841f3e00b7cf0f16c81dd2b3b952172130b8b (patch) | |
tree | 359e01cf5eba83308760531888713fe0ff0bc10b /epan/dissectors/asn1/t38 | |
parent | 11d3224142c0531879fb8e415daf9639a4eace66 (diff) |
Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table. It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.
The tcp.port dissector table was used as the guinea pig. This will eventually be
expanded to other dissector tables as well (most notably UDP ports). Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.
Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference
Also added comments for TCP ports used that aren't IANA registered.
Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/asn1/t38')
-rw-r--r-- | epan/dissectors/asn1/t38/packet-t38-template.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/epan/dissectors/asn1/t38/packet-t38-template.c b/epan/dissectors/asn1/t38/packet-t38-template.c index 7f718414f9..51f41b93e9 100644 --- a/epan/dissectors/asn1/t38/packet-t38-template.c +++ b/epan/dissectors/asn1/t38/packet-t38-template.c @@ -727,7 +727,7 @@ proto_register_t38(void) t38_tap = register_tap("t38"); - t38_module = prefs_register_protocol(proto_t38, proto_reg_handoff_t38); + t38_module = prefs_register_protocol(proto_t38, NULL); prefs_register_bool_preference(t38_module, "use_pre_corrigendum_asn1_specification", "Use the Pre-Corrigendum ASN.1 specification", "Whether the T.38 dissector should decode using the Pre-Corrigendum T.38 " @@ -739,7 +739,6 @@ proto_register_t38(void) "be dissected as RTP packet or T.38 packet. If enabled there is a risk that T.38 UDPTL " "packets with sequence number higher than 32767 may be dissected as RTP.", &dissect_possible_rtpv2_packets_as_rtp); - prefs_register_obsolete_preference(t38_module, "tcp.port"); prefs_register_obsolete_preference(t38_module, "udp.port"); prefs_register_bool_preference(t38_module, "reassembly", "Reassemble T.38 PDUs over TPKT over TCP", @@ -764,16 +763,11 @@ proto_register_t38(void) void proto_reg_handoff_t38(void) { - static gboolean t38_prefs_initialized = FALSE; - - if (!t38_prefs_initialized) { - t38_udp_handle=create_dissector_handle(dissect_t38_udp, proto_t38); - t38_tcp_handle=create_dissector_handle(dissect_t38_tcp, proto_t38); - t38_tcp_pdu_handle=create_dissector_handle(dissect_t38_tcp_pdu, proto_t38); - rtp_handle = find_dissector_add_dependency("rtp", proto_t38); - t30_hdlc_handle = find_dissector_add_dependency("t30.hdlc""rtp", proto_t38); - data_handle = find_dissector("data"); - t38_prefs_initialized = TRUE; - } + t38_udp_handle=create_dissector_handle(dissect_t38_udp, proto_t38); + t38_tcp_handle=create_dissector_handle(dissect_t38_tcp, proto_t38); + t38_tcp_pdu_handle=create_dissector_handle(dissect_t38_tcp_pdu, proto_t38); + rtp_handle = find_dissector_add_dependency("rtp", proto_t38); + t30_hdlc_handle = find_dissector_add_dependency("t30.hdlc""rtp", proto_t38); + data_handle = find_dissector("data"); } |