aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/h245
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/h245
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/h245')
-rw-r--r--epan/dissectors/asn1/h245/packet-h245-template.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/epan/dissectors/asn1/h245/packet-h245-template.c b/epan/dissectors/asn1/h245/packet-h245-template.c
index 426625fbea..ab42a0c988 100644
--- a/epan/dissectors/asn1/h245/packet-h245-template.c
+++ b/epan/dissectors/asn1/h245/packet-h245-template.c
@@ -62,6 +62,7 @@ static dissector_table_t nsp_object_dissector_table;
static dissector_table_t nsp_h221_dissector_table;
static dissector_table_t gef_name_dissector_table;
static dissector_table_t gef_content_dissector_table;
+static dissector_handle_t h245_handle;
static dissector_handle_t nsp_handle;
static dissector_handle_t data_handle;
static dissector_handle_t MultimediaSystemControlMessage_handle;
@@ -538,8 +539,8 @@ void proto_register_h245(void) {
"Show h245 info in reversed order",
"Whether the dissector should print items of h245 Info column in reversed order",
&info_col_fmt_prepend);
- register_dissector("h245dg", dissect_h245_h245, proto_h245);
- register_dissector("h245", dissect_h245, proto_h245);
+ MultimediaSystemControlMessage_handle = register_dissector("h245dg", dissect_h245_h245, proto_h245);
+ h245_handle = register_dissector("h245", dissect_h245, proto_h245);
nsp_object_dissector_table = register_dissector_table("h245.nsp.object", "H.245 NonStandardParameter (object)", proto_h245, FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
nsp_h221_dissector_table = register_dissector_table("h245.nsp.h221", "H.245 NonStandardParameter (h221)", proto_h245, FT_UINT32, BASE_HEX, DISSECTOR_TABLE_ALLOW_DUPLICATE);
@@ -603,17 +604,13 @@ void proto_register_h245(void) {
/*--- proto_reg_handoff_h245 ---------------------------------------*/
void proto_reg_handoff_h245(void) {
- dissector_handle_t h245_handle;
-
rtcp_handle = find_dissector("rtcp");
data_handle = find_dissector("data");
h263_handle = find_dissector("h263data");
amr_handle = find_dissector("amr_if2_nb");
- h245_handle = find_dissector("h245");
dissector_add_for_decode_as("tcp.port", h245_handle);
- MultimediaSystemControlMessage_handle = find_dissector("h245dg");
dissector_add_for_decode_as("udp.port", MultimediaSystemControlMessage_handle);
}