aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-aruba-erm.c
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 /epan/dissectors/packet-aruba-erm.c
parent4d8581d7e15fe4a80a53496b83a853271fc674b6 (diff)
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 'epan/dissectors/packet-aruba-erm.c')
-rw-r--r--epan/dissectors/packet-aruba-erm.c49
1 files changed, 14 insertions, 35 deletions
diff --git a/epan/dissectors/packet-aruba-erm.c b/epan/dissectors/packet-aruba-erm.c
index b58b8adcb2..d751838b40 100644
--- a/epan/dissectors/packet-aruba-erm.c
+++ b/epan/dissectors/packet-aruba-erm.c
@@ -122,7 +122,6 @@ void proto_register_aruba_erm(void);
void proto_reg_handoff_aruba_erm(void);
void proto_reg_handoff_aruba_erm_radio(void);
-static range_t *global_aruba_erm_port_range;
#if 0
static gint aruba_erm_type = 0;
#endif
@@ -435,15 +434,8 @@ proto_register_aruba_erm(void)
proto_aruba_erm_type4 = proto_register_protocol("Aruba Networks encapsulated remote mirroring - PPI (Type 4)", "ARUBA ERM PPI (Type 4)", "aruba_erm_type4");
proto_aruba_erm_type5 = proto_register_protocol("Aruba Networks encapsulated remote mirroring - PEEK (Type 5)", "ARUBA ERM PEEK-NG (type 5)", "aruba_erm_type5");
- range_convert_str (&global_aruba_erm_port_range, "0", MAX_UDP_PORT);
+ aruba_erm_module = prefs_register_protocol(proto_aruba_erm, NULL);
- aruba_erm_module = prefs_register_protocol(proto_aruba_erm, proto_reg_handoff_aruba_erm);
-
- prefs_register_range_preference(aruba_erm_module, "udp.ports", "ARUBA_ERM UDP Port numbers",
- "Set the UDP port numbers (typically the range 5555 to 5560) used for Aruba Networks"
- " encapsulated remote mirroring frames;\n"
- "0 (default) means that the ARUBA_ERM dissector is not active\n",
- &global_aruba_erm_port_range, MAX_UDP_PORT);
#if 0
/* Obso...*/
prefs_register_enum_preference(aruba_erm_module, "type.captured",
@@ -470,32 +462,19 @@ proto_register_aruba_erm(void)
void
proto_reg_handoff_aruba_erm(void)
{
- static range_t *aruba_erm_port_range;
- static range_t *aruba_erm_radio_port_range;
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- wlan_radio_handle = find_dissector_add_dependency("wlan_radio", proto_aruba_erm);
- wlan_withfcs_handle = find_dissector_add_dependency("wlan_withfcs", proto_aruba_erm);
- ppi_handle = find_dissector_add_dependency("ppi", proto_aruba_erm);
- peek_handle = find_dissector_add_dependency("peekremote", proto_aruba_erm);
- aruba_erm_handle = create_dissector_handle(dissect_aruba_erm, proto_aruba_erm);
- aruba_erm_handle_type0 = create_dissector_handle(dissect_aruba_erm_type0, proto_aruba_erm_type0);
- aruba_erm_handle_type1 = create_dissector_handle(dissect_aruba_erm_type1, proto_aruba_erm_type1);
- aruba_erm_handle_type2 = create_dissector_handle(dissect_aruba_erm_type2, proto_aruba_erm_type2);
- aruba_erm_handle_type3 = create_dissector_handle(dissect_aruba_erm_type3, proto_aruba_erm_type3);
- aruba_erm_handle_type4 = create_dissector_handle(dissect_aruba_erm_type4, proto_aruba_erm_type4);
- aruba_erm_handle_type5 = create_dissector_handle(dissect_aruba_erm_type5, proto_aruba_erm_type5);
- initialized = TRUE;
- } else {
- dissector_delete_uint_range("udp.port", aruba_erm_port_range, aruba_erm_handle);
- g_free(aruba_erm_port_range);
- g_free(aruba_erm_radio_port_range);
- }
-
- aruba_erm_port_range = range_copy(global_aruba_erm_port_range);
-
- dissector_add_uint_range("udp.port", aruba_erm_port_range, aruba_erm_handle);
+ wlan_radio_handle = find_dissector_add_dependency("wlan_radio", proto_aruba_erm);
+ wlan_withfcs_handle = find_dissector_add_dependency("wlan_withfcs", proto_aruba_erm);
+ ppi_handle = find_dissector_add_dependency("ppi", proto_aruba_erm);
+ peek_handle = find_dissector_add_dependency("peekremote", proto_aruba_erm);
+ aruba_erm_handle = create_dissector_handle(dissect_aruba_erm, proto_aruba_erm);
+ aruba_erm_handle_type0 = create_dissector_handle(dissect_aruba_erm_type0, proto_aruba_erm_type0);
+ aruba_erm_handle_type1 = create_dissector_handle(dissect_aruba_erm_type1, proto_aruba_erm_type1);
+ aruba_erm_handle_type2 = create_dissector_handle(dissect_aruba_erm_type2, proto_aruba_erm_type2);
+ aruba_erm_handle_type3 = create_dissector_handle(dissect_aruba_erm_type3, proto_aruba_erm_type3);
+ aruba_erm_handle_type4 = create_dissector_handle(dissect_aruba_erm_type4, proto_aruba_erm_type4);
+ aruba_erm_handle_type5 = create_dissector_handle(dissect_aruba_erm_type5, proto_aruba_erm_type5);
+
+ dissector_add_uint_range_with_preference("udp.port", "", aruba_erm_handle);
dissector_add_for_decode_as("aruba_erm.type", aruba_erm_handle_type0);
dissector_add_for_decode_as("aruba_erm.type", aruba_erm_handle_type1);
dissector_add_for_decode_as("aruba_erm.type", aruba_erm_handle_type2);