summaryrefslogtreecommitdiff
path: root/plugins/wimaxmacphy
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-10-05 16:33:54 -0400
committerMichael Mann <mmann78@netscape.net>2016-10-13 02:51:18 +0000
commit2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c (patch)
treebd0a909e3d506ea2e61c446aa8a809b6f728af3b /plugins/wimaxmacphy
parent4d8581d7e15fe4a80a53496b83a853271fc674b6 (diff)
downloadwireshark-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/wimaxmacphy')
-rw-r--r--plugins/wimaxmacphy/packet-wimaxmacphy.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/plugins/wimaxmacphy/packet-wimaxmacphy.c b/plugins/wimaxmacphy/packet-wimaxmacphy.c
index cc7e80c24b..d872453bee 100644
--- a/plugins/wimaxmacphy/packet-wimaxmacphy.c
+++ b/plugins/wimaxmacphy/packet-wimaxmacphy.c
@@ -25,7 +25,6 @@
#include "config.h"
#include <epan/packet.h>
-#include <epan/prefs.h>
#include <epan/expert.h>
/* IF PROTO exposes code to other dissectors, then it must be exported
@@ -303,10 +302,6 @@ static gint ett_wimaxmacphy_ul_sub_burst_sub_allocation_specific = -1;
static expert_field ei_wimaxmacphy_unknown = EI_INIT;
-/* Preferences */
-static guint wimaxmacphy_udp_port = 0;
-
-
/* PHY SAP message header size */
#define WIMAXMACPHY_HEADER_SIZE 2
@@ -2459,8 +2454,6 @@ dissect_wimaxmacphy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
void
proto_register_wimaxmacphy(void)
{
- module_t *wimaxmacphy_module;
-
static hf_register_info hf[] = {
{
&hf_wimaxmacphy_hdr_phy_entity_id,
@@ -5441,43 +5434,15 @@ proto_register_wimaxmacphy(void)
proto_register_subtree_array(ett, array_length(ett));
expert_wimaxmacphy = expert_register_protocol(proto_wimaxmacphy);
expert_register_field_array(expert_wimaxmacphy, ei, array_length(ei));
-
- /* Register preferences module (See Section 2.6 for more on
- * preferences) */
- wimaxmacphy_module = prefs_register_protocol(
- proto_wimaxmacphy,
- proto_reg_handoff_wimaxmacphy);
-
- prefs_register_uint_preference(
- wimaxmacphy_module, "udp.port",
- "WiMAX MAX PHY UDP Port",
- "WiMAX MAX PHY UDP port",
- 10,
- &wimaxmacphy_udp_port);
-
}
void
proto_reg_handoff_wimaxmacphy(void)
{
- static guint old_wimaxmacphy_udp_port = 0;
- static gboolean inited = FALSE;
- static dissector_handle_t wimaxmacphy_handle;
-
- if (!inited) {
- wimaxmacphy_handle = create_dissector_handle(dissect_wimaxmacphy, proto_wimaxmacphy);
- dissector_add_for_decode_as("udp.port", wimaxmacphy_handle);
- inited = TRUE;
- }
+ dissector_handle_t wimaxmacphy_handle;
- /* Register UDP port for dissection */
- if (old_wimaxmacphy_udp_port != 0 && old_wimaxmacphy_udp_port != wimaxmacphy_udp_port) {
- dissector_delete_uint("udp.port", old_wimaxmacphy_udp_port, wimaxmacphy_handle);
- }
-
- if (wimaxmacphy_udp_port != 0 && old_wimaxmacphy_udp_port != wimaxmacphy_udp_port) {
- dissector_add_uint("udp.port", wimaxmacphy_udp_port, wimaxmacphy_handle);
- }
+ wimaxmacphy_handle = create_dissector_handle(dissect_wimaxmacphy, proto_wimaxmacphy);
+ dissector_add_for_decode_as_with_preference("udp.port", wimaxmacphy_handle);
}
/*