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/packet-tds.c | |
parent | 11d3224142c0531879fb8e415daf9639a4eace66 (diff) | |
download | wireshark-268841f3e00b7cf0f16c81dd2b3b952172130b8b.tar.gz |
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/packet-tds.c')
-rw-r--r-- | epan/dissectors/packet-tds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index 3743d02dcc..c0937c8fe1 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -471,6 +471,8 @@ static const value_string tds_data_type_names[] = { void proto_reg_handoff_tds(void); void proto_register_tds(void); +#define TDS_PORT_RANGE "1433,2433" /* Not IANA registered */ + /************************ Message definitions ***********************/ /* Bulk Load BCP stream */ @@ -5637,9 +5639,7 @@ void proto_reg_handoff_tds(void) { /* Initial TDS ports: MS SQL default ports */ - dissector_add_uint("tcp.port", 1433, tds_tcp_handle); - dissector_add_uint("tcp.port", 2433, tds_tcp_handle); - + dissector_add_uint_range_with_preference("tcp.port", TDS_PORT_RANGE, tds_tcp_handle); heur_dissector_add("tcp", dissect_tds_tcp_heur, "Tabular Data Stream over TCP", "tds_tcp", proto_tds, HEURISTIC_ENABLE); ntlmssp_handle = find_dissector_add_dependency("ntlmssp", proto_tds); |