aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mtp3.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-16 01:10:05 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-11-16 01:10:05 +0000
commitea73d4a55cf10850c61ed35d58fd9c9a191023f3 (patch)
tree87fd46511932572dfcec12f2e1630ea289e9a512 /epan/dissectors/packet-mtp3.c
parent09dc9a3d0a029fc669e09b3d2ff468b07b9b0c7b (diff)
Avoid calling find_dissector(), cache result of [new_]register_dissector()
svn path=/trunk/; revision=53353
Diffstat (limited to 'epan/dissectors/packet-mtp3.c')
-rw-r--r--epan/dissectors/packet-mtp3.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index e835b73590..276917b315 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -55,6 +55,8 @@ static int proto_mtp3 = -1;
static int mtp3_tap = -1;
+static dissector_handle_t mtp3_handle;
+
static module_t *mtp3_module;
static int hf_mtp3_service_indicator = -1;
@@ -857,7 +859,7 @@ proto_register_mtp3(void)
/* Register the protocol name and description */
proto_mtp3 = proto_register_protocol("Message Transfer Part Level 3",
"MTP3", "mtp3");
- register_dissector("mtp3", dissect_mtp3, proto_mtp3);
+ mtp3_handle = register_dissector("mtp3", dissect_mtp3, proto_mtp3);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_mtp3, hf, array_length(hf));
@@ -912,9 +914,6 @@ proto_register_mtp3(void)
void
proto_reg_handoff_mtp3(void)
{
- dissector_handle_t mtp3_handle;
-
- mtp3_handle = find_dissector("mtp3");
dissector_add_uint("wtap_encap", WTAP_ENCAP_MTP3, mtp3_handle);
dissector_add_string("tali.opcode", "mtp3", mtp3_handle);