diff options
author | Michael Mann <mmann78@netscape.net> | 2016-10-05 16:33:54 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-10-13 02:51:18 +0000 |
commit | 2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c (patch) | |
tree | bd0a909e3d506ea2e61c446aa8a809b6f728af3b /plugins/unistim | |
parent | 4d8581d7e15fe4a80a53496b83a853271fc674b6 (diff) | |
download | wireshark-2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c.tar.gz |
Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".
More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.
Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/unistim')
-rw-r--r-- | plugins/unistim/packet-unistim.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index de74ec2837..1db183f081 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -29,7 +29,6 @@ #include <epan/packet.h> #include <epan/tap.h> #include <epan/expert.h> -#include <epan/prefs.h> #include <epan/dissectors/packet-rtp.h> #include <epan/dissectors/packet-rtcp.h> #include "packet-unistim.h" @@ -45,11 +44,6 @@ void proto_register_unistim(void); -/* Don't set this to 5000 until this dissector is made a heuristic one! - It collides (at least) with tapa. - static guint global_unistim_port = 5000; */ -static guint global_unistim_port = 0; - static unistim_info_t *uinfo; static int unistim_tap = -1; @@ -2692,8 +2686,6 @@ dissect_audio_phone(proto_tree *msg_tree, void proto_register_unistim(void){ - module_t* unistim_module; - static hf_register_info hf[] = { { &hf_unistim_seq_nu, { "RUDP Seq Num","unistim.num",FT_UINT32, @@ -4041,33 +4033,15 @@ proto_register_unistim(void){ expert_register_field_array(expert_unistim, ei, array_length(ei)); unistim_tap = register_tap("unistim"); - - unistim_module = prefs_register_protocol(proto_unistim, proto_reg_handoff_unistim); - - prefs_register_uint_preference(unistim_module, "udp.port", "UNISTIM UDP port", - "UNISTIM port (default 5000)", 10, &global_unistim_port); } void proto_reg_handoff_unistim(void) { - static gboolean initialized = FALSE; - static dissector_handle_t unistim_handle; - static guint unistim_port; - - if (!initialized) { - unistim_handle=create_dissector_handle(dissect_unistim,proto_unistim); - dissector_add_for_decode_as("udp.port", unistim_handle); - initialized=TRUE; - } else { - if (unistim_port != 0) { - dissector_delete_uint("udp.port",unistim_port,unistim_handle); - } - } - if (global_unistim_port != 0) { - dissector_add_uint("udp.port",global_unistim_port,unistim_handle); - } - unistim_port = global_unistim_port; + dissector_handle_t unistim_handle; + + unistim_handle=create_dissector_handle(dissect_unistim,proto_unistim); + dissector_add_for_decode_as_with_preference("udp.port", unistim_handle); } /* |