aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tdmop.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-tdmop.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-tdmop.c')
-rw-r--r--epan/dissectors/packet-tdmop.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/epan/dissectors/packet-tdmop.c b/epan/dissectors/packet-tdmop.c
index 6bc470bfd5..3dadcb2a06 100644
--- a/epan/dissectors/packet-tdmop.c
+++ b/epan/dissectors/packet-tdmop.c
@@ -27,7 +27,6 @@
#include <epan/packet.h>
#include <epan/prefs.h>
-#define TDMOP_PORT 0
/*Using of ethertype 0x0808(assigned to Frame Realy ARP) was implemented in hardware, when ethertype was not assigned*/
#define ETHERTYPE_TDMOP 0
@@ -61,7 +60,6 @@ static dissector_handle_t lapd_handle = NULL;
static gint pref_tdmop_d_channel = 16;
static guint32 pref_tdmop_mask = 0xFFFFFFFFUL;
static guint32 pref_tdmop_ethertype = ETHERTYPE_TDMOP;
-static guint32 pref_tdmop_udpport = TDMOP_PORT;
#define TDMOP_FLAG_NO_DATA (1<<3)
#define TDMOP_FLAG_REMOTE_NO_DATA (1<<2)
@@ -315,11 +313,7 @@ void proto_register_tdmop(void)
&ett_tdmop,
&ett_tdmop_channel
};
- proto_tdmop = proto_register_protocol (
- "TDMoP protocol",
- "TDMoP",
- "tdmop"
- );
+ proto_tdmop = proto_register_protocol ("TDMoP protocol", "TDMoP", "tdmop");
proto_register_field_array(proto_tdmop, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
tdmop_module = prefs_register_protocol(proto_tdmop, proto_reg_handoff_tdmop);
@@ -335,10 +329,6 @@ void proto_register_tdmop(void)
"Ethertype for TDMoP stream(Usually 0808)",
"The ethertype assigned to TDMoP (without IP/UDP) stream",
16, &pref_tdmop_ethertype);
- prefs_register_uint_preference(tdmop_module, "udpport",
- "UDP Port of TDMoP stream(Usually 41000)",
- "The udp port assigned to TDMoP stream",
- 10, &pref_tdmop_udpport);
}
void proto_reg_handoff_tdmop(void)
@@ -346,19 +336,16 @@ void proto_reg_handoff_tdmop(void)
static dissector_handle_t tdmop_handle;
static gboolean init = FALSE;
static guint32 current_tdmop_ethertype;
- static guint32 current_tdmop_udpport;
if (!init)
{
tdmop_handle = create_dissector_handle(dissect_tdmop, proto_tdmop);
- if (pref_tdmop_udpport) {
- dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
- }
+ dissector_add_for_decode_as_with_preference("udp.port", tdmop_handle);
+
if (pref_tdmop_ethertype) {
dissector_add_uint("ethertype", pref_tdmop_ethertype, tdmop_handle);
}
lapd_handle = find_dissector_add_dependency("lapd-bitstream", proto_tdmop);
current_tdmop_ethertype = pref_tdmop_ethertype;
- current_tdmop_udpport = pref_tdmop_udpport;
init = TRUE;
}
if (current_tdmop_ethertype != pref_tdmop_ethertype)
@@ -369,14 +356,6 @@ void proto_reg_handoff_tdmop(void)
}
current_tdmop_ethertype = pref_tdmop_ethertype;
}
- if (current_tdmop_udpport != pref_tdmop_udpport)
- {
- dissector_delete_uint("udp.port", current_tdmop_udpport, tdmop_handle);
- if (pref_tdmop_udpport) {
- dissector_add_uint("udp.port", pref_tdmop_udpport, tdmop_handle);
- }
- current_tdmop_udpport = pref_tdmop_udpport;
- }
}
/*