aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mausb.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2014-08-25 22:39:59 -0400
committerBill Meier <wmeier@newsguy.com>2014-08-27 15:49:40 +0000
commitf4b135c147497f168bafa77910fb819166e8dd81 (patch)
treeae2eeb49caf9a46aa46f28994e5a419a18f9bd44 /epan/dissectors/packet-mausb.c
parentcac381b3dec391ab59c6dd3698b45e52dd301806 (diff)
packet-mausb.c: proto-reg-handoff() fixes
- proto_reg_handoff...(): Fix handling of tcp port pref change; Rename 'gPORT_PREF' to 'mausb_tcp_port_pref'; Do 'dissector_add_uint("llc.mausb_pid",..)' only once; Change-Id: Ic4498560f61d0ce95f8109c3a1bb3c407221269b Reviewed-on: https://code.wireshark.org/review/3854 Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'epan/dissectors/packet-mausb.c')
-rw-r--r--epan/dissectors/packet-mausb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-mausb.c b/epan/dissectors/packet-mausb.c
index f79c394ea4..e7f1462cca 100644
--- a/epan/dissectors/packet-mausb.c
+++ b/epan/dissectors/packet-mausb.c
@@ -630,7 +630,7 @@ static guint mausb_get_pkt_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset
}
/* Global Port Preference */
-static unsigned int gPORT_PREF = 0;
+static unsigned int mausb_tcp_port_pref = 0;
/* Initialize the subtree pointers */
static gint ett_mausb = -1;
@@ -1870,7 +1870,7 @@ proto_register_mausb(void)
/* Register TCP port preference */
prefs_register_uint_preference(mausb_module, "tcp.port", "MAUSB TCP Port",
"Set the port for Media Agnostic Packets",
- 10, &gPORT_PREF);
+ 10, &mausb_tcp_port_pref);
}
@@ -1879,9 +1879,10 @@ proto_reg_handoff_mausb(void)
{
static gboolean initialized = FALSE;
static dissector_handle_t mausb_tcp_handle;
- static dissector_handle_t mausb_snap_handle;
+ static guint saved_mausb_tcp_port_pref;
if (!initialized) {
+ dissector_handle_t mausb_snap_handle;
/* only initialize once */
mausb_tcp_handle = new_create_dissector_handle(dissect_mausb,
proto_mausb);
@@ -1889,15 +1890,16 @@ proto_reg_handoff_mausb(void)
mausb_snap_handle = new_create_dissector_handle(dissect_mausb_pkt,
proto_mausb);
+ dissector_add_uint("llc.mausb_pid", PID_MAUSB, mausb_snap_handle);
initialized = TRUE;
} else {
/* if we have already been initialized */
- dissector_delete_uint("tcp.port", gPORT_PREF, mausb_tcp_handle);
+ dissector_delete_uint("tcp.port", saved_mausb_tcp_port_pref, mausb_tcp_handle);
}
- dissector_add_uint("llc.mausb_pid", PID_MAUSB, mausb_snap_handle);
- dissector_add_uint("tcp.port", gPORT_PREF, mausb_tcp_handle);
+ saved_mausb_tcp_port_pref = mausb_tcp_port_pref;
+ dissector_add_uint("tcp.port", mausb_tcp_port_pref, mausb_tcp_handle);
}
void