aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/h225/packet-h225-template.c
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/h225/packet-h225-template.c
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/h225/packet-h225-template.c')
-rw-r--r--epan/dissectors/asn1/h225/packet-h225-template.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/asn1/h225/packet-h225-template.c b/epan/dissectors/asn1/h225/packet-h225-template.c
index 35924cbc59..dd12c6f2b7 100644
--- a/epan/dissectors/asn1/h225/packet-h225-template.c
+++ b/epan/dissectors/asn1/h225/packet-h225-template.c
@@ -94,6 +94,8 @@ static h225ras_call_t * find_h225ras_call(h225ras_call_info_key *h225ras_call_ke
static h225ras_call_t * new_h225ras_call(h225ras_call_info_key *h225ras_call_key, packet_info *pinfo, e_guid_t *guid, int category);
static h225ras_call_t * append_h225ras_call(h225ras_call_t *prev_call, packet_info *pinfo, e_guid_t *guid, int category);
+
+static dissector_handle_t h225ras_handle;
static dissector_handle_t data_handle;
/* Subdissector tables */
static dissector_table_t nsp_object_dissector_table;
@@ -900,7 +902,7 @@ void proto_register_h225(void) {
register_dissector(PFNAME, dissect_h225_H323UserInformation, proto_h225);
register_dissector("h323ui",dissect_h225_H323UserInformation, proto_h225);
- register_dissector("h225.ras", dissect_h225_h225_RasMessage, proto_h225);
+ h225ras_handle = register_dissector("h225.ras", dissect_h225_h225_RasMessage, proto_h225);
nsp_object_dissector_table = register_dissector_table("h225.nsp.object", "H.225 NonStandardParameter (object)", proto_h225, FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
nsp_h221_dissector_table = register_dissector_table("h225.nsp.h221", "H.225 NonStandardParameter (h221)", proto_h225, FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
@@ -930,11 +932,10 @@ void
proto_reg_handoff_h225(void)
{
static gboolean h225_prefs_initialized = FALSE;
- static dissector_handle_t h225ras_handle, q931_tpkt_handle;
+ static dissector_handle_t q931_tpkt_handle;
static guint saved_h225_tls_port;
if (!h225_prefs_initialized) {
- h225ras_handle=find_dissector("h225.ras");
dissector_add_uint("udp.port", UDP_PORT_RAS1, h225ras_handle);
dissector_add_uint("udp.port", UDP_PORT_RAS2, h225ras_handle);