diff options
Diffstat (limited to 'epan')
37 files changed, 146 insertions, 168 deletions
diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c index 490b0298e3..08fae761c9 100644 --- a/epan/dissectors/packet-arp.c +++ b/epan/dissectors/packet-arp.c @@ -91,8 +91,9 @@ static gint ett_arp_duplicate_address = -1; static expert_field ei_seq_arp_dup_ip = EI_INIT; static expert_field ei_seq_arp_storm = EI_INIT; -static dissector_handle_t atmarp_handle; +static dissector_handle_t arp_handle; +static dissector_handle_t atmarp_handle; static dissector_handle_t ax25arp_handle; /* Used for determining if frequency of ARP requests constitute a storm */ @@ -1993,7 +1994,7 @@ proto_register_arp(void) atmarp_handle = create_dissector_handle(dissect_atmarp, proto_arp); ax25arp_handle = create_dissector_handle(dissect_ax25arp, proto_arp); - register_dissector( "arp" , dissect_arp, proto_arp ); + arp_handle = register_dissector( "arp" , dissect_arp, proto_arp ); /* Preferences */ arp_module = prefs_register_protocol(proto_arp, NULL); @@ -2026,10 +2027,6 @@ proto_register_arp(void) void proto_reg_handoff_arp(void) { - dissector_handle_t arp_handle; - - arp_handle = find_dissector("arp"); - dissector_add_uint("ethertype", ETHERTYPE_ARP, arp_handle); dissector_add_uint("ethertype", ETHERTYPE_REVARP, arp_handle); dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_ARP_1051, arp_handle); diff --git a/epan/dissectors/packet-ax25-kiss.c b/epan/dissectors/packet-ax25-kiss.c index 8038bcd1e1..50b97fcce5 100644 --- a/epan/dissectors/packet-ax25-kiss.c +++ b/epan/dissectors/packet-ax25-kiss.c @@ -131,10 +131,6 @@ void proto_register_ax25_kiss(void); void proto_reg_handoff_ax25_kiss(void); -/* Dissector handles - all the possibles are listed */ -static dissector_handle_t ax25_handle; - - /* Initialize the protocol and registered fields */ static int proto_ax25_kiss = -1; @@ -150,6 +146,11 @@ static int hf_ax25_kiss_sethardware = -1; /* Initialize the subtree pointers */ static gint ett_ax25_kiss = -1; +static dissector_handle_t kiss_handle; + +/* Dissector handles - all the possibles are listed */ +static dissector_handle_t ax25_handle; + static const value_string kiss_frame_types[] = { { KISS_DATA_FRAME, "Data frame" }, { KISS_TXDELAY, "Tx Delay" }, @@ -368,7 +369,7 @@ proto_register_ax25_kiss(void) proto_ax25_kiss = proto_register_protocol( "AX.25 KISS", "AX.25 KISS", "ax25_kiss" ); /* Register the dissector */ - register_dissector( "ax25_kiss", dissect_ax25_kiss, proto_ax25_kiss ); + kiss_handle = register_dissector( "ax25_kiss", dissect_ax25_kiss, proto_ax25_kiss ); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array( proto_ax25_kiss, hf, array_length( hf ) ); @@ -378,9 +379,6 @@ proto_register_ax25_kiss(void) void proto_reg_handoff_ax25_kiss(void) { - dissector_handle_t kiss_handle; - - kiss_handle = create_dissector_handle( dissect_ax25_kiss, proto_ax25_kiss ); dissector_add_uint( "wtap_encap", WTAP_ENCAP_AX25_KISS, kiss_handle ); /* only currently implemented for AX.25 */ diff --git a/epan/dissectors/packet-ax25.c b/epan/dissectors/packet-ax25.c index 03112859d8..25f1867eaf 100644 --- a/epan/dissectors/packet-ax25.c +++ b/epan/dissectors/packet-ax25.c @@ -70,8 +70,6 @@ void proto_reg_handoff_ax25(void); /* Dissector table */ static dissector_table_t ax25_dissector_table; -static dissector_handle_t data_handle; - /* Initialize the protocol and registered fields */ static int proto_ax25 = -1; static int hf_ax25_dst = -1; @@ -128,6 +126,10 @@ static const value_string pid_vals[] = { static gint ett_ax25 = -1; static gint ett_ax25_ctl = -1; +static dissector_handle_t ax25_handle; + +static dissector_handle_t data_handle; + static void dissect_ax25( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree ) { @@ -434,7 +436,7 @@ proto_register_ax25(void) proto_ax25 = proto_register_protocol("Amateur Radio AX.25", "AX.25", "ax25"); /* Register the dissector */ - register_dissector( "ax25", dissect_ax25, proto_ax25 ); + ax25_handle = register_dissector( "ax25", dissect_ax25, proto_ax25 ); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array( proto_ax25, hf, array_length(hf ) ); @@ -447,9 +449,6 @@ proto_register_ax25(void) void proto_reg_handoff_ax25(void) { - dissector_handle_t ax25_handle; - - ax25_handle = create_dissector_handle( dissect_ax25, proto_ax25 ); dissector_add_uint("wtap_encap", WTAP_ENCAP_AX25, ax25_handle); dissector_add_uint("ip.proto", IP_PROTO_AX25, ax25_handle); diff --git a/epan/dissectors/packet-bjnp.c b/epan/dissectors/packet-bjnp.c index f422126a8b..2b166063b0 100644 --- a/epan/dissectors/packet-bjnp.c +++ b/epan/dissectors/packet-bjnp.c @@ -67,6 +67,8 @@ static int hf_payload = -1; static gint ett_bjnp = -1; +static dissector_handle_t bjnp_handle; + static const value_string dev_type_vals[] = { { PRINTER_COMMAND, "Printer Command" }, { SCANNER_COMMAND, "Scanner Command" }, @@ -167,7 +169,8 @@ void proto_register_bjnp (void) }; proto_bjnp = proto_register_protocol (PNAME, PSNAME, PFNAME); - new_register_dissector (PFNAME, dissect_bjnp, proto_bjnp); + + bjnp_handle = new_register_dissector (PFNAME, dissect_bjnp, proto_bjnp); proto_register_field_array (proto_bjnp, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); @@ -175,9 +178,6 @@ void proto_register_bjnp (void) void proto_reg_handoff_bjnp (void) { - dissector_handle_t bjnp_handle; - - bjnp_handle = find_dissector (PFNAME); dissector_add_uint ("udp.port", BJNP_PORT1, bjnp_handle); dissector_add_uint ("udp.port", BJNP_PORT2, bjnp_handle); dissector_add_uint ("udp.port", BJNP_PORT3, bjnp_handle); diff --git a/epan/dissectors/packet-btatt.c b/epan/dissectors/packet-btatt.c index 27ed69cd93..3e196ecd46 100644 --- a/epan/dissectors/packet-btatt.c +++ b/epan/dissectors/packet-btatt.c @@ -65,6 +65,8 @@ static gint ett_btatt_list = -1; static expert_field ei_btatt_uuid_format_unknown = EI_INIT; static expert_field ei_btatt_handle_too_few = EI_INIT; +static dissector_handle_t btatt_handle; + /* Opcodes */ static const value_string opcode_vals[] = { {0x01, "Error Response"}, @@ -666,7 +668,7 @@ proto_register_btatt(void) /* Register the protocol name and description */ proto_btatt = proto_register_protocol("Bluetooth Attribute Protocol", "BT ATT", "btatt"); - new_register_dissector("btatt", dissect_btatt, proto_btatt); + btatt_handle = new_register_dissector("btatt", dissect_btatt, proto_btatt); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_btatt, hf, array_length(hf)); @@ -683,9 +685,6 @@ proto_register_btatt(void) void proto_reg_handoff_btatt(void) { - dissector_handle_t btatt_handle; - - btatt_handle = find_dissector("btatt"); dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_ATT, btatt_handle); dissector_add_uint("btl2cap.cid", BTL2CAP_FIXED_CID_ATT, btatt_handle); } diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index c96591c959..38fe0d8b47 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -4980,7 +4980,8 @@ void proto_register_dmp (void) expert_module_t* expert_dmp; proto_dmp = proto_register_protocol (PNAME, PSNAME, PFNAME); - register_dissector(PFNAME, dissect_dmp, proto_dmp); + + dmp_handle = register_dissector(PFNAME, dissect_dmp, proto_dmp); proto_register_field_array (proto_dmp, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); @@ -5073,7 +5074,6 @@ void proto_reg_handoff_dmp (void) static gboolean dmp_prefs_initialized = FALSE; if (!dmp_prefs_initialized) { - dmp_handle = find_dissector (PFNAME); dmp_prefs_initialized = TRUE; } else { range_foreach (dmp_port_range, range_delete_callback); diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c index 3d76511df0..275eda43a9 100644 --- a/epan/dissectors/packet-eap.c +++ b/epan/dissectors/packet-eap.c @@ -97,6 +97,8 @@ static expert_field ei_eap_mitm_attacks = EI_INIT; static expert_field ei_eap_md5_value_size_overflow = EI_INIT; static expert_field ei_eap_dictionary_attacks = EI_INIT; +static dissector_handle_t eap_handle; + static dissector_handle_t ssl_handle; const value_string eap_code_vals[] = { @@ -1532,21 +1534,18 @@ proto_register_eap(void) expert_eap = expert_register_protocol(proto_eap); expert_register_field_array(expert_eap, ei, array_length(ei)); - new_register_dissector("eap", dissect_eap, proto_eap); + eap_handle = new_register_dissector("eap", dissect_eap, proto_eap); register_init_routine(eap_tls_defragment_init); } void proto_reg_handoff_eap(void) { - dissector_handle_t eap_handle; - /* * Get a handle for the SSL/TLS dissector. */ ssl_handle = find_dissector("ssl"); - eap_handle = find_dissector("eap"); dissector_add_uint("ppp.protocol", PPP_EAP, eap_handle); } /* diff --git a/epan/dissectors/packet-eapol.c b/epan/dissectors/packet-eapol.c index c14c1d1af3..8971db66ff 100644 --- a/epan/dissectors/packet-eapol.c +++ b/epan/dissectors/packet-eapol.c @@ -73,6 +73,8 @@ static gint ett_eapol_keydes_data = -1; static gint ett_eapol_key_index = -1; static gint ett_keyinfo = -1; +static dissector_handle_t eapol_handle; + static dissector_handle_t eap_handle; static dissector_handle_t data_handle; @@ -521,7 +523,7 @@ proto_register_eapol(void) }; proto_eapol = proto_register_protocol("802.1X Authentication", "EAPOL", "eapol"); - register_dissector("eapol", dissect_eapol, proto_eapol); + eapol_handle = register_dissector("eapol", dissect_eapol, proto_eapol); proto_register_field_array(proto_eapol, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -530,15 +532,12 @@ proto_register_eapol(void) void proto_reg_handoff_eapol(void) { - dissector_handle_t eapol_handle; - /* * Get handles for the EAP and raw data dissectors. */ eap_handle = find_dissector("eap"); data_handle = find_dissector("data"); - eapol_handle = create_dissector_handle(dissect_eapol, proto_eapol); dissector_add_uint("ethertype", ETHERTYPE_EAPOL, eapol_handle); dissector_add_uint("ethertype", ETHERTYPE_RSN_PREAUTH, eapol_handle); } diff --git a/epan/dissectors/packet-epl.c b/epan/dissectors/packet-epl.c index 7b85c48002..8db2b6d789 100644 --- a/epan/dissectors/packet-epl.c +++ b/epan/dissectors/packet-epl.c @@ -652,6 +652,8 @@ static gint ett_epl_el_entry = -1; static gint ett_epl_el_entry_type = -1; static gint ett_epl_sdo_entry_type = -1; +static dissector_handle_t epl_handle; + /* preference whether or not display the SoC flags in info column */ gboolean show_soc_flags = FALSE; @@ -2349,7 +2351,7 @@ proto_register_epl(void) register_heur_dissector_list("epl", &heur_epl_subdissector_list); /* Registering protocol to be called by another dissector */ - new_register_dissector("epl", dissect_epl, proto_epl); + epl_handle = new_register_dissector("epl", dissect_epl, proto_epl); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_epl, hf, array_length(hf)); @@ -2370,9 +2372,6 @@ proto_register_epl(void) void proto_reg_handoff_epl(void) { - dissector_handle_t epl_handle; - - epl_handle = new_create_dissector_handle(dissect_epl, proto_epl); dissector_add_uint("ethertype", ETHERTYPE_EPL_V2, epl_handle); dissector_add_uint("udp.port", UDP_PORT_EPL, epl_handle); } diff --git a/epan/dissectors/packet-erldp.c b/epan/dissectors/packet-erldp.c index e68f4172a3..b7936640b6 100644 --- a/epan/dissectors/packet-erldp.c +++ b/epan/dissectors/packet-erldp.c @@ -174,7 +174,7 @@ static gboolean erldp_desegment = TRUE; static dissector_handle_t erldp_handle = NULL; /* Subdissectors */ -dissector_handle_t data_handle; +static dissector_handle_t data_handle; /*--- External Term Format ---*/ @@ -679,8 +679,8 @@ void proto_register_erldp(void) { /* Register protocol and dissector */ proto_erldp = proto_register_protocol(PNAME, PSNAME, PFNAME); - register_dissector(PFNAME, dissect_erldp, proto_erldp); - erldp_handle = find_dissector(PFNAME); + + erldp_handle = register_dissector(PFNAME, dissect_erldp, proto_erldp); /* Register fields and subtrees */ proto_register_field_array(proto_erldp, hf, array_length(hf)); diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index f35b808d06..90100a8c62 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -140,8 +140,10 @@ static gint ett_fc_vft = -1; static expert_field ei_fccrc = EI_INIT; +static dissector_handle_t fc_handle, fcsof_handle; static dissector_table_t fcftype_dissector_table; -static dissector_handle_t data_handle, fc_handle; + +static dissector_handle_t data_handle; static int fc_tap = -1; @@ -1528,7 +1530,7 @@ proto_register_fc(void) /* Register the protocol name and description */ proto_fc = proto_register_protocol ("Fibre Channel", "FC", "fc"); - register_dissector ("fc", dissect_fc, proto_fc); + fc_handle = register_dissector ("fc", dissect_fc, proto_fc); register_dissector ("fc_ifcp", dissect_fc_ifcp, proto_fc); fc_tap = register_tap("fc"); @@ -1568,7 +1570,7 @@ proto_register_fc(void) proto_register_field_array(proto_fcsof, sof_hf, array_length(sof_hf)); proto_register_subtree_array(sof_ett, array_length(sof_ett)); - register_dissector("fcsof", dissect_fcsof, proto_fcsof); + fcsof_handle = register_dissector("fcsof", dissect_fcsof, proto_fcsof); } @@ -1579,12 +1581,8 @@ proto_register_fc(void) void proto_reg_handoff_fc (void) { - dissector_handle_t fcsof_handle; - - fc_handle = find_dissector("fc"); dissector_add_uint("wtap_encap", WTAP_ENCAP_FIBRE_CHANNEL_FC2, fc_handle); - fcsof_handle = find_dissector("fcsof"); dissector_add_uint("wtap_encap", WTAP_ENCAP_FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS, fcsof_handle); data_handle = find_dissector("data"); diff --git a/epan/dissectors/packet-fix.c b/epan/dissectors/packet-fix.c index 2b33b55c37..b2ce4e317b 100644 --- a/epan/dissectors/packet-fix.c +++ b/epan/dissectors/packet-fix.c @@ -52,7 +52,6 @@ typedef struct _fix_parameter { /* Initialize the protocol and registered fields */ static int proto_fix = -1; -static dissector_handle_t fix_handle; /* desegmentation of fix */ static gboolean fix_desegment = TRUE; @@ -71,6 +70,8 @@ static int hf_fix_checksum_bad = -1; static int hf_fix_field_value = -1; static int hf_fix_field_tag = -1; +static dissector_handle_t fix_handle; + static range_t *global_fix_tcp_range = NULL; static range_t *fix_tcp_range = NULL; @@ -513,7 +514,7 @@ proto_register_fix(void) "FIX", "fix"); /* Allow dissector to find be found by name. */ - register_dissector("fix", dissect_fix, proto_fix); + fix_handle = register_dissector("fix", dissect_fix, proto_fix); proto_register_field_array(proto_fix, hf, array_length(hf)); proto_register_field_array(proto_fix, hf_FIX, array_length(hf_FIX)); @@ -541,7 +542,6 @@ proto_reg_handoff_fix(void) /* Let the tcp dissector know that we're interested in traffic */ heur_dissector_add("tcp", dissect_fix_heur, proto_fix); /* Register a fix handle to "tcp.port" to be able to do 'decode-as' */ - fix_handle = create_dissector_handle(dissect_fix, proto_fix); dissector_add_handle("tcp.port", fix_handle); } diff --git a/epan/dissectors/packet-hdfs.c b/epan/dissectors/packet-hdfs.c index da8b3addd8..64e9f72008 100644 --- a/epan/dissectors/packet-hdfs.c +++ b/epan/dissectors/packet-hdfs.c @@ -114,10 +114,10 @@ static int hf_hdfs_password = -1; static int hf_hdfs_kind = -1; static int hf_hdfs_service = -1; - - static gint ett_hdfs = -1; +static dissector_handle_t hdfs_handle; + void proto_reg_handoff_hdfs(void); /* Parses the parameters of a function. @@ -1059,7 +1059,7 @@ proto_register_hdfs(void) 10, &tcp_port); - register_dissector("hdfs", dissect_hdfs, proto_hdfs); + hdfs_handle = register_dissector("hdfs", dissect_hdfs, proto_hdfs); } /* registers handoff */ @@ -1067,11 +1067,9 @@ void proto_reg_handoff_hdfs(void) { static gboolean initialized = FALSE; - static dissector_handle_t hdfs_handle; static guint saved_tcp_port; if (!initialized) { - hdfs_handle = create_dissector_handle(dissect_hdfs, proto_hdfs); dissector_add_handle("tcp.port", hdfs_handle); /* for "decode as" */ initialized = TRUE; } else if (saved_tcp_port != 0) { diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 036315eaa4..17a4e3367f 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -130,10 +130,11 @@ static gint ett_http_header_item = -1; static expert_field ei_http_chat = EI_INIT; static expert_field ei_http_subdissector_failed = EI_INIT; +static dissector_handle_t http_handle; + static dissector_handle_t data_handle; static dissector_handle_t media_handle; static dissector_handle_t websocket_handle; -static dissector_handle_t http_handle; /* Stuff for generation/handling of fields for custom HTTP headers */ typedef struct _header_field_t { @@ -2955,7 +2956,9 @@ proto_register_http(void) proto_register_subtree_array(ett, array_length(ett)); expert_http = expert_register_protocol(proto_http); expert_register_field_array(expert_http, ei, array_length(ei)); - register_dissector("http", dissect_http, proto_http); + + http_handle = register_dissector("http", dissect_http, proto_http); + http_module = prefs_register_protocol(proto_http, reinit_http); prefs_register_bool_preference(http_module, "desegment_headers", "Reassemble HTTP headers spanning multiple TCP segments", @@ -3020,8 +3023,6 @@ proto_register_http(void) "A table to define custom HTTP header for which fields can be setup and used for filtering/data extraction etc.", headers_uat); - http_handle = create_dissector_handle(dissect_http, proto_http); - /* * Dissectors shouldn't register themselves in this table; * instead, they should call "http_dissector_add()", and diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 3547262e4b..6f67460a7f 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -515,6 +515,7 @@ static expert_field ei_icmpv6_rr_pco_mp_matchlen = EI_INIT; static expert_field ei_icmpv6_rr_pco_mp_matchedlen = EI_INIT; static expert_field ei_icmpv6_checksum = EI_INIT; +static dissector_handle_t icmpv6_handle; static dissector_handle_t ipv6_handle; static dissector_handle_t data_handle; @@ -4938,16 +4939,14 @@ proto_register_icmpv6(void) expert_icmpv6 = expert_register_protocol(proto_icmpv6); expert_register_field_array(expert_icmpv6, ei, array_length(ei)); - new_register_dissector("icmpv6", dissect_icmpv6, proto_icmpv6); + icmpv6_handle = new_register_dissector("icmpv6", dissect_icmpv6, proto_icmpv6); + icmpv6_tap = register_tap("icmpv6"); } void proto_reg_handoff_icmpv6(void) { - dissector_handle_t icmpv6_handle; - - icmpv6_handle = new_create_dissector_handle(dissect_icmpv6, proto_icmpv6); dissector_add_uint("ip.proto", IP_PROTO_ICMPV6, icmpv6_handle); /* diff --git a/epan/dissectors/packet-image-png.c b/epan/dissectors/packet-image-png.c index 4305ec3e81..3c638828fc 100644 --- a/epan/dissectors/packet-image-png.c +++ b/epan/dissectors/packet-image-png.c @@ -32,7 +32,6 @@ #include <glib.h> #include <epan/packet.h> - static int proto_png = -1; static int hf_png_signature = -1; static int hf_png_chunk_data = -1; @@ -70,6 +69,8 @@ static gint ett_png = -1; static gint ett_png_chunk = -1; static gint ett_png_chunk_item = -1; +static dissector_handle_t png_handle; + static const value_string colour_type_vals[] = { { 0, "Greyscale"}, @@ -412,7 +413,8 @@ proto_register_png(void) proto_png = proto_register_protocol("Portable Network Graphics","PNG","png"); proto_register_field_array(proto_png, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - new_register_dissector("png", dissect_png, proto_png); + + png_handle = new_register_dissector("png", dissect_png, proto_png); } static gboolean dissect_png_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) @@ -423,7 +425,6 @@ static gboolean dissect_png_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree * void proto_reg_handoff_png(void) { - dissector_handle_t png_handle = new_create_dissector_handle(dissect_png, proto_png); dissector_add_string("media_type", "image/png", png_handle); heur_dissector_add("http", dissect_png_heur, proto_png); heur_dissector_add("wtap_file", dissect_png_heur, proto_png); diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 279074e2ab..1a7f4af42e 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -150,6 +150,8 @@ static int ett_imf_siolabel = -1; static int ett_imf_extension = -1; static int ett_imf_message_text = -1; +static dissector_handle_t imf_handle; + static expert_field ei_imf_unknown_param = EI_INIT; struct imf_field { @@ -1244,7 +1246,7 @@ proto_register_imf(void) expert_register_field_array(expert_imf, ei, array_length(ei)); /* Allow dissector to find be found by name. */ - register_dissector(PFNAME, dissect_imf, proto_imf); + imf_handle = register_dissector(PFNAME, dissect_imf, proto_imf); imf_module = prefs_register_protocol(proto_imf, NULL); prefs_register_uat_preference(imf_module, "custom_header_fields", "Custom IMF headers", @@ -1264,10 +1266,6 @@ proto_register_imf(void) void proto_reg_handoff_imf(void) { - dissector_handle_t imf_handle; - - imf_handle = find_dissector(PFNAME); - dissector_add_string("media_type", "message/rfc822", imf_handle); diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index 5e957185e2..1dec165661 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -102,7 +102,10 @@ static gint ett_link = -1; /* Global ref to highest level tree should we find other protocols encapsulated in IB */ static proto_tree *top_tree = NULL; -/* Dissector Declarations */ +/* Dissector Declaration */ +static dissector_handle_t ib_handle; + +/* Subdissectors Declarations */ static dissector_handle_t ipv6_handle; static dissector_handle_t data_handle; static dissector_handle_t eth_handle; @@ -7450,7 +7453,7 @@ void proto_register_infiniband(void) }; proto_infiniband = proto_register_protocol("InfiniBand", "InfiniBand", "infiniband"); - register_dissector("infiniband", dissect_infiniband, proto_infiniband); + ib_handle = register_dissector("infiniband", dissect_infiniband, proto_infiniband); proto_register_field_array(proto_infiniband, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -7490,7 +7493,6 @@ void proto_register_infiniband(void) void proto_reg_handoff_infiniband(void) { dissector_handle_t roce_handle; - dissector_handle_t ib_handle; ipv6_handle = find_dissector("ipv6"); data_handle = find_dissector("data"); @@ -7501,6 +7503,5 @@ void proto_reg_handoff_infiniband(void) roce_handle = create_dissector_handle(dissect_roce, proto_infiniband); dissector_add_uint("ethertype", ETHERTYPE_ROCE, roce_handle); - ib_handle = create_dissector_handle(dissect_infiniband, proto_infiniband); dissector_add_uint("wtap_encap", WTAP_ENCAP_INFINIBAND, ib_handle); } diff --git a/epan/dissectors/packet-knet.c b/epan/dissectors/packet-knet.c index 47923c6705..ebbd9fff09 100644 --- a/epan/dissectors/packet-knet.c +++ b/epan/dissectors/packet-knet.c @@ -111,6 +111,10 @@ static gint ett_knet_datagram = -1; static gint ett_knet_flags = -1; /**@}*/ +static dissector_handle_t knet_handle_sctp; +static dissector_handle_t knet_handle_tcp; +static dissector_handle_t knet_handle_udp; + /* Few Utility Variables */ static int messageindex = 0; /*!< Index of the kNet message inside a datagram */ static int current_protocol = 0; /*!< Protocol currently dissected */ @@ -821,9 +825,9 @@ proto_register_knet(void) /* Register protocols */ proto_knet = proto_register_protocol ("kNet Protocol", "KNET", "knet"); - register_dissector("knetsctp", dissect_knet_sctp, proto_knet); - register_dissector("knettcp", dissect_knet_tcp, proto_knet); - register_dissector("knetudp", dissect_knet_udp, proto_knet); + knet_handle_sctp = register_dissector("knetsctp", dissect_knet_sctp, proto_knet); + knet_handle_tcp = register_dissector("knettcp", dissect_knet_tcp, proto_knet); + knet_handle_udp = register_dissector("knetudp", dissect_knet_udp, proto_knet); knet_module = prefs_register_protocol(proto_knet, proto_reg_handoff_knet); @@ -851,20 +855,12 @@ proto_reg_handoff_knet(void) { static gboolean initialized = FALSE; - static dissector_handle_t knet_handle_sctp = 0; - static dissector_handle_t knet_handle_tcp = 0; - static dissector_handle_t knet_handle_udp = 0; - static guint current_sctp_port; static guint current_tcp_port; static guint current_udp_port; if(!initialized) { - knet_handle_sctp = create_dissector_handle(dissect_knet_sctp, proto_knet); - knet_handle_tcp = create_dissector_handle(dissect_knet_tcp, proto_knet); - knet_handle_udp = create_dissector_handle(dissect_knet_udp, proto_knet); - initialized = TRUE; } else diff --git a/epan/dissectors/packet-lisp.c b/epan/dissectors/packet-lisp.c index f52a9f74bd..f4bb8c7179 100644 --- a/epan/dissectors/packet-lisp.c +++ b/epan/dissectors/packet-lisp.c @@ -224,6 +224,8 @@ static gint ett_lisp_record = -1; static gint ett_lisp_lcaf = -1; static gint ett_lisp_elp = -1; +static dissector_handle_t lisp_handle; + static dissector_handle_t ipv4_handle; static dissector_handle_t ipv6_handle; static dissector_handle_t data_handle; @@ -1978,7 +1980,7 @@ proto_register_lisp(void) proto_register_subtree_array(ett, array_length(ett)); /* Register dissector so that other dissectors can call it */ - new_register_dissector("lisp", dissect_lisp, proto_lisp); + lisp_handle = new_register_dissector("lisp", dissect_lisp, proto_lisp); } @@ -1990,9 +1992,6 @@ proto_register_lisp(void) void proto_reg_handoff_lisp(void) { - dissector_handle_t lisp_handle; - - lisp_handle = new_create_dissector_handle(dissect_lisp, proto_lisp); dissector_add_uint("udp.port", LISP_CONTROL_PORT, lisp_handle); ipv4_handle = find_dissector("ip"); ipv6_handle = find_dissector("ipv6"); diff --git a/epan/dissectors/packet-openvpn.c b/epan/dissectors/packet-openvpn.c index 5bc1e54db6..6e317d1a7f 100644 --- a/epan/dissectors/packet-openvpn.c +++ b/epan/dissectors/packet-openvpn.c @@ -60,8 +60,6 @@ #define P_CONTROL_HARD_RESET_CLIENT_V2 7 #define P_CONTROL_HARD_RESET_SERVER_V2 8 -static dissector_handle_t ssl_handle; - static gint ett_openvpn = -1; static gint ett_openvpn_data = -1; static gint ett_openvpn_packetarray = -1; @@ -82,6 +80,10 @@ static gint hf_openvpn_rsessionid = -1; static gint hf_openvpn_sessionid = -1; static gint proto_openvpn = -1; +static dissector_handle_t openvpn_handle; + +static dissector_handle_t ssl_handle; + /* Preferences */ static gboolean pref_long_format = TRUE; static gboolean pref_tls_auth = FALSE; @@ -595,7 +597,7 @@ proto_register_openvpn(void) proto_register_field_array(proto_openvpn, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector(PFNAME, dissect_openvpn, proto_openvpn); + openvpn_handle = register_dissector(PFNAME, dissect_openvpn, proto_openvpn); register_init_routine(&openvpn_reassemble_init); @@ -644,13 +646,11 @@ proto_register_openvpn(void) void proto_reg_handoff_openvpn(void) { - static dissector_handle_t openvpn_handle; static guint tcp_port; static guint udp_port; static gboolean initialized = FALSE; if (! initialized) { - openvpn_handle = find_dissector(PFNAME); ssl_handle = find_dissector("ssl"); initialized = TRUE; } else { diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c index 36b72969ce..0f6d564420 100644 --- a/epan/dissectors/packet-p_mul.c +++ b/epan/dissectors/packet-p_mul.c @@ -159,6 +159,7 @@ static gint ett_msg_fragment = -1; static gint ett_msg_fragments = -1; static dissector_handle_t p_mul_handle = NULL; + static dissector_handle_t data_handle = NULL; typedef struct _p_mul_id_key { @@ -1577,7 +1578,8 @@ void proto_register_p_mul (void) module_t *p_mul_module; proto_p_mul = proto_register_protocol (PNAME, PSNAME, PFNAME); - register_dissector(PFNAME, dissect_p_mul, proto_p_mul); + + p_mul_handle = register_dissector(PFNAME, dissect_p_mul, proto_p_mul); proto_register_field_array (proto_p_mul, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); @@ -1635,7 +1637,6 @@ void proto_reg_handoff_p_mul (void) static range_t *p_mul_port_range; if (!p_mul_prefs_initialized) { - p_mul_handle = find_dissector(PFNAME); p_mul_prefs_initialized = TRUE; data_handle = find_dissector ("data"); } else { diff --git a/epan/dissectors/packet-packetlogger.c b/epan/dissectors/packet-packetlogger.c index 3b9f879be9..7cf303cd7e 100644 --- a/epan/dissectors/packet-packetlogger.c +++ b/epan/dissectors/packet-packetlogger.c @@ -32,9 +32,6 @@ #define PSNAME "PKTLOG" #define PFNAME "packetlogger" -static dissector_table_t hci_h1_table; -static dissector_handle_t data_handle; - static int proto_packetlogger = -1; static int hf_type = -1; @@ -42,6 +39,11 @@ static int hf_info = -1; static gint ett_packetlogger = -1; +static dissector_handle_t packetlogger_handle; +static dissector_table_t hci_h1_table; + +static dissector_handle_t data_handle; + #define PKT_HCI_COMMAND 0x00 #define PKT_HCI_EVENT 0x01 #define PKT_SENT_ACL_DATA 0x02 @@ -148,7 +150,8 @@ void proto_register_packetlogger (void) }; proto_packetlogger = proto_register_protocol (PNAME, PSNAME, PFNAME); - register_dissector (PFNAME, dissect_packetlogger, proto_packetlogger); + + packetlogger_handle = register_dissector (PFNAME, dissect_packetlogger, proto_packetlogger); proto_register_field_array (proto_packetlogger, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); @@ -156,9 +159,6 @@ void proto_register_packetlogger (void) void proto_reg_handoff_packetlogger (void) { - dissector_handle_t packetlogger_handle; - - packetlogger_handle = find_dissector (PFNAME); hci_h1_table = find_dissector_table("hci_h1.type"); data_handle = find_dissector("data"); dissector_add_uint ("wtap_encap", WTAP_ENCAP_PACKETLOGGER, packetlogger_handle); diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c index 146f5ef9c0..8c118fb3b4 100644 --- a/epan/dissectors/packet-ppi.c +++ b/epan/dissectors/packet-ppi.c @@ -316,11 +316,12 @@ static gint ett_8023_extension = -1; static gint ett_8023_extension_flags = -1; static gint ett_8023_extension_errors = -1; +static dissector_handle_t ppi_handle; + static dissector_handle_t data_handle; static dissector_handle_t ieee80211_ht_handle; static dissector_handle_t ppi_gps_handle, ppi_vector_handle, ppi_sensor_handle, ppi_antenna_handle; - static const true_false_string tfs_ppi_head_flag_alignment = { "32-bit aligned", "Not aligned" }; static const true_false_string tfs_tsft_ms = { "milliseconds", "microseconds" }; static const true_false_string tfs_ht20_40 = { "HT40", "HT20" }; @@ -1335,7 +1336,8 @@ proto_register_ppi(void) proto_ppi = proto_register_protocol("PPI Packet Header", "PPI", "ppi"); proto_register_field_array(proto_ppi, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("ppi", dissect_ppi, proto_ppi); + + ppi_handle = register_dissector("ppi", dissect_ppi, proto_ppi); register_init_routine(ampdu_reassemble_init); @@ -1350,9 +1352,6 @@ proto_register_ppi(void) void proto_reg_handoff_ppi(void) { - dissector_handle_t ppi_handle; - - ppi_handle = create_dissector_handle(dissect_ppi, proto_ppi); data_handle = find_dissector("data"); ieee80211_ht_handle = find_dissector("wlan_ht"); ppi_gps_handle = find_dissector("ppi_gps"); diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c index 19a9eedc45..bfb9e04e08 100644 --- a/epan/dissectors/packet-rohc.c +++ b/epan/dissectors/packet-rohc.c @@ -44,10 +44,6 @@ #include "packet-rohc.h" -static dissector_handle_t ip_handle; -static dissector_handle_t ipv6_handle; -static dissector_handle_t data_handle; - static GHashTable *rohc_cid_hash = NULL; /* Initialize the protocol and registered fields */ @@ -162,6 +158,12 @@ static int ett_rohc_dynamic_rtp = -1; static int ett_rohc_compressed_list = -1; static int ett_rohc_packet = -1; +static dissector_handle_t rohc_handle; + +static dissector_handle_t ip_handle; +static dissector_handle_t ipv6_handle; +static dissector_handle_t data_handle; + typedef struct _rohc_cid_context_t { guint16 rohc_ip_version; @@ -2945,7 +2947,7 @@ proto_register_rohc(void) /* Register the protocol name and description */ proto_rohc = proto_register_protocol("RObust Header Compression (ROHC)", "ROHC", "rohc"); - register_dissector("rohc", dissect_rohc, proto_rohc); + rohc_handle = register_dissector("rohc", dissect_rohc, proto_rohc); register_init_routine(&rohc_init_protocol); @@ -2957,9 +2959,6 @@ proto_register_rohc(void) void proto_reg_handoff_rohc(void) { - dissector_handle_t rohc_handle; - - rohc_handle = create_dissector_handle(dissect_rohc, proto_rohc); dissector_add_uint("ethertype", ETHERTYPE_ROHC, rohc_handle); ip_handle = find_dissector("ip"); diff --git a/epan/dissectors/packet-syslog.c b/epan/dissectors/packet-syslog.c index f0df66e261..fc13bfdebd 100644 --- a/epan/dissectors/packet-syslog.c +++ b/epan/dissectors/packet-syslog.c @@ -166,6 +166,8 @@ static gint hf_syslog_msu_present = -1; static gint ett_syslog = -1; +static dissector_handle_t syslog_handle; + static dissector_handle_t mtp_handle; /* The Cisco ITP's packet logging facility allows selected (SS7) MSUs to be @@ -347,15 +349,12 @@ void proto_register_syslog(void) proto_register_field_array(proto_syslog, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("syslog", dissect_syslog, proto_syslog); + syslog_handle = register_dissector("syslog", dissect_syslog, proto_syslog); } void proto_reg_handoff_syslog(void) { - dissector_handle_t syslog_handle; - - syslog_handle = create_dissector_handle(dissect_syslog, proto_syslog); dissector_add_uint("udp.port", UDP_PORT_SYSLOG, syslog_handle); dissector_add_handle("tcp.port", syslog_handle); diff --git a/epan/dissectors/packet-tali.c b/epan/dissectors/packet-tali.c index 375ba6b530..16a49cf593 100644 --- a/epan/dissectors/packet-tali.c +++ b/epan/dissectors/packet-tali.c @@ -64,7 +64,6 @@ static gint ett_tali_opcode = -1; static gint ett_tali_msu_length = -1; static int proto_tali = -1; -static dissector_handle_t tali_handle; static dissector_table_t tali_dissector_table; /* Initialize the protocol and registered fields */ @@ -191,7 +190,6 @@ proto_register_tali(void) /* Register the protocol name and description */ proto_tali = proto_register_protocol("Transport Adapter Layer Interface v1.0, RFC 3094", "TALI", "tali"); register_dissector("tali", dissect_tali, proto_tali); - tali_handle = create_dissector_handle(dissect_tali, proto_tali); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_tali, hf, array_length(hf)); diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c index 13aeb56ad9..f6d5c7ffaa 100644 --- a/epan/dissectors/packet-telnet.c +++ b/epan/dissectors/packet-telnet.c @@ -120,6 +120,8 @@ static gint ett_charset_subopt = -1; static gint ett_rsp_subopt = -1; static gint ett_comport_subopt = -1; +static dissector_handle_t telnet_handle; + static dissector_handle_t tn3270_handle; static dissector_handle_t tn5250_handle; @@ -2018,15 +2020,12 @@ proto_register_telnet(void) proto_register_field_array(proto_telnet, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("telnet", dissect_telnet, proto_telnet); + telnet_handle = register_dissector("telnet", dissect_telnet, proto_telnet); } void proto_reg_handoff_telnet(void) { - dissector_handle_t telnet_handle; - - telnet_handle = create_dissector_handle(dissect_telnet, proto_telnet); dissector_add_uint("tcp.port", TCP_PORT_TELNET, telnet_handle); tn3270_handle = find_dissector("tn3270"); tn5250_handle = find_dissector("tn5250"); diff --git a/epan/dissectors/packet-tnef.c b/epan/dissectors/packet-tnef.c index 7b367f6bda..a78be492f5 100644 --- a/epan/dissectors/packet-tnef.c +++ b/epan/dissectors/packet-tnef.c @@ -168,6 +168,8 @@ static int ett_tnef_attribute_address = -1; static expert_field ei_tnef_expect_single_item = EI_INIT; static expert_field ei_tnef_incorrect_signature = EI_INIT; +static dissector_handle_t tnef_handle; + static const value_string tnef_Lvl_vals[] = { { 1, "LVL-MESSAGE" }, { 2, "LVL-ATTACHMENT" }, @@ -829,7 +831,7 @@ proto_register_tnef(void) expert_register_field_array(expert_tnef, ei, array_length(ei)); /* Allow dissector to find be found by name. */ - register_dissector(PFNAME, dissect_tnef, proto_tnef); + tnef_handle = register_dissector(PFNAME, dissect_tnef, proto_tnef); } @@ -837,9 +839,8 @@ proto_register_tnef(void) void proto_reg_handoff_tnef(void) { - dissector_handle_t tnef_handle, tnef_file_handle; + dissector_handle_t tnef_file_handle; - tnef_handle = find_dissector(PFNAME); tnef_file_handle = create_dissector_handle(dissect_tnef_file, proto_tnef); dissector_add_string("media_type", "application/ms-tnef", tnef_handle); diff --git a/epan/dissectors/packet-uasip.c b/epan/dissectors/packet-uasip.c index 622bf6505b..fdc2939cdd 100644 --- a/epan/dissectors/packet-uasip.c +++ b/epan/dissectors/packet-uasip.c @@ -77,6 +77,8 @@ static gboolean uasip_enabled = FALSE; static gboolean use_proxy_ipaddr = FALSE; static gboolean noesip_enabled = FALSE; +static dissector_handle_t uasip_handle; + static dissector_handle_t ua_sys_to_term_handle; static dissector_handle_t ua_term_to_sys_handle; @@ -456,7 +458,7 @@ void proto_register_uasip(void) }; proto_uasip = proto_register_protocol("UA/SIP Protocol", "UASIP", "uasip"); - register_dissector("uasip", dissect_uasip, proto_uasip); + uasip_handle = register_dissector("uasip", dissect_uasip, proto_uasip); proto_register_field_array(proto_uasip, hf_uasip, array_length(hf_uasip)); proto_register_subtree_array(ett, array_length(ett)); @@ -474,12 +476,10 @@ void proto_register_uasip(void) void proto_reg_handoff_uasip(void) { - static dissector_handle_t uasip_handle; static gboolean prefs_initialized = FALSE; if (!prefs_initialized) { - uasip_handle = create_dissector_handle(dissect_uasip, proto_uasip); ua_sys_to_term_handle = find_dissector("ua_sys_to_term"); ua_term_to_sys_handle = find_dissector("ua_term_to_sys"); prefs_initialized = TRUE; diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 0da56e3b85..fa760f108e 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -198,6 +198,8 @@ static const int *usb_usbpcap_info_fields[] = { static int usb_tap = -1; static gboolean try_heuristics = TRUE; +static dissector_handle_t linux_usb_handle; + static dissector_table_t usb_bulk_dissector_table; static dissector_table_t usb_control_dissector_table; static dissector_table_t usb_interrupt_dissector_table; @@ -3941,7 +3943,7 @@ proto_register_usb(void) proto_usb = proto_register_protocol("USB", "USB", "usb"); proto_register_field_array(proto_usb, hf, array_length(hf)); proto_register_subtree_array(usb_subtrees, array_length(usb_subtrees)); - register_dissector("usb", dissect_linux_usb, proto_usb); + linux_usb_handle = register_dissector("usb", dissect_linux_usb, proto_usb); usb_bulk_dissector_table = register_dissector_table("usb.bulk", "USB bulk endpoint", FT_UINT8, BASE_DEC); @@ -3968,11 +3970,9 @@ proto_register_usb(void) void proto_reg_handoff_usb(void) { - dissector_handle_t linux_usb_handle; dissector_handle_t linux_usb_mmapped_handle; dissector_handle_t win32_usb_handle; - linux_usb_handle = create_dissector_handle(dissect_linux_usb, proto_usb); linux_usb_mmapped_handle = create_dissector_handle(dissect_linux_usb_mmapped, proto_usb); win32_usb_handle = create_dissector_handle(dissect_win32_usb, proto_usb); diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c index 5f819c8b88..a77d6c4d19 100644 --- a/epan/dissectors/packet-vcdu.c +++ b/epan/dissectors/packet-vcdu.c @@ -31,7 +31,6 @@ #include <epan/prefs.h> #include <epan/uat.h> - /* Initialize the protocol and registered fields */ static int proto_vcdu = -1; @@ -70,6 +69,8 @@ static int hf_vcdu_replay = -1; static int hf_vcdu_fhp = -1; static int hf_vcdu_lbp = -1; +static dissector_handle_t vcdu_handle; + static dissector_handle_t ccsds_handle; /* Initialize the subtree pointers */ @@ -609,7 +610,7 @@ proto_register_vcdu(void) proto_register_subtree_array(ett, array_length(ett)); /* XX: Does this dissector need to be publicly registered ?? */ - register_dissector ( "vcdu", dissect_vcdu, proto_vcdu ); + vcdu_handle = register_dissector ( "vcdu", dissect_vcdu, proto_vcdu ); vcdu_module = prefs_register_protocol(proto_vcdu, vcdu_prefs_apply_cb); diff --git a/epan/dissectors/packet-vuze-dht.c b/epan/dissectors/packet-vuze-dht.c index 631c327b17..594ea1fddb 100644 --- a/epan/dissectors/packet-vuze-dht.c +++ b/epan/dissectors/packet-vuze-dht.c @@ -268,6 +268,8 @@ static gint ett_vuze_dht_value = -1; static gint ett_vuze_dht_network_coordinates = -1; static gint ett_vuze_dht_network_coordinate = -1; +static dissector_handle_t vuze_dht_handle; + /* port use */ static guint global_vuze_dht_udp_port = DEFAULT_UDP_PORT; @@ -1424,7 +1426,8 @@ proto_register_vuze_dht(void) proto_register_field_array(proto_vuze_dht, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - new_register_dissector("vuze-dht", dissect_vuze_dht, proto_vuze_dht); + + vuze_dht_handle = new_register_dissector("vuze-dht", dissect_vuze_dht, proto_vuze_dht); /* Register our configuration options */ vuze_dht_module = prefs_register_protocol(proto_vuze_dht, proto_reg_handoff_vuze_dht); @@ -1439,12 +1442,10 @@ void proto_reg_handoff_vuze_dht(void) { static gboolean vuze_dht_prefs_initialized = FALSE; - static dissector_handle_t vuze_dht_handle; static guint vuze_dht_udp_port; if (!vuze_dht_prefs_initialized) { - vuze_dht_handle = new_create_dissector_handle(dissect_vuze_dht, proto_vuze_dht); vuze_dht_prefs_initialized = TRUE; } else diff --git a/epan/dissectors/packet-xmpp.c b/epan/dissectors/packet-xmpp.c index 3c134b81e5..a89f5a5e42 100644 --- a/epan/dissectors/packet-xmpp.c +++ b/epan/dissectors/packet-xmpp.c @@ -45,9 +45,6 @@ #define XMPP_PORT 5222 -static dissector_handle_t ssl_handle; -static dissector_handle_t xml_handle; - int proto_xmpp = -1; static gboolean xmpp_desegment = TRUE; @@ -363,6 +360,11 @@ gint ett_unknown[ETT_UNKNOWN_LEN]; static expert_field ei_xmpp_xml_disabled = EI_INIT; static expert_field ei_xmpp_packet_unknown = EI_INIT; +static dissector_handle_t xmpp_handle; + +static dissector_handle_t ssl_handle; +static dissector_handle_t xml_handle; + static void dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -1435,18 +1437,15 @@ proto_register_xmpp(void) { expert_xmpp = expert_register_protocol(proto_xmpp); expert_register_field_array(expert_xmpp, ei, array_length(ei)); - register_dissector("xmpp", dissect_xmpp, proto_xmpp); + xmpp_handle = register_dissector("xmpp", dissect_xmpp, proto_xmpp); xmpp_init_parsers(); } void proto_reg_handoff_xmpp(void) { - dissector_handle_t xmpp_handle; - ssl_handle = find_dissector("ssl"); xml_handle = find_dissector("xml"); - xmpp_handle = find_dissector("xmpp"); dissector_add_uint("tcp.port", XMPP_PORT, xmpp_handle); diff --git a/epan/dissectors/packet-xot.c b/epan/dissectors/packet-xot.c index 5dcd134539..3a79e4e30e 100644 --- a/epan/dissectors/packet-xot.c +++ b/epan/dissectors/packet-xot.c @@ -73,8 +73,6 @@ static const value_string xot_pvc_status_vals[] = { { 0, NULL} }; -static dissector_handle_t x25_handle; - static gint proto_xot = -1; static gint ett_xot = -1; static gint hf_xot_version = -1; @@ -97,6 +95,10 @@ static gint hf_xot_pvc_send_out_pkt_size = -1; static gint hf_xot_pvc_init_itf_name = -1; static gint hf_xot_pvc_resp_itf_name = -1; +static dissector_handle_t xot_handle; + +static dissector_handle_t x25_handle; + /* desegmentation of X.25 over multiple TCP */ static gboolean xot_desegment = TRUE; /* desegmentation of X.25 packet sequences */ @@ -422,7 +424,7 @@ proto_register_xot(void) proto_xot = proto_register_protocol("X.25 over TCP", "XOT", "xot"); proto_register_field_array(proto_xot, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - new_register_dissector("xot", dissect_xot_tcp_heur, proto_xot); + xot_handle = new_register_dissector("xot", dissect_xot_tcp_heur, proto_xot); xot_module = prefs_register_protocol(proto_xot, NULL); prefs_register_bool_preference(xot_module, "desegment", @@ -442,9 +444,6 @@ proto_register_xot(void) void proto_reg_handoff_xot(void) { - dissector_handle_t xot_handle; - - xot_handle = find_dissector("xot"); dissector_add_uint("tcp.port", TCP_PORT_XOT, xot_handle); x25_handle = find_dissector("x.25"); diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c index 869f5cdfce..9b30b36f86 100644 --- a/epan/dissectors/packet-zbee-aps.c +++ b/epan/dissectors/packet-zbee-aps.c @@ -139,10 +139,12 @@ static expert_field ei_zbee_aps_invalid_delivery_mode = EI_INIT; static expert_field ei_zbee_aps_missing_payload = EI_INIT; /* Dissector Handles. */ -static dissector_handle_t data_handle; static dissector_handle_t zbee_aps_handle; static dissector_handle_t zbee_apf_handle; +/* Subdissector Handles. */ +static dissector_handle_t data_handle; + /* Dissector List. */ static dissector_table_t zbee_aps_dissector_table; @@ -1986,7 +1988,7 @@ void proto_register_zbee_aps(void) /* Register the APS dissector and subdissector list. */ zbee_aps_dissector_table = register_dissector_table("zbee.profile", "ZigBee Profile ID", FT_UINT16, BASE_HEX); - register_dissector(ZBEE_PROTOABBREV_APS, dissect_zbee_aps, proto_zbee_aps); + zbee_aps_handle = register_dissector(ZBEE_PROTOABBREV_APS, dissect_zbee_aps, proto_zbee_aps); /* Register the init routine. */ register_init_routine(proto_init_zbee_aps); @@ -1997,7 +1999,7 @@ void proto_register_zbee_aps(void) proto_register_subtree_array(ett_apf, array_length(ett_apf)); /* Register the App dissector. */ - register_dissector(ZBEE_PROTOABBREV_APF, dissect_zbee_apf, proto_zbee_apf); + zbee_apf_handle = register_dissector(ZBEE_PROTOABBREV_APF, dissect_zbee_apf, proto_zbee_apf); } /* proto_register_zbee_aps */ /*FUNCTION:------------------------------------------------------ @@ -2015,8 +2017,6 @@ void proto_reg_handoff_zbee_aps(void) { /* Find the other dissectors we need. */ data_handle = find_dissector("data"); - zbee_aps_handle = find_dissector(ZBEE_PROTOABBREV_APS); - zbee_apf_handle = find_dissector(ZBEE_PROTOABBREV_APF); } /* proto_reg_handoff_zbee_aps */ /*FUNCTION:------------------------------------------------------ diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c index a135755ea6..770af77754 100644 --- a/epan/dissectors/packet-zep.c +++ b/epan/dissectors/packet-zep.c @@ -81,7 +81,10 @@ static gint ett_zep = -1; /* Initialize preferences. */ static guint32 gPREF_zep_udp_port = ZEP_DEFAULT_PORT; -/* Dissector handles */ +/* Dissector handle */ +static dissector_handle_t zep_handle; + +/* Subdissector handles */ static dissector_handle_t data_handle; static dissector_handle_t ieee802154_handle; static dissector_handle_t ieee802154_ccfcs_handle; @@ -320,7 +323,7 @@ void proto_register_zep(void) 10, &gPREF_zep_udp_port); /* Register dissector with Wireshark. */ - register_dissector("zep", dissect_zep, proto_zep); + zep_handle = register_dissector("zep", dissect_zep, proto_zep); } /* proto_register_zep */ /*FUNCTION:------------------------------------------------------ @@ -337,7 +340,6 @@ void proto_register_zep(void) */ void proto_reg_handoff_zep(void) { - static dissector_handle_t zep_handle; static int lastPort; static gboolean inited = FALSE; @@ -352,7 +354,6 @@ void proto_reg_handoff_zep(void) h = find_dissector("ieee802154_ccfcs"); /* otherwise use older 802.15.4 (Chipcon) plugin disector */ } ieee802154_ccfcs_handle = h; - zep_handle = find_dissector("zep"); data_handle = find_dissector("data"); inited = TRUE; } else { |