aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipx.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-12-16 20:06:11 -0500
committerAnders Broman <a.broman58@gmail.com>2016-12-31 07:31:42 +0000
commitf4b0abc7296bbb431e64e31f85b24c29196c2ae4 (patch)
tree68394f5fdfa1987900f0b079d0ecfd34003e8a5a /epan/dissectors/packet-ipx.c
parent13964595ad09e5d1115f6c5cb604cded27f9f55d (diff)
Dissectors don't need a journey of self discovery.
They already know who they are when they register themselves. Saving the handle then to avoid finding it later. Not sure if this will increase unnecessary register_dissector functions (instead of using create_dissector_handle in proto_reg_handoff function) when other dissectors copy/paste, but it should make startup time a few microseconds better. Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43 Reviewed-on: https://code.wireshark.org/review/19481 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/packet-ipx.c')
-rw-r--r--epan/dissectors/packet-ipx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index 2d4e1df616..93f6083a0d 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -80,6 +80,8 @@ static gint ett_ipx = -1;
static dissector_table_t ipx_type_dissector_table;
static dissector_table_t ipx_socket_dissector_table;
static dissector_table_t spx_socket_dissector_table;
+static dissector_handle_t ipx_handle;
+static dissector_handle_t ipxsap_handle;
static int proto_spx = -1;
static int hf_spx_connection_control = -1;
@@ -1545,7 +1547,7 @@ proto_register_ipx(void)
"IPX", "ipx");
proto_register_field_array(proto_ipx, hf_ipx, array_length(hf_ipx));
- register_dissector("ipx", dissect_ipx, proto_ipx);
+ ipx_handle = register_dissector("ipx", dissect_ipx, proto_ipx);
proto_spx = proto_register_protocol("Sequenced Packet eXchange",
"SPX", "spx");
@@ -1565,7 +1567,7 @@ proto_register_ipx(void)
proto_sap = proto_register_protocol("Service Advertisement Protocol",
"IPX SAP", "ipxsap");
- register_dissector("ipxsap", dissect_ipxsap, proto_sap);
+ ipxsap_handle = register_dissector("ipxsap", dissect_ipxsap, proto_sap);
proto_register_field_array(proto_sap, hf_sap, array_length(hf_sap));
@@ -1590,12 +1592,11 @@ proto_register_ipx(void)
void
proto_reg_handoff_ipx(void)
{
- dissector_handle_t ipx_handle, spx_handle;
- dissector_handle_t ipxsap_handle, ipxrip_handle;
+ dissector_handle_t spx_handle;
+ dissector_handle_t ipxrip_handle;
dissector_handle_t serialization_handle, ipxmsg_handle;
capture_dissector_handle_t ipx_cap_handle;
- ipx_handle = find_dissector("ipx");
dissector_add_uint_with_preference("udp.port", UDP_PORT_IPX, ipx_handle);
dissector_add_uint("ethertype", ETHERTYPE_IPX, ipx_handle);
dissector_add_uint("chdlc.protocol", ETHERTYPE_IPX, ipx_handle);
@@ -1611,7 +1612,6 @@ proto_reg_handoff_ipx(void)
spx_handle = create_dissector_handle(dissect_spx, proto_spx);
dissector_add_uint("ipx.packet_type", IPX_PACKET_TYPE_SPX, spx_handle);
- ipxsap_handle = find_dissector("ipxsap");
dissector_add_uint("ipx.socket", IPX_SOCKET_SAP, ipxsap_handle);
ipxrip_handle = create_dissector_handle(dissect_ipxrip, proto_ipxrip);