aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-uhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-uhd.c')
-rw-r--r--epan/dissectors/packet-uhd.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/epan/dissectors/packet-uhd.c b/epan/dissectors/packet-uhd.c
index 34abc96eef..d3f195ae93 100644
--- a/epan/dissectors/packet-uhd.c
+++ b/epan/dissectors/packet-uhd.c
@@ -31,12 +31,9 @@
#include "config.h"
#include <epan/packet.h>
-#include <epan/prefs.h>
void proto_register_uhd(void);
-static gint dissector_port_pref = 0;
-
/* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
#define USRP2_CTRL_ID_HUH_WHAT 0x20 /* ' ' */
@@ -268,37 +265,18 @@ proto_register_uhd(void)
&ett_uhd
};
- module_t *uhd_module;
-
proto_uhd = proto_register_protocol("UHD", "UHD", "uhd");
proto_register_field_array(proto_uhd, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
-
- uhd_module = prefs_register_protocol(proto_uhd, proto_reg_handoff_uhd);
- prefs_register_uint_preference(uhd_module,
- "dissector_port",
- "Dissector UDP port",
- "The UDP port used by this dissector",
- 10, &dissector_port_pref);
}
void
proto_reg_handoff_uhd(void)
{
- static gboolean uhd_prefs_initialized = FALSE;
- static dissector_handle_t uhd_handle;
- static gint dissector_port;
-
- if (!uhd_prefs_initialized) {
- uhd_handle = create_dissector_handle(dissect_uhd, proto_uhd);
- uhd_prefs_initialized = TRUE;
- } else {
- dissector_delete_uint("udp.port", dissector_port, uhd_handle);
- }
-
- dissector_port = dissector_port_pref;
+ dissector_handle_t uhd_handle;
- dissector_add_uint("udp.port", dissector_port, uhd_handle);
+ uhd_handle = create_dissector_handle(dissect_uhd, proto_uhd);
+ dissector_add_for_decode_as_with_preference("udp.port", uhd_handle);
}
/*