diff options
author | Michael Mann <mmann78@netscape.net> | 2015-10-07 13:50:11 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-10-08 06:15:51 +0000 |
commit | ec82648b0989d409adcc404df69b691a260f16e9 (patch) | |
tree | e38922d9fe1f1b99f8eecb34c0a45238ba753324 /epan | |
parent | 4a20f576da686237bcb66edeb1e195364ddd2a49 (diff) |
Replace or rename "duplicate" UDP protocols shown in Decode As
Change-Id: I8cfd1c223c70c7e03728af8b2f7cbf9354d7ad86
Ping-Bug: 3949
Reviewed-on: https://code.wireshark.org/review/10865
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-bat.c | 31 | ||||
-rw-r--r-- | epan/dissectors/packet-cpfi.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 50 | ||||
-rw-r--r-- | epan/dissectors/packet-dns.c | 13 | ||||
-rw-r--r-- | epan/dissectors/packet-enip.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-gtp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-mint.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-opensafety.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-pktc.c | 13 | ||||
-rw-r--r-- | epan/dissectors/packet-ptp.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-quic.c | 14 |
11 files changed, 73 insertions, 95 deletions
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c index 795f575566..df3ba7cc58 100644 --- a/epan/dissectors/packet-bat.c +++ b/epan/dissectors/packet-bat.c @@ -158,12 +158,9 @@ static const value_string vis_packettypenames[] = { }; /* supported packet dissectors */ -static void dissect_bat_batman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); -static void dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); -static void dissect_bat_vis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -176,6 +173,8 @@ static dissector_handle_t ip_handle; static dissector_handle_t data_handle; static int proto_bat_plugin = -1; +static int proto_bat_gw = -1; +static int proto_bat_vis = -1; /* tap */ static int bat_tap = -1; @@ -388,13 +387,9 @@ static void dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; proto_tree *bat_gw_entry_tree; - if (PTREE_DATA(tree)->visible) { - ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 1, - "B.A.T.M.A.N. GW [%s]", - val_to_str(gw_packeth->type, gw_packettypenames, "Unknown (0x%02x)")); - } else { - ti = proto_tree_add_item(tree, proto_bat_plugin, tvb, 0, 1, ENC_NA); - } + ti = proto_tree_add_protocol_format(tree, proto_bat_gw, tvb, 0, 1, + "B.A.T.M.A.N. GW [%s]", + val_to_str(gw_packeth->type, gw_packettypenames, "Unknown (0x%02x)")); bat_gw_entry_tree = proto_item_add_subtree(ti, ett_bat_gw); proto_tree_add_item(bat_gw_entry_tree, hf_bat_gw_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -478,7 +473,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t if (tree) { proto_item *ti; - ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V22_SIZE, + ti = proto_tree_add_protocol_format(tree, proto_bat_vis, tvb, 0, VIS_PACKET_V22_SIZE, "B.A.T.M.A.N. Vis, Src: %s", address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); bat_vis_tree = proto_item_add_subtree(ti, ett_bat_vis); @@ -599,7 +594,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t if (tree) { proto_item *ti; - ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V23_SIZE, + ti = proto_tree_add_protocol_format(tree, proto_bat_vis, tvb, 0, VIS_PACKET_V23_SIZE, "B.A.T.M.A.N. Vis, Src: %s", address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); bat_vis_tree = proto_item_add_subtree(ti, ett_bat_vis); @@ -849,11 +844,9 @@ void proto_register_bat(void) &ett_bat_vis_entry }; - proto_bat_plugin = proto_register_protocol( - "B.A.T.M.A.N. Layer 3 Protocol", - "BAT", /* short name */ - "bat" /* abbrev */ - ); + proto_bat_plugin = proto_register_protocol("B.A.T.M.A.N. Layer 3 Protocol", "BAT", "bat"); + proto_bat_gw = proto_register_protocol("B.A.T.M.A.N. GW", "BAT GW", "bat.gw"); + proto_bat_vis = proto_register_protocol("B.A.T.M.A.N. Vis", "BAT VIS", "bat.vis"); /* Register our configuration options for B.A.T.M.A.N. */ bat_module = prefs_register_protocol(proto_bat_plugin, proto_reg_handoff_bat); @@ -890,8 +883,8 @@ void proto_reg_handoff_bat(void) bat_follow_tap = register_tap("batman_follow"); batman_handle = create_dissector_handle(dissect_bat_batman, proto_bat_plugin); - gw_handle = create_dissector_handle(dissect_bat_gw, proto_bat_plugin); - vis_handle = create_dissector_handle(dissect_bat_vis, proto_bat_plugin); + gw_handle = create_dissector_handle(dissect_bat_gw, proto_bat_gw); + vis_handle = create_dissector_handle(dissect_bat_vis, proto_bat_vis); ip_handle = find_dissector("ip"); data_handle = find_dissector("data"); diff --git a/epan/dissectors/packet-cpfi.c b/epan/dissectors/packet-cpfi.c index 532be332e7..2598f8da89 100644 --- a/epan/dissectors/packet-cpfi.c +++ b/epan/dissectors/packet-cpfi.c @@ -530,7 +530,6 @@ proto_reg_handoff_cpfi(void) { static gboolean cpfi_init_complete = FALSE; static dissector_handle_t cpfi_handle; - static dissector_handle_t ttot_handle; static guint cpfi_udp_port; static guint cpfi_ttot_udp_port; @@ -538,20 +537,19 @@ proto_reg_handoff_cpfi(void) { fc_handle = find_dissector("fc"); cpfi_handle = new_create_dissector_handle(dissect_cpfi, proto_cpfi); - ttot_handle = new_create_dissector_handle(dissect_cpfi, proto_cpfi); cpfi_init_complete = TRUE; } else { dissector_delete_uint("udp.port", cpfi_udp_port, cpfi_handle); - dissector_delete_uint("udp.port", cpfi_ttot_udp_port, ttot_handle); + dissector_delete_uint("udp.port", cpfi_ttot_udp_port, cpfi_handle); } cpfi_udp_port = gbl_cpfi_udp_port; cpfi_ttot_udp_port = gbl_cpfi_ttot_udp_port; dissector_add_uint("udp.port", cpfi_udp_port, cpfi_handle); - dissector_add_uint("udp.port", cpfi_ttot_udp_port, ttot_handle); + dissector_add_uint("udp.port", cpfi_ttot_udp_port, cpfi_handle); } /* diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 470fc47e3b..f2b5f58e71 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -741,7 +741,7 @@ initialize_hopount_info(hopcount_info *hpi) { static void dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - gboolean downstream, int off, int eoff, hopcount_info hpi); + int off, int eoff, hopcount_info hpi); static int dissect_packetcable_ccc_option(proto_tree *v_tree, proto_item *v_item, packet_info *pinfo, tvbuff_t *tvb, int optoff, @@ -1280,7 +1280,7 @@ cablelabs_fmt_docsis_version( gchar *result, guint32 revision ) /* Returns the number of bytes consumed by this option. */ static int dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, - gboolean downstream, int off, int eoff, gboolean *at_end, int protocol, hopcount_info hpi) + int off, int eoff, gboolean *at_end, int protocol, hopcount_info hpi) { guint16 opttype, hwtype, subopt_type; int temp_optlen, optlen, subopt_len; /* 16-bit values that need 16-bit rollover protection */ @@ -1438,7 +1438,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, temp_optlen = 12; while ((optlen - temp_optlen) > 0) { - temp_optlen += dhcpv6_option(tvb, pinfo, subtree, downstream, + temp_optlen += dhcpv6_option(tvb, pinfo, subtree, off+temp_optlen, off + optlen, at_end, protocol, hpi); if (*at_end) { /* Bad option - just skip to the end */ @@ -1455,7 +1455,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, 4, tvb_arphrdaddr_to_str(tvb, off, 4, opttype)); /* XXX: IAID is opaque ? review ... */ temp_optlen = 4; while ((optlen - temp_optlen) > 0) { - temp_optlen += dhcpv6_option(tvb, pinfo, subtree, downstream, + temp_optlen += dhcpv6_option(tvb, pinfo, subtree, off+temp_optlen, off + optlen, at_end, protocol, hpi); if (*at_end) { /* Bad option - just skip to the end */ @@ -1495,7 +1495,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, temp_optlen = 24; while ((optlen - temp_optlen) > 0) { - temp_optlen += dhcpv6_option(tvb, pinfo, subtree, downstream, + temp_optlen += dhcpv6_option(tvb, pinfo, subtree, off+temp_optlen, off + optlen, at_end, protocol, hpi); if (*at_end) { /* Bad option - just skip to the end */ @@ -1533,7 +1533,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, expert_add_info_format(pinfo, option_item, &ei_dhcpv6_malformed_option, "RELAY-MSG: malformed option"); } else { /* here, we should dissect a full DHCP message */ - dissect_dhcpv6(tvb, pinfo, subtree, downstream, off, off + optlen, hpi); + dissect_dhcpv6(tvb, pinfo, subtree, off, off + optlen, hpi); } break; case OPTION_AUTH: @@ -1800,7 +1800,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, temp_optlen = 17; while ((optlen - temp_optlen) > 0) { temp_optlen += dhcpv6_option(tvb, pinfo, subtree, - downstream, off + temp_optlen, + off + temp_optlen, off + optlen, at_end, protocol, hpi); if (*at_end) { /* Bad option - just skip to the end */ @@ -1813,7 +1813,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, temp_optlen = 0; while ((optlen - temp_optlen) > 0) { temp_optlen += dhcpv6_option(tvb, pinfo, subtree, - downstream, off + temp_optlen, + off + temp_optlen, off + optlen, at_end, protocol, hpi); if (*at_end) { /* Bad option - just skip to the end */ @@ -1889,7 +1889,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_tree_add_item(subtree, hf_iaprefix_pref_addr, tvb, off+9, 16, ENC_NA); temp_optlen = 25; while ((optlen - temp_optlen) > 0) { - temp_optlen += dhcpv6_option(tvb, pinfo, subtree, downstream, + temp_optlen += dhcpv6_option(tvb, pinfo, subtree, off+temp_optlen, off + optlen, at_end, protocol, hpi); if (*at_end) { /* Bad option - just skip to the end */ @@ -1936,7 +1936,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, /* May be called recursively */ static void dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - gboolean downstream, int off, int eoff, hopcount_info hpi) + int off, int eoff, hopcount_info hpi) { proto_tree *bp_tree = NULL; proto_item *ti; @@ -1990,30 +1990,19 @@ dissect_dhcpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, at_end = FALSE; while ((off < eoff) && !at_end) - off += dhcpv6_option(tvb, pinfo, bp_tree, downstream, off, eoff, &at_end, proto_dhcpv6, hpi); -} - -static void -dissect_dhcpv6_downstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ - hopcount_info hpi; - initialize_hopount_info(&hpi); - col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCPv6"); - col_clear(pinfo->cinfo, COL_INFO); - dissect_dhcpv6(tvb, pinfo, tree, TRUE, 0, tvb_reported_length(tvb), hpi); + off += dhcpv6_option(tvb, pinfo, bp_tree, off, eoff, &at_end, proto_dhcpv6, hpi); } static void -dissect_dhcpv6_upstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_dhcpv6_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { hopcount_info hpi; initialize_hopount_info(&hpi); col_set_str(pinfo->cinfo, COL_PROTOCOL, "DHCPv6"); col_clear(pinfo->cinfo, COL_INFO); - dissect_dhcpv6(tvb, pinfo, tree, FALSE, 0, tvb_reported_length(tvb), hpi); + dissect_dhcpv6(tvb, pinfo, tree, 0, tvb_reported_length(tvb), hpi); } - static guint get_dhcpv6_bulk_leasequery_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) @@ -2066,7 +2055,7 @@ dissect_dhcpv6_bulk_leasequery_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree option_tree = proto_tree_add_subtree(bulk_tree, tvb, offset, -1, ett_dhcpv6_bulk_leasequery_options, NULL, "DHCPv6 Options"); end = size + 2; while ((offset < end) && !at_end) - offset += dhcpv6_option(tvb, pinfo, option_tree, FALSE, offset, + offset += dhcpv6_option(tvb, pinfo, option_tree, offset, end, &at_end, proto_dhcpv6_bulk_leasequery, hpi); return tvb_reported_length(tvb); @@ -2397,9 +2386,8 @@ proto_register_dhcpv6(void) expert_dhcpv6_bulk_leasequery = expert_register_protocol(proto_dhcpv6_bulk_leasequery); expert_register_field_array(expert_dhcpv6_bulk_leasequery, ei_bulk_leasequery, array_length(ei_bulk_leasequery)); - /* Allow other dissectors to find this one by name. - Just choose upstream version for now as they are identical. */ - register_dissector("dhcpv6", dissect_dhcpv6_upstream, proto_dhcpv6); + /* Allow other dissectors to find this one by name. */ + register_dissector("dhcpv6", dissect_dhcpv6_stream, proto_dhcpv6); dhcpv6_module = prefs_register_protocol(proto_dhcpv6, NULL); prefs_register_bool_preference(dhcpv6_module, "cablelabs_interface_id", @@ -2419,12 +2407,10 @@ proto_reg_handoff_dhcpv6(void) { dissector_handle_t dhcpv6_handle, dhcpv6_bulkquery_handle; - dhcpv6_handle = create_dissector_handle(dissect_dhcpv6_downstream, - proto_dhcpv6); + dhcpv6_handle = create_dissector_handle(dissect_dhcpv6_stream, proto_dhcpv6); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_DOWNSTREAM, dhcpv6_handle); - dhcpv6_handle = create_dissector_handle(dissect_dhcpv6_upstream, - proto_dhcpv6); dissector_add_uint("udp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_handle); + dhcpv6_bulkquery_handle = new_create_dissector_handle(dissect_dhcpv6_bulk_leasequery, proto_dhcpv6_bulk_leasequery); dissector_add_uint("tcp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_bulkquery_handle); diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 9766e58f93..748b39347e 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -105,6 +105,8 @@ static int st_node_response_nauthorities = -1; static int st_node_response_nadditionals = -1; static int proto_dns = -1; +static int proto_mdns = -1; +static int proto_llmnr = -1; static int hf_dns_length = -1; static int hf_dns_flags = -1; static int hf_dns_flags_response = -1; @@ -3660,8 +3662,11 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } if (tree) { if (is_llmnr) { - ti = proto_tree_add_protocol_format(tree, proto_dns, tvb, 0, -1, + ti = proto_tree_add_protocol_format(tree, proto_llmnr, tvb, 0, -1, "Link-local Multicast Name Resolution (%s)", (flags & F_RESPONSE) ? "response" : "query"); + } else if (is_mdns){ + ti = proto_tree_add_protocol_format(tree, proto_mdns, tvb, 0, -1, + "Domain Name System (%s)", (flags & F_RESPONSE) ? "response" : "query"); } else { ti = proto_tree_add_protocol_format(tree, proto_dns, tvb, 0, -1, "Domain Name System (%s)", (flags & F_RESPONSE) ? "response" : "query"); @@ -4071,8 +4076,8 @@ proto_reg_handoff_dns(void) dissector_add_uint_range("udp.port", dns_udp_port_range, dns_udp_handle); dns_sctp_handle = create_dissector_handle(dissect_dns_sctp, proto_dns); - mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, proto_dns); - llmnr_udp_handle = create_dissector_handle(dissect_llmnr_udp, proto_dns); + mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, proto_mdns); + llmnr_udp_handle = create_dissector_handle(dissect_llmnr_udp, proto_llmnr); dissector_add_uint("udp.port", UDP_PORT_MDNS, mdns_udp_handle); dissector_add_uint("tcp.port", TCP_PORT_MDNS, dns_tcp_handle); @@ -5524,6 +5529,8 @@ proto_register_dns(void) expert_module_t* expert_dns; proto_dns = proto_register_protocol("Domain Name Service", "DNS", "dns"); + proto_mdns = proto_register_protocol("Multicast Domain Name Service", "mDNS", "mdns"); + proto_llmnr = proto_register_protocol("Link-local Multicast Name Resolution", "LLMNR", "llmnr"); proto_register_field_array(proto_dns, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_dns = expert_register_protocol(proto_dns); diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index 8cf74f0c34..2f5c444341 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -92,6 +92,7 @@ void proto_reg_handoff_enip(void); /* Initialize the protocol and registered fields */ static int proto_enip = -1; +static int proto_enipio = -1; static int proto_cipsafety = -1; static int hf_enip_command = -1; @@ -2394,9 +2395,6 @@ dissect_enipio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ENIP"); - /* In the interest of speed, if "tree" is NULL, don't do any work not - necessary to generate protocol tree items. */ - /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_enip, tvb, 0, -1, ENC_NA ); @@ -3691,6 +3689,7 @@ proto_register_enip(void) /* Register the protocol name and description */ proto_enip = proto_register_protocol("EtherNet/IP (Industrial Protocol)", "ENIP", "enip"); + proto_enipio = proto_register_protocol("EtherNet/IP I/O", "ENIP I/O", "enip_io"); new_register_dissector("enip", dissect_enip_tcp, proto_enip); @@ -3761,7 +3760,7 @@ proto_reg_handoff_enip(void) dissector_add_uint("udp.port", ENIP_ENCAP_PORT, enip_udp_handle); /* Register for EtherNet/IP IO data (UDP) */ - enipio_handle = create_dissector_handle(dissect_enipio, proto_enip); + enipio_handle = create_dissector_handle(dissect_enipio, proto_enipio); dissector_add_uint("udp.port", ENIP_IO_PORT, enipio_handle); /* Find dissector for data packet */ diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index 7b16666cd3..e78518ef97 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -101,6 +101,7 @@ static guint g_gtpv1c_port = GTPv1C_PORT; static guint g_gtpv1u_port = GTPv1U_PORT; static int proto_gtp = -1; +static int proto_gtpprim = -1; /*KTi*/ static int hf_gtp_ie_id = -1; @@ -9756,6 +9757,9 @@ proto_register_gtp(void) proto_gtp = proto_register_protocol("GPRS Tunneling Protocol", "GTP", "gtp"); + /* Created to remove Decode As confusion */ + proto_gtpprim = proto_register_protocol("GPRS Tunneling Protocol Prim", "GTP (Prim)", "gtpprim"); + proto_register_field_array(proto_gtp, hf_gtp, array_length(hf_gtp)); proto_register_subtree_array(ett_gtp_array, array_length(ett_gtp_array)); expert_gtp = expert_register_protocol(proto_gtp); @@ -9788,7 +9792,7 @@ proto_register_gtp(void) prefs_register_bool_preference(gtp_module, "dissect_gtp_over_tcp", "Dissect GTP over TCP", "Dissect GTP over TCP", &g_gtp_over_tcp); new_register_dissector("gtp", dissect_gtp, proto_gtp); - new_register_dissector("gtpprim", dissect_gtpprim, proto_gtp); + new_register_dissector("gtpprim", dissect_gtpprim, proto_gtpprim); gtp_priv_ext_dissector_table = register_dissector_table("gtp.priv_ext", "GTP PRIVATE EXT", FT_UINT16, BASE_DEC); gtp_cdr_fmt_dissector_table = register_dissector_table("gtp.cdr_fmt", "GTP DATA RECORD TYPE", FT_UINT16, BASE_DEC); diff --git a/epan/dissectors/packet-mint.c b/epan/dissectors/packet-mint.c index 80f612729e..c8fcedc07e 100644 --- a/epan/dissectors/packet-mint.c +++ b/epan/dissectors/packet-mint.c @@ -318,9 +318,6 @@ dissect_mint_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 element_length; static header_field_info *display_hfi_tlv_vals; - if (!tree) - return packet_length; - packet_type = tvb_get_ntohs(tvb, offset + 12); col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME); @@ -721,15 +718,18 @@ proto_register_mint(void) &ett_mint_data, }; - int proto_mint; + int proto_mint, proto_mint_data; proto_mint = proto_register_protocol(PROTO_LONG_NAME, PROTO_SHORT_NAME, "mint"); + /* Created to remove Decode As confusion */ + proto_mint_data = proto_register_protocol("Media indepentend Network Transport Data", "MiNT (Data)", "mint_data"); + hfi_mint = proto_registrar_get_nth(proto_mint); proto_register_fields(proto_mint, hfi, array_length(hfi)); proto_register_subtree_array(ett, array_length(ett)); mint_control_handle = new_create_dissector_handle(dissect_mint_control_static, proto_mint); - mint_data_handle = new_create_dissector_handle(dissect_mint_data_static, proto_mint); + mint_data_handle = new_create_dissector_handle(dissect_mint_data_static, proto_mint_data); mint_eth_handle = new_create_dissector_handle(dissect_mint_ethshim_static, proto_mint); } diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c index f389d14e4b..f0507898f8 100644 --- a/epan/dissectors/packet-opensafety.c +++ b/epan/dissectors/packet-opensafety.c @@ -2374,8 +2374,8 @@ dissect_opensafety_udpdata(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree static void apply_prefs ( void ) { - static dissector_handle_t opensafety_udpdata_handle; - static dissector_handle_t opensafety_siii_handle; + static dissector_handle_t opensafety_udpdata_handle = NULL; + static dissector_handle_t opensafety_siii_handle = NULL; static guint opensafety_udp_port_number; static guint opensafety_udp_siii_port_number; static gboolean opensafety_init = FALSE; @@ -2400,12 +2400,12 @@ apply_prefs ( void ) opensafety_udp_siii_port_number = global_network_udp_port_sercosiii; /* Default UDP only based dissector */ - dissector_add_uint("udp.port", opensafety_udp_port_number, find_dissector("opensafety_udpdata")); + dissector_add_uint("udp.port", opensafety_udp_port_number, opensafety_udpdata_handle); /* Sercos III dissector does not handle UDP transport, has to be handled * separately, everything else should be caught by the heuristic dissector */ - dissector_add_uint("udp.port", opensafety_udp_siii_port_number, find_dissector("opensafety_siii")); + dissector_add_uint("udp.port", opensafety_udp_siii_port_number, opensafety_siii_handle); } diff --git a/epan/dissectors/packet-pktc.c b/epan/dissectors/packet-pktc.c index a4f758719f..93a7d8905b 100644 --- a/epan/dissectors/packet-pktc.c +++ b/epan/dissectors/packet-pktc.c @@ -48,6 +48,7 @@ void proto_register_pktc_mtafqdn(void); void proto_reg_handoff_pktc_mtafqdn(void); static int proto_pktc = -1; +static int proto_pktc_mtafqdn = -1; static gint hf_pktc_app_spec_data = -1; static gint hf_pktc_list_of_ciphersuites = -1; static gint hf_pktc_list_of_ciphersuites_len = -1; @@ -777,15 +778,17 @@ proto_register_pktc_mtafqdn(void) }; static ei_register_info ei[] = { - { &ei_pktc_unknown_kmmid, { "pktc.unknown_kmmid", PI_PROTOCOL, PI_WARN, "Unknown KMMID", EXPFILL }}, - { &ei_pktc_unknown_doi, { "pktc.unknown_doi", PI_PROTOCOL, PI_WARN, "Unknown DOI", EXPFILL }}, + { &ei_pktc_unknown_kmmid, { "pktc.mtafqdn.unknown_kmmid", PI_PROTOCOL, PI_WARN, "Unknown KMMID", EXPFILL }}, + { &ei_pktc_unknown_doi, { "pktc.mtafqdn.unknown_doi", PI_PROTOCOL, PI_WARN, "Unknown DOI", EXPFILL }}, }; expert_module_t* expert_pktc; - proto_register_field_array(proto_pktc, hf, array_length(hf)); + proto_pktc_mtafqdn = proto_register_protocol("PacketCable MTA FQDN", "PKTC MTA FQDN", "pktc.mtafqdn"); + + proto_register_field_array(proto_pktc_mtafqdn, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - expert_pktc = expert_register_protocol(proto_pktc); + expert_pktc = expert_register_protocol(proto_pktc_mtafqdn); expert_register_field_array(expert_pktc, ei, array_length(ei)); } @@ -794,7 +797,7 @@ proto_reg_handoff_pktc_mtafqdn(void) { dissector_handle_t pktc_mtafqdn_handle; - pktc_mtafqdn_handle = create_dissector_handle(dissect_pktc_mtafqdn, proto_pktc); + pktc_mtafqdn_handle = create_dissector_handle(dissect_pktc_mtafqdn, proto_pktc_mtafqdn); dissector_add_uint("udp.port", PKTC_MTAFQDN_PORT, pktc_mtafqdn_handle); } diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c index d688dc017f..e9ced18d7a 100644 --- a/epan/dissectors/packet-ptp.c +++ b/epan/dissectors/packet-ptp.c @@ -5980,16 +5980,14 @@ proto_register_ptp(void) void proto_reg_handoff_ptp(void) { - dissector_handle_t event_port_ptp_handle; - dissector_handle_t general_port_ptp_handle; + dissector_handle_t ptp_handle; dissector_handle_t ethertype_ptp_handle; - event_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp); - general_port_ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp); + ptp_handle = create_dissector_handle(dissect_ptp, proto_ptp); ethertype_ptp_handle = create_dissector_handle(dissect_ptp_oE, proto_ptp); - dissector_add_uint("udp.port", EVENT_PORT_PTP, event_port_ptp_handle); - dissector_add_uint("udp.port", GENERAL_PORT_PTP, general_port_ptp_handle); + dissector_add_uint("udp.port", EVENT_PORT_PTP, ptp_handle); + dissector_add_uint("udp.port", GENERAL_PORT_PTP, ptp_handle); dissector_add_uint("ethertype", ETHERTYPE_PTP, ethertype_ptp_handle); } diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index 3c61d90bf2..c81c698c93 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -1574,13 +1574,6 @@ dissect_quic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return dissect_quic_common(tvb, pinfo, tree, NULL); } -static int -dissect_quics(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - void *data _U_) -{ - return dissect_quic_common(tvb, pinfo, tree, NULL); -} - void proto_register_quic(void) { @@ -2137,20 +2130,17 @@ proto_reg_handoff_quic(void) { static gboolean initialized = FALSE; static dissector_handle_t quic_handle; - static dissector_handle_t quics_handle; static int current_quic_port; static int current_quics_port; if (!initialized) { quic_handle = new_create_dissector_handle(dissect_quic, proto_quic); - quics_handle = new_create_dissector_handle(dissect_quics, - proto_quic); initialized = TRUE; } else { dissector_delete_uint("udp.port", current_quic_port, quic_handle); - dissector_delete_uint("udp.port", current_quics_port, quics_handle); + dissector_delete_uint("udp.port", current_quics_port, quic_handle); } current_quic_port = g_quic_port; @@ -2158,7 +2148,7 @@ proto_reg_handoff_quic(void) dissector_add_uint("udp.port", current_quic_port, quic_handle); - dissector_add_uint("udp.port", current_quics_port, quics_handle); + dissector_add_uint("udp.port", current_quics_port, quic_handle); } |