aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/p1
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-06-30 20:41:45 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-01 14:26:20 +0000
commita062c802364fd83d43f934560149f2ddd1fee6a3 (patch)
treee5c9240b24a5b86c12b4a9481a2bd93e18b828f5 /epan/dissectors/asn1/p1
parentd4add25cb77773d9564dfc8f340ab5ce491a7d20 (diff)
ASN.1 dissectors - don't try to find yourself.
If an ASN.1 dissector is calling register_dissector for itself in its proto_register_xxx function and then calling find_dissector for itself in its proto_reg_handoff_xxx function then just create a static handle for that dissector and use the return value of register_dissector, so the find isn't necessary. Change-Id: I911bdadc2fb4259601c141b955e741a2369cc447 Reviewed-on: https://code.wireshark.org/review/16233 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1/p1')
-rw-r--r--epan/dissectors/asn1/p1/packet-p1-template.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/dissectors/asn1/p1/packet-p1-template.c b/epan/dissectors/asn1/p1/packet-p1-template.c
index 6c807d0ea0..f53b0d6024 100644
--- a/epan/dissectors/asn1/p1/packet-p1-template.c
+++ b/epan/dissectors/asn1/p1/packet-p1-template.c
@@ -84,6 +84,8 @@ static dissector_table_t p1_extension_dissector_table;
static dissector_table_t p1_extension_attribute_dissector_table;
static dissector_table_t p1_tokendata_dissector_table;
+static dissector_handle_t p1_handle;
+
#include "packet-p1-table.c" /* operation and error codes */
#define P1_ADDRESS_CTX "p1-address-ctx"
@@ -363,7 +365,7 @@ void proto_register_p1(void) {
/* Register protocol */
proto_p1 = proto_register_protocol(PNAME, PSNAME, PFNAME);
- register_dissector("p1", dissect_p1, proto_p1);
+ p1_handle = register_dissector("p1", dissect_p1, proto_p1);
proto_p3 = proto_register_protocol("X.411 Message Access Service", "P3", "p3");
@@ -393,8 +395,6 @@ void proto_register_p1(void) {
/*--- proto_reg_handoff_p1 --- */
void proto_reg_handoff_p1(void) {
- dissector_handle_t p1_handle;
-
#include "packet-p1-dis-tab.c"
/* APPLICATION CONTEXT */
@@ -402,8 +402,6 @@ void proto_reg_handoff_p1(void) {
oid_add_from_string("id-ac-mts-transfer","2.6.0.1.6");
/* ABSTRACT SYNTAXES */
-
- p1_handle = find_dissector("p1");
register_rtse_oid_dissector_handle("2.6.0.2.12", p1_handle, 0, "id-as-mta-rtse", TRUE);
register_rtse_oid_dissector_handle("2.6.0.2.7", p1_handle, 0, "id-as-mtse", FALSE);