From f4bcbeb9f26874ab763e78056638541a5b371cde Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Mon, 5 Aug 2013 19:09:44 +0000 Subject: Keep result of [new_]register_dissector in some dissectors. [2 of x] (don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159 --- epan/dissectors/packet-nwmtp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'epan/dissectors/packet-nwmtp.c') diff --git a/epan/dissectors/packet-nwmtp.c b/epan/dissectors/packet-nwmtp.c index d0b6e59c3b..5e231d0ece 100644 --- a/epan/dissectors/packet-nwmtp.c +++ b/epan/dissectors/packet-nwmtp.c @@ -43,6 +43,8 @@ static int hf_nwmtp_data_length = -1; /* subtree pointer */ static gint ett_mwmtp = -1; +static dissector_handle_t nwmtp_handle; + static const value_string nwmtp_transport_type_vals[] = { { 2, "UDP" }, { 3, "TCP" }, @@ -155,14 +157,12 @@ void proto_register_mwmtp(void) proto_register_field_array(proto_nwmtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("nw_mtp", dissect_nwmtp, proto_nwmtp); + + nwmtp_handle = register_dissector("nw_mtp", dissect_nwmtp, proto_nwmtp); } void proto_reg_handoff_nwmtp(void) { - dissector_handle_t nwmtp_handle; - - nwmtp_handle = create_dissector_handle(dissect_nwmtp, proto_nwmtp); /* For decode as */ dissector_add_handle("udp.port", nwmtp_handle); mtp_handle = find_dissector("mtp3"); -- cgit v1.2.1