diff options
43 files changed, 197 insertions, 169 deletions
diff --git a/epan/dissectors/packet-ebhscr.c b/epan/dissectors/packet-ebhscr.c index 217537326f..535e124fff 100644 --- a/epan/dissectors/packet-ebhscr.c +++ b/epan/dissectors/packet-ebhscr.c @@ -500,6 +500,8 @@ static expert_field ei_ebhscr_frame_header = EI_INIT; static expert_field ei_ebhscr_err_status_flag = EI_INIT; static expert_field ei_ebhscr_info_status_flag = EI_INIT; +static dissector_handle_t ebhscr_handle; + static dissector_handle_t can_handle; static dissector_handle_t can_fd_handle; static dissector_handle_t eth_withfcs_handle; @@ -1832,7 +1834,7 @@ proto_register_ebhscr(void) expert_ebhscr = expert_register_protocol(proto_ebhscr); expert_register_field_array(expert_ebhscr, ei, array_length(ei)); - register_dissector("ebhscr", dissect_ebhscr, proto_ebhscr); + ebhscr_handle = register_dissector("ebhscr", dissect_ebhscr, proto_ebhscr); subdissector_table = register_decode_as_next_proto(proto_ebhscr, "ebhscr.subdissector", "ebhscr next level dissector", NULL); } @@ -1840,8 +1842,6 @@ proto_register_ebhscr(void) void proto_reg_handoff_ebhscr(void) { - static dissector_handle_t ebhscr_handle; - can_handle = find_dissector_add_dependency("can-hostendian", proto_ebhscr); can_fd_handle = find_dissector_add_dependency("canfd", proto_ebhscr); @@ -1851,7 +1851,6 @@ proto_reg_handoff_ebhscr(void) flexray_handle = find_dissector_add_dependency("flexray", proto_ebhscr); - ebhscr_handle = create_dissector_handle( dissect_ebhscr, proto_ebhscr); dissector_add_uint("wtap_encap", WTAP_ENCAP_EBHSCR, ebhscr_handle); } diff --git a/epan/dissectors/packet-echo.c b/epan/dissectors/packet-echo.c index 70d235f493..de0e236135 100644 --- a/epan/dissectors/packet-echo.c +++ b/epan/dissectors/packet-echo.c @@ -22,6 +22,7 @@ void proto_register_echo(void); void proto_reg_handoff_echo(void); +static dissector_handle_t echo_handle; static int proto_echo = -1; static int hf_echo_data = -1; @@ -75,14 +76,11 @@ void proto_register_echo(void) proto_echo = proto_register_protocol("Echo", "ECHO", "echo"); proto_register_field_array(proto_echo, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + echo_handle = register_dissector("echo", dissect_echo, proto_echo); } void proto_reg_handoff_echo(void) { - dissector_handle_t echo_handle; - - echo_handle = create_dissector_handle(dissect_echo, proto_echo); - dissector_add_uint_with_preference("udp.port", ECHO_PORT, echo_handle); dissector_add_uint_with_preference("tcp.port", ECHO_PORT, echo_handle); } diff --git a/epan/dissectors/packet-ecp.c b/epan/dissectors/packet-ecp.c index eaf22dd5dc..3a619cef31 100644 --- a/epan/dissectors/packet-ecp.c +++ b/epan/dissectors/packet-ecp.c @@ -21,6 +21,9 @@ void proto_register_vdp(void); void proto_reg_handoff_ecp_21(void); void proto_reg_handoff_vdp(void); +static dissector_handle_t ecp_handle; +static dissector_handle_t vdp_handle; + static int proto_ecp = -1; static int hf_ecp_version = -1; static int hf_ecp_op = -1; @@ -431,6 +434,7 @@ proto_register_ecp(void) proto_register_field_array(proto_ecp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + ecp_handle = register_dissector("ecp21", dissect_ecp, proto_ecp); ecp_subdissector_table = register_dissector_table("ecp.subtype", "ECP Subtypes", proto_ecp, FT_UINT32, BASE_DEC); } @@ -537,23 +541,18 @@ proto_register_vdp(void) expert_vdp = expert_register_protocol(proto_vdp); expert_register_field_array(expert_vdp, ei, array_length(ei)); + vdp_handle = register_dissector("vdp21", dissect_vdp, proto_vdp); } void proto_reg_handoff_ecp_21(void) { - dissector_handle_t ecp_handle; - - ecp_handle = create_dissector_handle(dissect_ecp, proto_ecp); dissector_add_uint("ethertype", ETHERTYPE_ECP, ecp_handle); } void proto_reg_handoff_vdp(void) { - dissector_handle_t vdp_handle; - - vdp_handle = create_dissector_handle(dissect_vdp, proto_vdp); dissector_add_uint("ecp.subtype", ECP_SUBTYPE_VDP, vdp_handle); } diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c index f2553b5687..af8caa5a14 100644 --- a/epan/dissectors/packet-edonkey.c +++ b/epan/dissectors/packet-edonkey.c @@ -31,6 +31,9 @@ void proto_reg_handoff_edonkey(void); +static dissector_handle_t edonkey_tcp_handle; +static dissector_handle_t edonkey_udp_handle; + static int proto_edonkey = -1; static int hf_edonkey_message = -1; @@ -3385,6 +3388,9 @@ void proto_register_edonkey(void) { expert_edonkey = expert_register_protocol(proto_edonkey); expert_register_field_array(expert_edonkey, ei, array_length(ei)); + edonkey_tcp_handle = register_dissector("edonkey.tcp", dissect_edonkey_tcp, proto_edonkey); + edonkey_udp_handle = register_dissector("edonkey.udp", dissect_edonkey_udp, proto_edonkey); + edonkey_module = prefs_register_protocol(proto_edonkey, NULL); prefs_register_bool_preference(edonkey_module, "desegment", "Reassemble eDonkey messages spanning multiple TCP segments", @@ -3395,12 +3401,6 @@ void proto_register_edonkey(void) { void proto_reg_handoff_edonkey(void) { - dissector_handle_t edonkey_tcp_handle; - dissector_handle_t edonkey_udp_handle; - - edonkey_tcp_handle = create_dissector_handle(dissect_edonkey_tcp, proto_edonkey); - edonkey_udp_handle = create_dissector_handle(dissect_edonkey_udp, proto_edonkey); - dissector_add_uint_range_with_preference("tcp.port", EDONKEY_TCP_PORT_RANGE, edonkey_tcp_handle); dissector_add_uint_range_with_preference("udp.port", EDONKEY_UDP_PORT_RANGE, edonkey_udp_handle); } diff --git a/epan/dissectors/packet-egd.c b/epan/dissectors/packet-egd.c index 1058a5a9b7..7aed5d76e2 100644 --- a/epan/dissectors/packet-egd.c +++ b/epan/dissectors/packet-egd.c @@ -41,6 +41,8 @@ void proto_register_egd(void); void proto_reg_handoff_egd(void); +static dissector_handle_t egd_handle; + /* Translate status to string */ static const value_string egd_stat_vals[] = { { EGD_ST_NONEW, "No new status event has occurred" }, @@ -224,13 +226,12 @@ void proto_register_egd(void) proto_egd = proto_register_protocol ("Ethernet Global Data", "EGD", "egd"); proto_register_field_array(proto_egd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + egd_handle = register_dissector("egd", dissect_egd, proto_egd); } void proto_reg_handoff_egd(void) { - dissector_handle_t egd_handle; - - egd_handle = create_dissector_handle(dissect_egd, proto_egd); dissector_add_uint_with_preference("udp.port", EGD_PORT, egd_handle); } diff --git a/epan/dissectors/packet-eiss.c b/epan/dissectors/packet-eiss.c index d4319a5822..55d9a385c2 100644 --- a/epan/dissectors/packet-eiss.c +++ b/epan/dissectors/packet-eiss.c @@ -19,6 +19,8 @@ void proto_register_eiss(void); void proto_reg_handoff_eiss(void); +static dissector_handle_t eiss_handle; + static int proto_eiss = -1; static int hf_eiss_reserved2 = -1; @@ -557,15 +559,14 @@ proto_register_eiss(void) proto_register_subtree_array(ett, array_length(ett)); expert_eiss = expert_register_protocol(proto_eiss); expert_register_field_array(expert_eiss, ei, array_length(ei)); + + eiss_handle = register_dissector("eiss", dissect_eiss, proto_eiss); } void proto_reg_handoff_eiss(void) { - dissector_handle_t eiss_handle; - - eiss_handle = create_dissector_handle(dissect_eiss, proto_eiss); dissector_add_uint("mpeg_sect.tid", EISS_SECTION_TID, eiss_handle); } diff --git a/epan/dissectors/packet-elasticsearch.c b/epan/dissectors/packet-elasticsearch.c index d6b5336167..35f1ad4e85 100644 --- a/epan/dissectors/packet-elasticsearch.c +++ b/epan/dissectors/packet-elasticsearch.c @@ -52,6 +52,9 @@ typedef struct { void proto_register_elasticsearch(void); void proto_reg_handoff_elasticsearch(void); +static dissector_handle_t elasticsearch_handle_binary; +static dissector_handle_t elasticsearch_zen_handle; + static int proto_elasticsearch = -1; /* Fields */ @@ -821,16 +824,13 @@ void proto_register_elasticsearch(void) { proto_register_field_array(proto_elasticsearch, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + elasticsearch_handle_binary = register_dissector("elasticsearch_binary", dissect_elasticsearch_binary, proto_elasticsearch); + elasticsearch_zen_handle = register_dissector("elasticsearch_zen_ping", dissect_elasticsearch_zen_ping, proto_elasticsearch); + } void proto_reg_handoff_elasticsearch(void) { - dissector_handle_t elasticsearch_handle_binary; - dissector_handle_t elasticsearch_zen_handle; - - elasticsearch_handle_binary = create_dissector_handle(dissect_elasticsearch_binary, proto_elasticsearch); - elasticsearch_zen_handle = create_dissector_handle(dissect_elasticsearch_zen_ping, proto_elasticsearch); - dissector_add_uint_with_preference("udp.port", ELASTICSEARCH_DISCOVERY_PORT, elasticsearch_zen_handle); dissector_add_uint_with_preference("tcp.port", ELASTICSEARCH_BINARY_PORT, elasticsearch_handle_binary); diff --git a/epan/dissectors/packet-elcom.c b/epan/dissectors/packet-elcom.c index 0b014672b5..790548a9f1 100644 --- a/epan/dissectors/packet-elcom.c +++ b/epan/dissectors/packet-elcom.c @@ -47,6 +47,8 @@ void proto_register_elcom(void); void proto_reg_handoff_elcom(void); +static dissector_handle_t elcom_handle; + static int proto_elcom = -1; static int hf_elcom_response = -1; static int hf_elcom_request = -1; @@ -741,14 +743,12 @@ proto_register_elcom(void) proto_register_field_array(proto_elcom, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + elcom_handle = register_dissector("elcom", dissect_elcom, proto_elcom); } void proto_reg_handoff_elcom(void) { - dissector_handle_t elcom_handle; - - elcom_handle = create_dissector_handle(dissect_elcom, proto_elcom); dissector_add_uint_with_preference("tcp.port", TCP_PORT_ELCOM, elcom_handle); } diff --git a/epan/dissectors/packet-elmi.c b/epan/dissectors/packet-elmi.c index 25ed68d8d9..5fa4661803 100644 --- a/epan/dissectors/packet-elmi.c +++ b/epan/dissectors/packet-elmi.c @@ -26,6 +26,8 @@ static int proto_elmi = -1; void proto_register_elmi(void); void proto_reg_handoff_elmi(void); +static dissector_handle_t elmi_handle; + static gint ett_elmi = -1; static gint ett_elmi_info_elem = -1; static gint ett_elmi_sub_info_elem = -1; @@ -512,15 +514,14 @@ proto_register_elmi(void) proto_register_field_array(proto_elmi, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + elmi_handle = register_dissector("elmi", dissect_elmi, proto_elmi); } void proto_reg_handoff_elmi(void) { - dissector_handle_t elmi_handle; - - elmi_handle = create_dissector_handle(dissect_elmi, proto_elmi); dissector_add_uint("ethertype", ETHERTYPE_ELMI, elmi_handle); } diff --git a/epan/dissectors/packet-enc.c b/epan/dissectors/packet-enc.c index aa762a45ad..9268a4d711 100644 --- a/epan/dissectors/packet-enc.c +++ b/epan/dissectors/packet-enc.c @@ -15,6 +15,10 @@ void proto_register_enc(void); void proto_reg_handoff_enc(void); +static dissector_handle_t enc_handle; +static capture_dissector_handle_t enc_cap_handle; + + /* The header in OpenBSD Encapsulating Interface files. */ struct enchdr { @@ -182,18 +186,15 @@ proto_register_enc(void) enc_dissector_table = register_dissector_table("enc", "OpenBSD Encapsulating device", proto_enc, FT_UINT32, BASE_DEC); register_capture_dissector_table("enc", "ENC"); + + enc_handle = register_dissector("enc", dissect_enc, proto_enc); + enc_cap_handle = register_capture_dissector("enc", capture_enc, proto_enc); } void proto_reg_handoff_enc(void) { - dissector_handle_t enc_handle; - capture_dissector_handle_t enc_cap_handle; - - enc_handle = create_dissector_handle(dissect_enc, proto_enc); dissector_add_uint("wtap_encap", WTAP_ENCAP_ENC, enc_handle); - - enc_cap_handle = create_capture_dissector_handle(capture_enc, proto_enc); capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_ENC, enc_cap_handle); } diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index 2e84b2f00b..ead578ce2c 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -448,6 +448,8 @@ static dissector_handle_t enip_udp_handle; static dissector_handle_t cipio_handle; static dissector_handle_t cip_class1_handle; static dissector_handle_t dtls_handle; +static dissector_handle_t dlr_handle; + static gboolean enip_desegment = TRUE; static gboolean enip_OTrun_idle = TRUE; @@ -5014,6 +5016,7 @@ proto_register_enip(void) FT_PROTOCOL); enip_tcp_handle = register_dissector("enip", dissect_enip_tcp, proto_enip); + enip_udp_handle = register_dissector("enip.udp", dissect_enip_udp, proto_enip); cipio_handle = register_dissector("cipio", dissect_cipio, proto_cipio); cip_class1_handle = register_dissector("cipio_class1", dissect_cip_class1, proto_cip_class1); cip_io_generic_handle = register_dissector("cipgenericio", dissect_cip_io_generic, proto_cipio); @@ -5063,6 +5066,7 @@ proto_register_enip(void) /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_dlr, hfdlr, array_length(hfdlr)); proto_register_subtree_array(ettdlr, array_length(ettdlr)); + dlr_handle = register_dissector("dlr", dissect_dlr, proto_dlr); register_conversation_filter("enip", "CIP Connection", cip_connection_conv_valid, cip_connection_conv_filter, NULL); @@ -5127,13 +5131,10 @@ int dissect_lldp_cip_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree void proto_reg_handoff_enip(void) { - dissector_handle_t dlr_handle; - /* Register for EtherNet/IP, using TCP */ dissector_add_uint_with_preference("tcp.port", ENIP_ENCAP_PORT, enip_tcp_handle); /* Register for EtherNet/IP, using UDP */ - enip_udp_handle = create_dissector_handle(dissect_enip_udp, proto_enip); dissector_add_uint_with_preference("udp.port", ENIP_ENCAP_PORT, enip_udp_handle); /* Register for EtherNet/IP IO data (UDP) */ @@ -5160,7 +5161,6 @@ proto_reg_handoff_enip(void) cip_handle = find_dissector_add_dependency("cip", proto_enip); /* Register for EtherNet/IP Device Level Ring protocol */ - dlr_handle = create_dissector_handle(dissect_dlr, proto_dlr); dissector_add_uint("ethertype", ETHERTYPE_DLR, dlr_handle); subdissector_class_table = find_dissector_table("cip.class.iface"); diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c index afa7134019..2611e12abe 100644 --- a/epan/dissectors/packet-enrp.c +++ b/epan/dissectors/packet-enrp.c @@ -35,6 +35,8 @@ void proto_register_enrp(void); void proto_reg_handoff_enrp(void); +static dissector_handle_t enrp_handle; + /* Initialize the protocol and registered fields */ static int enrp_tap = -1; static int proto_enrp = -1; @@ -1143,15 +1145,13 @@ proto_register_enrp(void) proto_register_subtree_array(ett, array_length(ett)); enrp_tap = register_tap("enrp"); + enrp_handle = register_dissector("enrp", dissect_enrp, proto_enrp); register_stat_tap_table_ui(&enrp_stat_table); } void proto_reg_handoff_enrp(void) { - dissector_handle_t enrp_handle; - - enrp_handle = create_dissector_handle(dissect_enrp, proto_enrp); dissector_add_uint("sctp.ppi", ENRP_PAYLOAD_PROTOCOL_ID, enrp_handle); dissector_add_uint("sctp.port", ENRP_SCTP_PORT, enrp_handle); dissector_add_uint_with_preference("udp.port", ENRP_UDP_PORT, enrp_handle); diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c index 1f1a66c504..16b0559804 100644 --- a/epan/dissectors/packet-enttec.c +++ b/epan/dissectors/packet-enttec.c @@ -59,6 +59,8 @@ static const value_string enttec_data_type_vals[] = { void proto_register_enttec(void); void proto_reg_handoff_enttec(void); +static dissector_handle_t enttec_udp_handle, enttec_tcp_handle; + /* Define the enttec proto */ static int proto_enttec = -1; @@ -530,6 +532,9 @@ proto_register_enttec(void) proto_register_field_array(proto_enttec,hf,array_length(hf)); proto_register_subtree_array(ett,array_length(ett)); + enttec_udp_handle = register_dissector("enttec.udp", dissect_enttec_udp,proto_enttec); + enttec_tcp_handle = register_dissector("enttec.tcp", dissect_enttec_tcp,proto_enttec); + enttec_module = prefs_register_protocol(proto_enttec, NULL); prefs_register_enum_preference(enttec_module, "dmx_disp_chan_val_type", @@ -554,11 +559,6 @@ proto_register_enttec(void) /* The registration hand-off routing */ void proto_reg_handoff_enttec(void) { - dissector_handle_t enttec_udp_handle, enttec_tcp_handle; - - enttec_udp_handle = create_dissector_handle(dissect_enttec_udp,proto_enttec); - enttec_tcp_handle = create_dissector_handle(dissect_enttec_tcp,proto_enttec); - dissector_add_uint_with_preference("tcp.port",TCP_PORT_ENTTEC,enttec_tcp_handle); dissector_add_uint_with_preference("udp.port",UDP_PORT_ENTTEC,enttec_udp_handle); } diff --git a/epan/dissectors/packet-eobi.c b/epan/dissectors/packet-eobi.c index 476168717a..38f5bb0e75 100644 --- a/epan/dissectors/packet-eobi.c +++ b/epan/dissectors/packet-eobi.c @@ -41,6 +41,8 @@ void proto_reg_handoff_eobi(void); void proto_register_eobi(void); +static dissector_handle_t eobi_handle; + static int proto_eobi = -1; static expert_field ei_eobi_counter_overflow = EI_INIT; static expert_field ei_eobi_invalid_template = EI_INIT; @@ -4313,14 +4315,13 @@ proto_register_eobi(void) static gint * const ett[] = { &ett_eobi[0], &ett_eobi[1], &ett_eobi[2], &ett_eobi[3], &ett_eobi[4], &ett_eobi[5], &ett_eobi[6], &ett_eobi_dscp }; proto_register_subtree_array(ett, array_length(ett)); proto_disable_by_default(proto_eobi); + + eobi_handle = register_dissector("eobi", dissect_eobi, proto_eobi); } void proto_reg_handoff_eobi(void) { - dissector_handle_t eobi_handle = create_dissector_handle(dissect_eobi, - proto_eobi); - // cf. N7 Network Access Guide, e.g. // https://www.xetra.com/xetra-en/technology/t7/system-documentation/release10-0/Release-10.0-2692700?frag=2692724 // https://www.xetra.com/resource/blob/2762078/388b727972b5122945eedf0e63c36920/data/N7-Network-Access-Guide-v2.0.59.pdf diff --git a/epan/dissectors/packet-epl.c b/epan/dissectors/packet-epl.c index 4b4e4cc92a..0e933ca639 100644 --- a/epan/dissectors/packet-epl.c +++ b/epan/dissectors/packet-epl.c @@ -1818,6 +1818,7 @@ static expert_field ei_sendseq_value = EI_INIT; static expert_field ei_real_length_differs = EI_INIT; static dissector_handle_t epl_handle; +static dissector_handle_t epl_udp_handle; static gboolean show_cmd_layer_for_duplicated = FALSE; static gboolean show_pdo_meta_info = FALSE; @@ -6356,6 +6357,7 @@ proto_register_epl(void) /* Registering protocol to be called by another dissector */ epl_handle = register_dissector("epl", dissect_epl, proto_epl); + epl_udp_handle = register_dissector("epl.udp", dissect_epludp, proto_epl); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_epl, hf, array_length(hf)); @@ -6450,8 +6452,6 @@ proto_register_epl(void) void proto_reg_handoff_epl(void) { - dissector_handle_t epl_udp_handle = create_dissector_handle(dissect_epludp, proto_epl); - dissector_add_uint("ethertype", ETHERTYPE_EPL_V2, epl_handle); dissector_add_uint_with_preference("udp.port", UDP_PORT_EPL, epl_udp_handle); apply_prefs(); diff --git a/epan/dissectors/packet-epl_v1.c b/epan/dissectors/packet-epl_v1.c index 94f31f4753..5c81dd75a0 100644 --- a/epan/dissectors/packet-epl_v1.c +++ b/epan/dissectors/packet-epl_v1.c @@ -25,6 +25,8 @@ void proto_register_epl_v1(void); void proto_reg_handoff_epl_v1(void); +static dissector_handle_t epl_v1_handle; + /* Offsets of fields within an EPL_V1 packet. */ #define EPL_V1_SERVICE_OFFSET 0 /* same offset for all message types*/ #define EPL_V1_DEST_OFFSET 1 /* same offset for all message types*/ @@ -626,6 +628,8 @@ proto_register_epl_v1(void) /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_epl_v1, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + epl_v1_handle = register_dissector("epl_v1", dissect_epl_v1, proto_epl_v1); } @@ -633,9 +637,6 @@ proto_register_epl_v1(void) void proto_reg_handoff_epl_v1(void) { - dissector_handle_t epl_v1_handle; - - epl_v1_handle = create_dissector_handle(dissect_epl_v1, proto_epl_v1); dissector_add_uint("ethertype", ETHERTYPE_EPL_V1, epl_v1_handle); } diff --git a/epan/dissectors/packet-epon.c b/epan/dissectors/packet-epon.c index e8b843a2fa..0ace6ab073 100644 --- a/epan/dissectors/packet-epon.c +++ b/epan/dissectors/packet-epon.c @@ -26,6 +26,8 @@ void proto_register_epon(void); void proto_reg_handoff_epon(void); +static dissector_handle_t epon_handle; + static int proto_epon = -1; static int hf_epon_dpoe_security = -1; static int hf_epon_dpoe_encrypted = -1; @@ -272,14 +274,12 @@ proto_register_epon(void) expert_epon = expert_register_protocol(proto_epon); expert_register_field_array(expert_epon, ei, array_length(ei)); + epon_handle = register_dissector("epon", dissect_epon, proto_epon); } void proto_reg_handoff_epon(void) { - dissector_handle_t epon_handle; - - epon_handle = create_dissector_handle(dissect_epon, proto_epon); dissector_add_uint("wtap_encap", WTAP_ENCAP_EPON, epon_handle); eth_maybefcs_handle = find_dissector_add_dependency("eth_maybefcs", proto_epon); diff --git a/epan/dissectors/packet-esio.c b/epan/dissectors/packet-esio.c index 6ebfd75ddb..fbb40672f5 100644 --- a/epan/dissectors/packet-esio.c +++ b/epan/dissectors/packet-esio.c @@ -21,6 +21,8 @@ void proto_register_esio(void); void proto_reg_handoff_esio(void); +static dissector_handle_t esio_handle; + #define ESIO_UDP_PORT 6060 /* Not IANA registered */ /* Initialize the protocol and registered fields */ @@ -401,14 +403,14 @@ proto_register_esio(void) proto_register_subtree_array(ett, array_length(ett)); expert_esio = expert_register_protocol(proto_esio); expert_register_field_array(expert_esio, ei, array_length(ei)); + +/* Register the dissector by name and save its handle */ + esio_handle = register_dissector("esio", dissect_esio, proto_esio); } void proto_reg_handoff_esio(void) { - dissector_handle_t esio_handle; - - esio_handle = create_dissector_handle(dissect_esio, proto_esio); dissector_add_uint_with_preference("udp.port", ESIO_UDP_PORT, esio_handle); } diff --git a/epan/dissectors/packet-eti.c b/epan/dissectors/packet-eti.c index 85db724188..e59a159bbd 100644 --- a/epan/dissectors/packet-eti.c +++ b/epan/dissectors/packet-eti.c @@ -41,6 +41,8 @@ void proto_reg_handoff_eti(void); void proto_register_eti(void); +static dissector_handle_t eti_handle; + static int proto_eti = -1; static expert_field ei_eti_counter_overflow = EI_INIT; static expert_field ei_eti_invalid_template = EI_INIT; @@ -14264,14 +14266,13 @@ proto_register_eti(void) proto_register_field_array(proto_eti, hf, array_length(hf)); static gint * const ett[] = { &ett_eti[0], &ett_eti[1], &ett_eti[2], &ett_eti[3], &ett_eti[4], &ett_eti[5], &ett_eti[6], &ett_eti[7], &ett_eti[8], &ett_eti[9], &ett_eti[10], &ett_eti[11], &ett_eti[12], &ett_eti[13], &ett_eti[14], &ett_eti[15], &ett_eti[16], &ett_eti[17], &ett_eti[18], &ett_eti[19], &ett_eti[20], &ett_eti[21], &ett_eti[22], &ett_eti[23], &ett_eti[24], &ett_eti[25], &ett_eti[26], &ett_eti[27], &ett_eti[28], &ett_eti[29], &ett_eti[30], &ett_eti[31], &ett_eti[32], &ett_eti[33], &ett_eti[34], &ett_eti[35], &ett_eti[36], &ett_eti[37], &ett_eti[38], &ett_eti[39], &ett_eti[40], &ett_eti[41], &ett_eti[42], &ett_eti[43], &ett_eti[44], &ett_eti[45], &ett_eti[46], &ett_eti[47], &ett_eti[48], &ett_eti[49], &ett_eti[50], &ett_eti[51], &ett_eti[52], &ett_eti_dscp }; proto_register_subtree_array(ett, array_length(ett)); + + eti_handle = register_dissector("eti", dissect_eti, proto_eti); } void proto_reg_handoff_eti(void) { - dissector_handle_t eti_handle = create_dissector_handle(dissect_eti, - proto_eti); - // cf. N7 Network Access Guide, e.g. // https://www.xetra.com/xetra-en/technology/t7/system-documentation/release10-0/Release-10.0-2692700?frag=2692724 // https://www.xetra.com/resource/blob/2762078/388b727972b5122945eedf0e63c36920/data/N7-Network-Access-Guide-v2.0.59.pdf diff --git a/epan/dissectors/packet-etv.c b/epan/dissectors/packet-etv.c index 8edf622521..22fbfa4aec 100644 --- a/epan/dissectors/packet-etv.c +++ b/epan/dissectors/packet-etv.c @@ -19,6 +19,9 @@ void proto_register_etv(void); void proto_reg_handoff_etv(void); +static dissector_handle_t etv_dii_handle; +static dissector_handle_t etv_ddb_handle; + static int proto_etv_dii = -1; static int proto_etv_ddb = -1; @@ -211,17 +214,15 @@ proto_register_etv(void) expert_register_field_array(expert_etv_dii, ei_dii, array_length(ei_dii)); expert_etv_ddb = expert_register_protocol(proto_etv_ddb); expert_register_field_array(expert_etv_ddb, ei_ddb, array_length(ei_ddb)); + + etv_dii_handle = register_dissector("etv-dii", dissect_etv_dii, proto_etv_dii); + etv_ddb_handle = register_dissector("etv-ddb", dissect_etv_ddb, proto_etv_ddb); } void proto_reg_handoff_etv(void) { - dissector_handle_t etv_dii_handle; - dissector_handle_t etv_ddb_handle; - - etv_dii_handle = create_dissector_handle(dissect_etv_dii, proto_etv_dii); - etv_ddb_handle = create_dissector_handle(dissect_etv_ddb, proto_etv_ddb); dissector_add_uint("mpeg_sect.tid", ETV_TID_DII_SECTION, etv_dii_handle); dissector_add_uint("mpeg_sect.tid", ETV_TID_DDB_SECTION, etv_ddb_handle); dsmcc_handle = find_dissector_add_dependency("mp2t-dsmcc", proto_etv_dii); diff --git a/epan/dissectors/packet-etw.c b/epan/dissectors/packet-etw.c index d46c9f8b32..cb0518a09c 100644 --- a/epan/dissectors/packet-etw.c +++ b/epan/dissectors/packet-etw.c @@ -22,6 +22,8 @@ void proto_register_etw(void); void proto_reg_handoff_etw(void); +static dissector_handle_t etw_handle; + static int proto_etw = -1; static int hf_etw_size = -1; static int hf_etw_header_type = -1; @@ -310,14 +312,13 @@ proto_register_etw(void) proto_etw = proto_register_protocol("Event Tracing for Windows", "ETW", "etw"); proto_register_field_array(proto_etw, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + etw_handle = register_dissector("etw", dissect_etw, proto_etw); } void proto_reg_handoff_etw(void) { - static dissector_handle_t etw_handle; - - etw_handle = create_dissector_handle(dissect_etw, proto_etw); dissector_add_uint("wtap_encap", WTAP_ENCAP_ETW, etw_handle); mbim_dissector = find_dissector("mbim.control"); diff --git a/epan/dissectors/packet-evrc.c b/epan/dissectors/packet-evrc.c index af0b09acf0..982d7c9f14 100644 --- a/epan/dissectors/packet-evrc.c +++ b/epan/dissectors/packet-evrc.c @@ -37,6 +37,13 @@ void proto_register_evrc(void); void proto_reg_handoff_evrc(void); +static dissector_handle_t evrc_handle; +static dissector_handle_t evrcb_handle; +static dissector_handle_t evrcwb_handle; +static dissector_handle_t evrcnw_handle; +static dissector_handle_t evrcnw2k_handle; +static dissector_handle_t evrc_legacy_handle; + static const value_string evrc_frame_type_vals[] = { { 0, "Blank (0 bits)" }, { 1, "1/8 Rate (16 bits)" }, @@ -594,6 +601,13 @@ proto_register_evrc(void) proto_register_subtree_array(ett, array_length(ett)); + evrc_handle = register_dissector("evrc", dissect_evrc, proto_evrc); + evrcb_handle = register_dissector("evrcb", dissect_evrcb, proto_evrcb); + evrcwb_handle = register_dissector("evrcwb", dissect_evrcwb, proto_evrcwb); + evrcnw_handle = register_dissector("evrcnw", dissect_evrcnw, proto_evrcnw); + evrcnw2k_handle = register_dissector("evrcnw2k", dissect_evrcnw2k, proto_evrcnw2k); + evrc_legacy_handle = register_dissector("evrc_legacy", dissect_evrc_legacy, proto_evrc_legacy); + expert_evrc = expert_register_protocol(proto_evrc); expert_register_field_array(expert_evrc, ei, array_length(ei)); @@ -615,23 +629,9 @@ void proto_reg_handoff_evrc(void) { static gboolean evrc_prefs_initialized = FALSE; - static dissector_handle_t evrc_legacy_handle; if (!evrc_prefs_initialized) { - dissector_handle_t evrc_handle; - dissector_handle_t evrcb_handle; - dissector_handle_t evrcwb_handle; - dissector_handle_t evrcnw_handle; - dissector_handle_t evrcnw2k_handle; - - evrc_handle = create_dissector_handle(dissect_evrc, proto_evrc); - evrcb_handle = create_dissector_handle(dissect_evrcb, proto_evrcb); - evrcwb_handle = create_dissector_handle(dissect_evrcwb, proto_evrcwb); - evrcnw_handle = create_dissector_handle(dissect_evrcnw, proto_evrcnw); - evrcnw2k_handle = create_dissector_handle(dissect_evrcnw2k, proto_evrcnw2k); - evrc_legacy_handle = create_dissector_handle(dissect_evrc_legacy, proto_evrc_legacy); - /* header-full mime types */ dissector_add_string("rtp_dyn_payload_type", "EVRC", evrc_handle); dissector_add_string("rtp_dyn_payload_type", "EVRCB", evrcb_handle); diff --git a/epan/dissectors/packet-extreme-exeh.c b/epan/dissectors/packet-extreme-exeh.c index 579c35ae1b..0ea9f8ef0d 100644 --- a/epan/dissectors/packet-extreme-exeh.c +++ b/epan/dissectors/packet-extreme-exeh.c @@ -50,6 +50,8 @@ void proto_register_exeh(void); void proto_reg_handoff_exeh(void); +static dissector_handle_t exeh_handle; + static dissector_handle_t ethnofcs_handle; static int proto_exeh = -1; @@ -289,16 +291,15 @@ proto_register_exeh(void) proto_register_subtree_array(ett, array_length(ett)); expert_exeh = expert_register_protocol(proto_exeh); expert_register_field_array(expert_exeh, ei, array_length(ei)); + + exeh_handle = register_dissector("exeh", dissect_exeh, proto_exeh); } void proto_reg_handoff_exeh(void) { - dissector_handle_t exeh_handle; - ethnofcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_exeh); - exeh_handle = create_dissector_handle(dissect_exeh, proto_exeh); dissector_add_uint("ethertype", ETHERTYPE_EXEH, exeh_handle); } diff --git a/epan/dissectors/packet-extrememesh.c b/epan/dissectors/packet-extrememesh.c index e0bc16b1db..6feea178b9 100644 --- a/epan/dissectors/packet-extrememesh.c +++ b/epan/dissectors/packet-extrememesh.c @@ -63,6 +63,8 @@ typedef enum _MeshPathSelectionFrameType void proto_register_extrememesh(void); void proto_reg_handoff_extrememesh(void); +static dissector_handle_t extrememesh_handle; + /* Mesh pkt types */ static int proto_extrememesh = -1; static int proto_extrememesh_mch = -1; @@ -2441,6 +2443,8 @@ void proto_register_extrememesh(void) proto_register_field_array(proto_extrememesh, hf_extrememesh, array_length(hf_extrememesh)); proto_register_subtree_array(ett, array_length(ett)); + extrememesh_handle = register_dissector("extrememesh", dissect_extrememesh, proto_extrememesh); + /* extrememesh mesh control header */ proto_extrememesh_mch = proto_register_protocol("Extreme Mesh Control Header", "EXTREME MCH", "extrememesh_mch"); proto_register_field_array(proto_extrememesh_mch, hf_extrememesh_mch, array_length(hf_extrememesh_mch)); @@ -2547,10 +2551,7 @@ dissector table. /*****************************************************************************/ void proto_reg_handoff_extrememesh(void) { - static dissector_handle_t extrememesh_handle; - eth_withoutfcs_handle = find_dissector("eth_withoutfcs"); - extrememesh_handle = create_dissector_handle(dissect_extrememesh, proto_extrememesh); dissector_add_uint("ethertype", ETHERTYPE_IEEE_EXTREME_MESH, extrememesh_handle); } diff --git a/epan/dissectors/packet-f5ethtrailer.c b/epan/dissectors/packet-f5ethtrailer.c index 670a741bf6..60c13a776f 100644 --- a/epan/dissectors/packet-f5ethtrailer.c +++ b/epan/dissectors/packet-f5ethtrailer.c @@ -220,6 +220,10 @@ void proto_register_f5ethtrailer(void); void proto_reg_handoff_f5fileinfo(void); void proto_register_f5fileinfo(void); +static dissector_handle_t f5dpt_noise_handle; +static dissector_handle_t f5dpt_tls_handle; + + /* Common Fields */ static gint hf_provider = -1; static gint hf_type = -1; @@ -4113,6 +4117,10 @@ proto_register_f5ethtrailer(void) tls_subdissector_table = register_dissector_table("f5ethtrailer.tls_type_ver", "F5 Ethernet Trailer TLS", proto_f5ethtrailer, FT_UINT32, BASE_DEC); + f5dpt_noise_handle = + register_dissector("f5ethtrailer.noise", dissect_dpt_trailer_noise, proto_f5ethtrailer_dpt_noise); + f5dpt_tls_handle = register_dissector("f5ethtrailer.tls", dissect_dpt_trailer_tls, proto_f5ethtrailer_dpt_tls); + /* Analyze Menu Items */ register_conversation_filter("f5ethtrailer", "F5 TCP", f5_tcp_conv_valid, f5_tcp_conv_filter, NULL); register_conversation_filter("f5ethtrailer", "F5 UDP", f5_udp_conv_valid, f5_udp_conv_filter, NULL); @@ -4139,40 +4147,34 @@ proto_register_f5ethtrailer(void) void proto_reg_handoff_f5ethtrailer(void) { - dissector_handle_t f5dpt_noise_handle; - dissector_handle_t f5dpt_tls_handle; - heur_dissector_add("eth.trailer", dissect_f5ethtrailer, "F5 Ethernet Trailer", "f5ethtrailer", proto_f5ethtrailer, HEURISTIC_ENABLE); /* Register helper dissectors */ /* Noise Provider */ - f5dpt_noise_handle = - create_dissector_handle(dissect_dpt_trailer_noise, proto_f5ethtrailer_dpt_noise); dissector_add_uint("f5ethtrailer.provider", F5_DPT_PROVIDER_NOISE, f5dpt_noise_handle); dissector_add_uint("f5ethtrailer.noise_type_ver", F5TYPE_LOW << 16 | 2, - create_dissector_handle(dissect_dpt_trailer_noise_low, -1)); + create_dissector_handle(dissect_dpt_trailer_noise_low, proto_f5ethtrailer_dpt_noise)); dissector_add_uint("f5ethtrailer.noise_type_ver", F5TYPE_LOW << 16 | 3, - create_dissector_handle(dissect_dpt_trailer_noise_low, -1)); + create_dissector_handle(dissect_dpt_trailer_noise_low, proto_f5ethtrailer_dpt_noise)); dissector_add_uint("f5ethtrailer.noise_type_ver", F5TYPE_LOW << 16 | 4, - create_dissector_handle(dissect_dpt_trailer_noise_low, -1)); + create_dissector_handle(dissect_dpt_trailer_noise_low, proto_f5ethtrailer_dpt_noise)); dissector_add_uint("f5ethtrailer.noise_type_ver", F5TYPE_MED << 16 | 4, - create_dissector_handle(dissect_dpt_trailer_noise_med, -1)); + create_dissector_handle(dissect_dpt_trailer_noise_med, proto_f5ethtrailer_dpt_noise)); dissector_add_uint("f5ethtrailer.noise_type_ver", F5TYPE_HIGH << 16 | 1, - create_dissector_handle(dissect_dpt_trailer_noise_high, -1)); + create_dissector_handle(dissect_dpt_trailer_noise_high, proto_f5ethtrailer_dpt_noise)); /* TLS provider */ - f5dpt_tls_handle = create_dissector_handle(dissect_dpt_trailer_tls, proto_f5ethtrailer_dpt_tls); dissector_add_uint("f5ethtrailer.provider", F5_DPT_PROVIDER_TLS, f5dpt_tls_handle); dissector_add_uint("f5ethtrailer.tls_type_ver", F5_DPT_TLS_PRE13_STD << 16 | 0, - create_dissector_handle(dissect_dpt_trailer_tls_type0, -1)); + create_dissector_handle(dissect_dpt_trailer_tls_type0, proto_f5ethtrailer_dpt_tls)); dissector_add_uint("f5ethtrailer.tls_type_ver", F5_DPT_TLS_PRE13_EXT << 16 | 0, - create_dissector_handle(dissect_dpt_trailer_tls_extended, -1)); + create_dissector_handle(dissect_dpt_trailer_tls_extended, proto_f5ethtrailer_dpt_tls)); dissector_add_uint("f5ethtrailer.tls_type_ver", F5_DPT_TLS_13_STD << 16 | 0, - create_dissector_handle(dissect_dpt_trailer_tls_type2, -1)); + create_dissector_handle(dissect_dpt_trailer_tls_type2, proto_f5ethtrailer_dpt_tls)); dissector_add_uint("f5ethtrailer.tls_type_ver", F5_DPT_TLS_13_STD << 16 | 1, - create_dissector_handle(dissect_dpt_trailer_tls_type2, -1)); + create_dissector_handle(dissect_dpt_trailer_tls_type2, proto_f5ethtrailer_dpt_tls)); dissector_add_uint("f5ethtrailer.tls_type_ver", F5_DPT_TLS_13_EXT << 16 | 0, - create_dissector_handle(dissect_dpt_trailer_tls_extended, -1)); + create_dissector_handle(dissect_dpt_trailer_tls_extended, proto_f5ethtrailer_dpt_tls)); /* These fields are duplicates of other, well-known fields so that * filtering on these fields will also pick up data out of the diff --git a/epan/dissectors/packet-fc00.c b/epan/dissectors/packet-fc00.c index 843b041d4c..f2b1952efd 100644 --- a/epan/dissectors/packet-fc00.c +++ b/epan/dissectors/packet-fc00.c @@ -24,6 +24,8 @@ void proto_reg_handoff_fc00(void); void proto_register_fc00(void); +static dissector_handle_t fc00_handle; + /* Initialize the protocol and registered fields */ static int proto_fc00 = -1; static int hf_fc00_session_state = -1; @@ -265,14 +267,13 @@ proto_register_fc00(void) proto_register_field_array(proto_fc00, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + fc00_handle = register_dissector("fc00", dissect_cryptoauth, proto_fc00); } void proto_reg_handoff_fc00(void) { - dissector_handle_t fc00_handle; - - fc00_handle = create_dissector_handle(dissect_cryptoauth, proto_fc00); dissector_add_for_decode_as_with_preference("udp.port", fc00_handle); } diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c index cf7673be7b..21499a26eb 100644 --- a/epan/dissectors/packet-fcct.c +++ b/epan/dissectors/packet-fcct.c @@ -19,6 +19,8 @@ void proto_register_fcct(void); void proto_reg_handoff_fcct(void); +static dissector_handle_t fcct_handle; + /* Initialize the protocol and registered fields */ static int proto_fcct = -1; static int hf_fcct_revision = -1; @@ -264,14 +266,13 @@ proto_register_fcct(void) fcct_gserver_table = register_dissector_table ("fcct.server", "FCCT Server", proto_fcct, FT_UINT8, BASE_HEX); + + fcct_handle = register_dissector("fcct", dissect_fcct, proto_fcct); } void proto_reg_handoff_fcct (void) { - dissector_handle_t fcct_handle; - - fcct_handle = create_dissector_handle (dissect_fcct, proto_fcct); dissector_add_uint("fc.ftype", FC_FTYPE_FCCT, fcct_handle); } diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c index 0de57a7905..24a91fed99 100644 --- a/epan/dissectors/packet-fcdns.c +++ b/epan/dissectors/packet-fcdns.c @@ -2083,7 +2083,7 @@ proto_register_fcdns (void) fcdns_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcdns_hash, fcdns_equal); - dns_handle = create_dissector_handle (dissect_fcdns, proto_fcdns); + dns_handle = register_dissector("fcdns", dissect_fcdns, proto_fcdns); } void diff --git a/epan/dissectors/packet-fcels.c b/epan/dissectors/packet-fcels.c index b40ff0219b..cde67885ec 100644 --- a/epan/dissectors/packet-fcels.c +++ b/epan/dissectors/packet-fcels.c @@ -25,6 +25,8 @@ void proto_register_fcels(void); void proto_reg_handoff_fcels(void); +static dissector_handle_t els_handle; + #define FC_ELS_RPLY 0 #define FC_ELS_REQ 1 @@ -2592,14 +2594,13 @@ proto_register_fcels (void) expert_fcels = expert_register_protocol(proto_fcels); expert_register_field_array(expert_fcels, ei, array_length(ei)); fcels_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcels_hash, fcels_equal); + + els_handle = register_dissector("fcels", dissect_fcels, proto_fcels); } void proto_reg_handoff_fcels (void) { - dissector_handle_t els_handle; - - els_handle = create_dissector_handle (dissect_fcels, proto_fcels); dissector_add_uint("fc.ftype", FC_FTYPE_ELS, els_handle); fcsp_handle = find_dissector_add_dependency ("fcsp", proto_fcels); diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c index 81300431ce..96dd05f5e3 100644 --- a/epan/dissectors/packet-fcfcs.c +++ b/epan/dissectors/packet-fcfcs.c @@ -21,6 +21,8 @@ void proto_register_fcfcs(void); void proto_reg_handoff_fcfcs(void); +static dissector_handle_t fcs_handle; + /* * See the FC-GS3 specification. */ @@ -1016,15 +1018,13 @@ proto_register_fcfcs (void) expert_register_field_array(expert_fcfcs, ei, array_length(ei)); fcfcs_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcfcs_hash, fcfcs_equal); + + fcs_handle = register_dissector("fcs", dissect_fcfcs, proto_fcfcs); } void proto_reg_handoff_fcfcs (void) { - dissector_handle_t fcs_handle; - - fcs_handle = create_dissector_handle (dissect_fcfcs, proto_fcfcs); - dissector_add_uint("fcct.server", FCCT_GSRVR_FCS, fcs_handle); } diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c index 1c2b764e85..4cbf519318 100644 --- a/epan/dissectors/packet-fcfzs.c +++ b/epan/dissectors/packet-fcfzs.c @@ -21,6 +21,8 @@ void proto_register_fcfzs(void); void proto_reg_handoff_fcfzs(void); +static dissector_handle_t fzs_handle; + /* Initialize the protocol and registered fields */ static int proto_fcfzs = -1; static int hf_fcfzs_opcode = -1; @@ -842,14 +844,13 @@ proto_register_fcfzs(void) expert_register_field_array(expert_fcfzs, ei, array_length(ei)); fcfzs_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcfzs_hash, fcfzs_equal); + + fzs_handle = register_dissector("fcfzs", dissect_fcfzs, proto_fcfzs); } void proto_reg_handoff_fcfzs(void) { - dissector_handle_t fzs_handle; - - fzs_handle = create_dissector_handle(dissect_fcfzs, proto_fcfzs); dissector_add_uint("fcct.server", FCCT_GSRVR_FZS, fzs_handle); } diff --git a/epan/dissectors/packet-fcp.c b/epan/dissectors/packet-fcp.c index 88b79e4104..74c4939383 100644 --- a/epan/dissectors/packet-fcp.c +++ b/epan/dissectors/packet-fcp.c @@ -21,6 +21,8 @@ void proto_register_fcp(void); void proto_reg_handoff_fcp(void); +static dissector_handle_t fcp_handle; + typedef struct _fcp_proto_data_t { guint16 lun; } fcp_proto_data_t; @@ -962,14 +964,13 @@ proto_register_fcp(void) /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_fcp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + fcp_handle = register_dissector("fcp", dissect_fcp, proto_fcp); } void proto_reg_handoff_fcp(void) { - dissector_handle_t fcp_handle; - - fcp_handle = create_dissector_handle(dissect_fcp, proto_fcp); dissector_add_uint("fc.ftype", FC_FTYPE_SCSI, fcp_handle); } diff --git a/epan/dissectors/packet-fcsb3.c b/epan/dissectors/packet-fcsb3.c index dff8456ddc..d520f4e72a 100644 --- a/epan/dissectors/packet-fcsb3.c +++ b/epan/dissectors/packet-fcsb3.c @@ -19,6 +19,8 @@ void proto_register_fcsbccs(void); void proto_reg_handoff_fcsbccs(void); +static dissector_handle_t fc_sbccs_handle; + /* Initialize the protocol and registered fields */ static int proto_fc_sbccs = -1; static int hf_sbccs_chid = -1; @@ -1119,16 +1121,13 @@ proto_register_fcsbccs (void) proto_register_field_array(proto_fc_sbccs, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + fc_sbccs_handle = register_dissector("fcsb3", dissect_fc_sbccs, proto_fc_sbccs); } void proto_reg_handoff_fcsbccs (void) { - dissector_handle_t fc_sbccs_handle; - - fc_sbccs_handle = create_dissector_handle (dissect_fc_sbccs, - proto_fc_sbccs); - dissector_add_uint("fc.ftype", FC_FTYPE_SBCCS, fc_sbccs_handle); } diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index 4f4fbfc9eb..e9fb3e704e 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -21,6 +21,8 @@ void proto_register_fcswils(void); void proto_reg_handoff_fcswils(void); +static dissector_handle_t swils_handle; + /* * See the FC-SW specifications. */ @@ -2500,14 +2502,13 @@ proto_register_fcswils(void) expert_register_field_array(expert_fcswils, ei, array_length(ei)); fcswils_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcswils_hash, fcswils_equal); + + swils_handle = register_dissector("swils", dissect_fcswils, proto_fcswils); } void proto_reg_handoff_fcswils(void) { - dissector_handle_t swils_handle; - - swils_handle = create_dissector_handle(dissect_fcswils, proto_fcswils); dissector_add_uint("fc.ftype", FC_FTYPE_SWILS, swils_handle); fcsp_handle = find_dissector_add_dependency("fcsp", proto_fcswils); diff --git a/epan/dissectors/packet-fefd.c b/epan/dissectors/packet-fefd.c index 7ef3cdfbb9..d77c146e71 100644 --- a/epan/dissectors/packet-fefd.c +++ b/epan/dissectors/packet-fefd.c @@ -18,6 +18,8 @@ void proto_register_fefd(void); void proto_reg_handoff_fefd(void); +static dissector_handle_t fefd_handle; + /* Offsets in TLV structure. */ #define TLV_TYPE 0 #define TLV_LENGTH 2 @@ -264,14 +266,13 @@ proto_register_fefd(void) proto_fefd = proto_register_protocol("Far End Failure Detection", "FEFD", "fefd"); proto_register_field_array(proto_fefd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + fefd_handle = register_dissector("fefd", dissect_fefd, proto_fefd); } void proto_reg_handoff_fefd(void) { - dissector_handle_t fefd_handle; - - fefd_handle = create_dissector_handle(dissect_fefd, proto_fefd); dissector_add_uint("llc.force10_pid", 0x0111, fefd_handle); } diff --git a/epan/dissectors/packet-ff.c b/epan/dissectors/packet-ff.c index 186fc179c4..6d7ae3d509 100644 --- a/epan/dissectors/packet-ff.c +++ b/epan/dissectors/packet-ff.c @@ -15274,6 +15274,9 @@ proto_register_ff(void) proto_ff = proto_register_protocol("FOUNDATION Fieldbus", "FF", "ff"); proto_register_field_array(proto_ff, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + ff_udp_handle = register_dissector("ff.udp", dissect_ff_udp, proto_ff); + ff_tcp_handle = register_dissector("ff.tcp", dissect_ff_tcp, proto_ff); } @@ -15284,8 +15287,6 @@ proto_reg_handoff_ff(void) /* * 4.8. Using UDP and TCP */ - ff_udp_handle = create_dissector_handle(dissect_ff_udp, proto_ff); - ff_tcp_handle = create_dissector_handle(dissect_ff_tcp, proto_ff); /* * 4.8.4.2. Use diff --git a/epan/dissectors/packet-finger.c b/epan/dissectors/packet-finger.c index 99f1cad312..c6e7e25722 100644 --- a/epan/dissectors/packet-finger.c +++ b/epan/dissectors/packet-finger.c @@ -19,6 +19,8 @@ void proto_register_finger(void); void proto_reg_handoff_finger(void); +static dissector_handle_t finger_handle; + #define FINGER_PORT 79 /* This is the registered IANA port */ static int proto_finger = -1; @@ -185,7 +187,7 @@ proto_register_finger(void) }; proto_finger = proto_register_protocol("finger", "FINGER", "finger"); - register_dissector("finger", dissect_finger, proto_finger); + finger_handle = register_dissector("finger", dissect_finger, proto_finger); proto_register_field_array(proto_finger, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_finger = expert_register_protocol(proto_finger); @@ -195,7 +197,7 @@ proto_register_finger(void) void proto_reg_handoff_finger(void) { - dissector_add_uint_with_preference("tcp.port", FINGER_PORT, find_dissector("finger")); + dissector_add_uint_with_preference("tcp.port", FINGER_PORT, finger_handle); } /* diff --git a/epan/dissectors/packet-flexnet.c b/epan/dissectors/packet-flexnet.c index 575d0d7c6c..2f52bbad54 100644 --- a/epan/dissectors/packet-flexnet.c +++ b/epan/dissectors/packet-flexnet.c @@ -30,6 +30,8 @@ void proto_register_flexnet(void); void proto_reg_handoff_flexnet(void); +static dissector_handle_t flexnet_handle; + #define FLEXNET_ADRLEN 15 #define FLEXNET_CTLLEN 15 #define FLEXNET_HDRLEN (FLEXNET_ADRLEN + FLEXNET_ADRLEN + FLEXNET_CTLLEN) @@ -115,12 +117,14 @@ proto_register_flexnet(void) /* Required function calls to register the header fields and subtrees used */ proto_register_field_array( proto_flexnet, hf, array_length( hf ) ); proto_register_subtree_array( ett, array_length( ett ) ); + + flexnet_handle = register_dissector( "flexnet", dissect_flexnet, proto_flexnet ); } void proto_reg_handoff_flexnet(void) { - dissector_add_uint( "ax25.pid", AX25_P_FLEXNET, create_dissector_handle( dissect_flexnet, proto_flexnet ) ); + dissector_add_uint( "ax25.pid", AX25_P_FLEXNET, flexnet_handle ); } /* diff --git a/epan/dissectors/packet-flexray.c b/epan/dissectors/packet-flexray.c index b10b627b8c..a63ed22500 100644 --- a/epan/dissectors/packet-flexray.c +++ b/epan/dissectors/packet-flexray.c @@ -23,6 +23,8 @@ void proto_reg_handoff_flexray(void); void proto_register_flexray(void); +static dissector_handle_t flexray_handle; + static gboolean prefvar_try_heuristic_first = FALSE; static dissector_table_t subdissector_table; @@ -493,7 +495,7 @@ proto_register_flexray(void) expert_flexray = expert_register_protocol(proto_flexray); expert_register_field_array(expert_flexray, ei, array_length(ei)); - register_dissector("flexray", dissect_flexray, proto_flexray); + flexray_handle = register_dissector("flexray", dissect_flexray, proto_flexray); prefs_register_bool_preference( flexray_module, @@ -512,9 +514,6 @@ proto_register_flexray(void) void proto_reg_handoff_flexray(void) { - static dissector_handle_t flexray_handle; - - flexray_handle = create_dissector_handle( dissect_flexray, proto_flexray ); dissector_add_uint("wtap_encap", WTAP_ENCAP_FLEXRAY, flexray_handle); } diff --git a/epan/dissectors/packet-flip.c b/epan/dissectors/packet-flip.c index 4260f5cf7e..621504bb8f 100644 --- a/epan/dissectors/packet-flip.c +++ b/epan/dissectors/packet-flip.c @@ -45,6 +45,8 @@ void proto_register_flip(void); void proto_reg_handoff_flip(void); +static dissector_handle_t flip_handle; + static int proto_flip = -1; /* BASIC */ @@ -436,7 +438,7 @@ proto_register_flip(void) "FLIP", /* short name */ "flip" /* abbrev */ ); - register_dissector("flip", dissect_flip, proto_flip); + flip_handle = register_dissector("flip", dissect_flip, proto_flip); proto_register_field_array(proto_flip, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -459,7 +461,7 @@ proto_register_flip(void) void proto_reg_handoff_flip(void) { - dissector_add_uint("ethertype", ETHERTYPE_FLIP, find_dissector("flip")); + dissector_add_uint("ethertype", ETHERTYPE_FLIP, flip_handle); } /* proto_reg_handoff_flip() */ /* diff --git a/epan/dissectors/packet-forces.c b/epan/dissectors/packet-forces.c index ec03210b9c..d395e37847 100644 --- a/epan/dissectors/packet-forces.c +++ b/epan/dissectors/packet-forces.c @@ -19,6 +19,8 @@ void proto_register_forces(void); void proto_reg_handoff_forces(void); +static dissector_handle_t forces_handle_tcp, forces_handle; + static dissector_handle_t ip_handle; /* Initialize the ForCES protocol and registered fields */ @@ -814,6 +816,9 @@ proto_register_forces(void) expert_forces = expert_register_protocol(proto_forces); expert_register_field_array(expert_forces, ei, array_length(ei)); + forces_handle_tcp = register_dissector("forces.tcp", dissect_forces_tcp, proto_forces); + forces_handle = register_dissector("forces", dissect_forces_not_tcp, proto_forces); + forces_module = prefs_register_protocol(proto_forces,proto_reg_handoff_forces); prefs_register_uint_preference(forces_module, "sctp_high_prio_port", @@ -841,11 +846,7 @@ proto_reg_handoff_forces(void) static guint alternate_sctp_med_prio_channel_port = 0; static guint alternate_sctp_low_prio_channel_port = 0; - static dissector_handle_t forces_handle_tcp, forces_handle; - if (!inited) { - forces_handle_tcp = create_dissector_handle(dissect_forces_tcp, proto_forces); - forces_handle = create_dissector_handle(dissect_forces_not_tcp, proto_forces); ip_handle = find_dissector_add_dependency("ip", proto_forces); /* Register TCP port for dissection */ dissector_add_for_decode_as_with_preference("tcp.port", forces_handle_tcp); diff --git a/epan/dissectors/packet-foundry.c b/epan/dissectors/packet-foundry.c index cb7e6c3add..c1e28b14de 100644 --- a/epan/dissectors/packet-foundry.c +++ b/epan/dissectors/packet-foundry.c @@ -22,6 +22,8 @@ void proto_register_fdp(void); void proto_reg_handoff_fdp(void); +static dissector_handle_t fdp_handle; + static int hf_llc_foundry_pid = -1; static int proto_fdp = -1; @@ -446,14 +448,13 @@ proto_register_fdp(void) expert_register_field_array(expert_fdp, ei, array_length(ei)); llc_add_oui(OUI_FOUNDRY, "llc.foundry_pid", "LLC Foundry OUI PID", oui_hf, proto_fdp); + + fdp_handle = register_dissector("fdp", dissect_fdp, proto_fdp); } void proto_reg_handoff_fdp(void) { - dissector_handle_t fdp_handle; - - fdp_handle = create_dissector_handle(dissect_fdp, proto_fdp); dissector_add_uint("llc.foundry_pid", 0x2000, fdp_handle); } diff --git a/epan/dissectors/packet-fractalgeneratorprotocol.c b/epan/dissectors/packet-fractalgeneratorprotocol.c index 368a0e11e3..244ae8365d 100644 --- a/epan/dissectors/packet-fractalgeneratorprotocol.c +++ b/epan/dissectors/packet-fractalgeneratorprotocol.c @@ -24,6 +24,8 @@ void proto_register_fractalgeneratorprotocol(void); void proto_reg_handoff_fractalgeneratorprotocol(void); +static dissector_handle_t fgp_handle; + #define FRACTALGENERATORPROTOCOL_PAYLOAD_PROTOCOL_ID_LEGACY 0x29097601 @@ -477,14 +479,13 @@ proto_register_fractalgeneratorprotocol(void) tap_fractalgeneratorprotocol = register_tap("fractalgeneratorprotocol"); register_stat_tap_table_ui(&fgp_stat_table); + + fgp_handle = register_dissector("fractalgeneratorprotocol", dissect_fractalgeneratorprotocol, proto_fractalgeneratorprotocol); } void proto_reg_handoff_fractalgeneratorprotocol(void) { - dissector_handle_t fgp_handle; - - fgp_handle = create_dissector_handle(dissect_fractalgeneratorprotocol, proto_fractalgeneratorprotocol); dissector_add_uint("sctp.ppi", FRACTALGENERATORPROTOCOL_PAYLOAD_PROTOCOL_ID_LEGACY, fgp_handle); dissector_add_uint("sctp.ppi", FGP_PAYLOAD_PROTOCOL_ID, fgp_handle); } |