aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cisco-wids.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-cisco-wids.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-cisco-wids.c')
-rw-r--r--epan/dissectors/packet-cisco-wids.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c
index fd26ecf606..7199c05727 100644
--- a/epan/dissectors/packet-cisco-wids.c
+++ b/epan/dissectors/packet-cisco-wids.c
@@ -50,11 +50,8 @@
#include <epan/packet.h>
#include <epan/exceptions.h>
#include <epan/expert.h>
-#include <epan/prefs.h>
#include <epan/show_exception.h>
-static guint global_udp_port = 0;
-
static int proto_cwids = -1;
static int hf_cwids_version = -1;
static int hf_cwids_timestamp = -1;
@@ -179,7 +176,6 @@ proto_register_cwids(void)
{ &ie_ieee80211_subpacket, { "cwids.ieee80211_malformed", PI_MALFORMED, PI_ERROR, "Malformed or short IEEE80211 subpacket", EXPFILL }},
};
- module_t *cwids_module;
expert_module_t* expert_cwids;
proto_cwids = proto_register_protocol("Cisco Wireless IDS Captures", "CWIDS", "cwids");
@@ -187,36 +183,16 @@ proto_register_cwids(void)
proto_register_subtree_array(ett, array_length(ett));
expert_cwids = expert_register_protocol(proto_cwids);
expert_register_field_array(expert_cwids, ei, array_length(ei));
-
- cwids_module = prefs_register_protocol(proto_cwids, proto_reg_handoff_cwids);
- prefs_register_uint_preference(cwids_module, "udp.port",
- "CWIDS port",
- "Set the destination UDP port Cisco wireless IDS messages",
- 10, &global_udp_port);
-
}
void
proto_reg_handoff_cwids(void)
{
- static dissector_handle_t cwids_handle;
- static guint saved_udp_port;
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- cwids_handle = create_dissector_handle(dissect_cwids, proto_cwids);
- dissector_add_for_decode_as("udp.port", cwids_handle);
- ieee80211_radio_handle = find_dissector_add_dependency("wlan_noqos_radio", proto_cwids);
- initialized = TRUE;
- } else {
- if (saved_udp_port != 0) {
- dissector_delete_uint("udp.port", saved_udp_port, cwids_handle);
- }
- }
- if (global_udp_port != 0) {
- dissector_add_uint("udp.port", global_udp_port, cwids_handle);
- }
- saved_udp_port = global_udp_port;
+ dissector_handle_t cwids_handle;
+
+ cwids_handle = create_dissector_handle(dissect_cwids, proto_cwids);
+ dissector_add_for_decode_as_with_preference("udp.port", cwids_handle);
+ ieee80211_radio_handle = find_dissector_add_dependency("wlan_noqos_radio", proto_cwids);
}
/*