From bf0f5a982bc0666b6fa8d70c8d64cb1f07ab12ad Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 13 Jan 2016 02:16:04 +0100 Subject: Use result of register_dissector Assign result of `register_dissector(..., func, proto)` to FOO_handle and remove `FOO_handle = create_dissector_handle(func, proto)`. Found by looking for files named packet-FOO.c having the above create_dissector_handle pattern. Some files (with different dissect routines for the two functions) remain unchanged. Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90 Reviewed-on: https://code.wireshark.org/review/13247 Reviewed-by: Peter Wu Petri-Dish: Peter Wu Reviewed-by: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-dhcpv6.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-dhcpv6.c') diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 65349a99d4..9f740414b9 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -226,6 +226,8 @@ static expert_field ei_dhcpv6_bulk_leasequery_bad_query_type = EI_INIT; static expert_field ei_dhcpv6_bulk_leasequery_no_lq_relay_data = EI_INIT; static expert_field ei_dhcpv6_bulk_leasequery_bad_msg_type = EI_INIT; +static dissector_handle_t dhcpv6_handle; + #define UDP_PORT_DHCPV6_DOWNSTREAM 546 #define UDP_PORT_DHCPV6_UPSTREAM 547 @@ -2398,7 +2400,7 @@ proto_register_dhcpv6(void) expert_register_field_array(expert_dhcpv6_bulk_leasequery, ei_bulk_leasequery, array_length(ei_bulk_leasequery)); /* Allow other dissectors to find this one by name. */ - register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); + dhcpv6_handle = register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); dhcpv6_module = prefs_register_protocol(proto_dhcpv6, NULL); prefs_register_bool_preference(dhcpv6_module, "cablelabs_interface_id", @@ -2416,9 +2418,8 @@ proto_register_dhcpv6(void) void proto_reg_handoff_dhcpv6(void) { - dissector_handle_t dhcpv6_handle, dhcpv6_bulkquery_handle; + dissector_handle_t dhcpv6_bulkquery_handle; - dhcpv6_handle = create_dissector_handle(dissect_dhcpv6_stream, proto_dhcpv6); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_DOWNSTREAM, dhcpv6_handle); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_handle); -- cgit v1.2.1