diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2015-10-05 22:43:46 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-10-14 12:18:00 +0000 |
commit | a643d14187c5a201d21bdb0786acc5e27b73a3a1 (patch) | |
tree | b09f0b90fe25a25765fd00279f549df429119cf6 /epan/dissectors | |
parent | 9a702e41b052211424163829a2cb3487123b155e (diff) |
Change proto_tree_add_ipv6() to take a struct e_in6_addr pointer
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too.
Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88
Reviewed-on: https://code.wireshark.org/review/10953
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors')
25 files changed, 55 insertions, 57 deletions
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index 61e1985558..6028f215db 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -1215,7 +1215,7 @@ dissect_6lowpan_hc1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dg /* Display the source address. */ if (tree) { proto_tree_add_ipv6(tree, hf_6lowpan_source, tvb, offset>>3, - BITS_TO_BYTE_LEN(offset, (bit_offset-offset)), (guint8 *)&ipv6.ip6_src); + BITS_TO_BYTE_LEN(offset, (bit_offset-offset)), &ipv6.ip6_src); } /* * Do not set the address columns until after defragmentation, since we have @@ -1247,7 +1247,7 @@ dissect_6lowpan_hc1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dg /* Display the destination address. */ if (tree) { proto_tree_add_ipv6(tree, hf_6lowpan_dest, tvb, offset>>3, - BITS_TO_BYTE_LEN(offset, (bit_offset-offset)), (guint8 *)&ipv6.ip6_dst); + BITS_TO_BYTE_LEN(offset, (bit_offset-offset)), &ipv6.ip6_dst); } /* * Do not set the address columns until after defragmentation, since we have @@ -1663,13 +1663,13 @@ dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint d /* Display the source IPv6 address. */ if (tree) { - proto_tree_add_ipv6(tree, hf_6lowpan_source, tvb, offset, length, (guint8 *)&ipv6.ip6_src); + proto_tree_add_ipv6(tree, hf_6lowpan_source, tvb, offset, length, &ipv6.ip6_src); } /* Add information about where the context came from. */ /* TODO: We should display the prefix length too. */ if (tree && sctx->plen) { proto_item *ti; - ti = proto_tree_add_ipv6(iphc_tree, hf_6lowpan_iphc_sctx_prefix, tvb, 0, 0, (guint8 *)&sctx->prefix); + ti = proto_tree_add_ipv6(iphc_tree, hf_6lowpan_iphc_sctx_prefix, tvb, 0, 0, &sctx->prefix); PROTO_ITEM_SET_GENERATED(ti); if ( sctx->frame ) { ti = proto_tree_add_uint(iphc_tree, hf_6lowpan_iphc_sctx_origin, tvb, 0, 0, sctx->frame); @@ -1790,13 +1790,13 @@ dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint d /* Display the destination IPv6 address. */ if (tree) { - proto_tree_add_ipv6(tree, hf_6lowpan_dest, tvb, offset, length, (guint8 *)&ipv6.ip6_dst); + proto_tree_add_ipv6(tree, hf_6lowpan_dest, tvb, offset, length, &ipv6.ip6_dst); } /* Add information about where the context came from. */ /* TODO: We should display the prefix length too. */ if (tree && dctx->plen) { proto_item *ti; - ti = proto_tree_add_ipv6(iphc_tree, hf_6lowpan_iphc_dctx_prefix, tvb, 0, 0, (guint8 *)&dctx->prefix); + ti = proto_tree_add_ipv6(iphc_tree, hf_6lowpan_iphc_dctx_prefix, tvb, 0, 0, &dctx->prefix); PROTO_ITEM_SET_GENERATED(ti); if ( dctx->frame ) { ti = proto_tree_add_uint(iphc_tree, hf_6lowpan_iphc_dctx_origin, tvb, 0, 0, dctx->frame); diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 09a88901dd..140496fff8 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -1859,8 +1859,7 @@ decode_prefix6(proto_tree *tree, packet_info *pinfo, int hf_addr, tvbuff_t *tvb, address_to_str(wmem_packet_scope(), &addr_str), plen); proto_tree_add_uint_format(prefix_tree, hf_bgp_prefix_length, tvb, offset, 1, plen, "%s prefix length: %u", tag, plen); - proto_tree_add_ipv6(prefix_tree, hf_addr, tvb, offset + 1, length, - addr.bytes); + proto_tree_add_ipv6(prefix_tree, hf_addr, tvb, offset + 1, length, &addr); return(1 + length); } @@ -1897,8 +1896,7 @@ decode_fspec_match_prefix6(proto_tree *tree, proto_item *parent_item, int hf_add address_to_str(wmem_packet_scope(), &addr_str), plen); proto_tree_add_item(prefix_tree, hf_bgp_flowspec_nlri_ipv6_pref_len, tvb, offset + plength_place, 1, ENC_BIG_ENDIAN); proto_tree_add_item(prefix_tree, hf_bgp_flowspec_nlri_ipv6_pref_offset, tvb, offset + poffset_place, 1, ENC_BIG_ENDIAN); - proto_tree_add_ipv6(prefix_tree, hf_addr, tvb, offset + 2, length, - addr.bytes); + proto_tree_add_ipv6(prefix_tree, hf_addr, tvb, offset + 2, length, &addr); if (parent_item != NULL) proto_item_append_text(parent_item, " (%s/%u)", address_to_str(wmem_packet_scope(), &addr_str), plen); @@ -4307,7 +4305,7 @@ decode_prefix_MP(proto_tree *tree, int hf_addr4, int hf_addr6, proto_tree_add_item(prefix_tree, hf_bgp_mp_nlri_tnl_id, tvb, start_offset + 1, 2, ENC_BIG_ENDIAN); - proto_tree_add_ipv6(prefix_tree, hf_addr6, tvb, offset, length, ip6addr.bytes); + proto_tree_add_ipv6(prefix_tree, hf_addr6, tvb, offset, length, &ip6addr); total_length = (1 + 2) + length; /* length field + Tunnel Id + IPv4 len */ break; diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index 6553d28d0e..b5258d43f9 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -4583,7 +4583,7 @@ dissect_dcerpc_cn_rts(tvbuff_t *tvb, gint offset, packet_info *pinfo, case RTS_IPV6: { struct e_in6_addr addr6; tvb_get_ipv6(tvb, offset, &addr6); - proto_tree_add_ipv6_format_value(cn_rts_command_tree, hf_dcerpc_cmd_client_ipv6, tvb, offset, 16, (const guint8 *)&addr6, "%s", get_hostname6(&addr6)); + proto_tree_add_ipv6_format_value(cn_rts_command_tree, hf_dcerpc_cmd_client_ipv6, tvb, offset, 16, &addr6, "%s", get_hostname6(&addr6)); offset += 16; } break; } diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c index 8c6f93a4fb..f855bdb545 100644 --- a/epan/dissectors/packet-diameter.c +++ b/epan/dissectors/packet-diameter.c @@ -510,7 +510,7 @@ dissect_diameter_base_framed_ipv6_prefix(tvbuff_t *tvb, packet_info *pinfo _U_, memset(&value.bytes, 0, sizeof(value)); tvb_memcpy(tvb, (guint8 *)&value.bytes, 2, prefix_len_bytes); value.bytes[prefix_len_bytes] = value.bytes[prefix_len_bytes] & (0xff<<(prefix_len % 8)); - proto_tree_add_ipv6(tree, hf_framed_ipv6_prefix_ipv6, tvb, 2, prefix_len_bytes, value.bytes); + proto_tree_add_ipv6(tree, hf_framed_ipv6_prefix_ipv6, tvb, 2, prefix_len_bytes, &value); SET_ADDRESS(&addr, AT_IPv6, 16, value.bytes); diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "%s/%u", address_to_str(wmem_packet_scope(), &addr), prefix_len); } diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 748b39347e..ddb90c2158 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -2633,7 +2633,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, proto_tree_add_item(rr_tree, hf_dns_a6_prefix_len,tvb, a6_offset, 1, ENC_BIG_ENDIAN); a6_offset++; if (suf_len) { - proto_tree_add_ipv6(rr_tree, hf_dns_a6_address_suffix,tvb, a6_offset, suf_octet_count, suffix.bytes); + proto_tree_add_ipv6(rr_tree, hf_dns_a6_address_suffix,tvb, a6_offset, suf_octet_count, &suffix); a6_offset += suf_octet_count; } if (pre_len > 0) { @@ -2747,7 +2747,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, break; case AFNUM_INET6: proto_tree_add_ipv6(rropt_tree, hf_dns_opt_client_addr6, tvb, - cur_offset, addr_len, ip_addr.bytes); + cur_offset, addr_len, (struct e_in6_addr *)&ip_addr); break; default: proto_tree_add_item(rropt_tree, hf_dns_opt_client_addr, tvb, cur_offset, (optlen - 4), @@ -2811,7 +2811,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, } else if (afamily == 2 && afdpart_len <= 16) { /* IPv6 */ addr_copy = (guint8 *)wmem_alloc0(wmem_file_scope(), 16); tvb_memcpy(tvb, (guint8 *)addr_copy, cur_offset, afdpart_len); - proto_tree_add_ipv6(rr_tree, hf_dns_apl_afdpart_ipv6, tvb, cur_offset, afdpart_len, addr_copy); + proto_tree_add_ipv6(rr_tree, hf_dns_apl_afdpart_ipv6, tvb, cur_offset, afdpart_len, (struct e_in6_addr *)addr_copy); } else { /* Other... */ proto_tree_add_item(rr_tree, hf_dns_apl_afdpart_data, tvb, cur_offset, afdpart_len, ENC_NA); } diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c index 04e841ef7f..75c61e49dd 100644 --- a/epan/dissectors/packet-eigrp.c +++ b/epan/dissectors/packet-eigrp.c @@ -1179,7 +1179,7 @@ dissect_eigrp_ipv6_addr (proto_item *ti, proto_tree *tree, tvbuff_t *tvb, } SET_ADDRESS(&addr_str, AT_IPv6, 16, addr.bytes); - ti_dst = proto_tree_add_ipv6(tree, hf_eigrp_ipv6_destination, tvb, offset, addr_len, addr.bytes); + ti_dst = proto_tree_add_ipv6(tree, hf_eigrp_ipv6_destination, tvb, offset, addr_len, &addr); /* add it to the top level line */ proto_item_append_text(ti," %c %s/%u", first ? '=':',', diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c index ec26f1a6b6..9c10089a69 100644 --- a/epan/dissectors/packet-ftp.c +++ b/epan/dissectors/packet-ftp.c @@ -783,7 +783,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else if (eprt_af == EPRT_AF_IPv6) { proto_tree_add_ipv6(reqresp_tree, hf_ftp_eprt_ipv6, - tvb, eprt_offset, eprt_ip_len, (const guint8 *)eprt_ipv6); + tvb, eprt_offset, eprt_ip_len, (const struct e_in6_addr *)eprt_ipv6); SET_ADDRESS(&ftp_ip_address, AT_IPv6, 16, eprt_ipv6); } eprt_offset += eprt_ip_len + 1; /* addr, 3rd delimiter */ @@ -831,7 +831,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else if (ftp_ip_address.type == AT_IPv6) { addr_it = proto_tree_add_ipv6(reqresp_tree, hf_ftp_epsv_ipv6, tvb, 0, 0, - (const guint8*)ftp_ip_address.data); + (const struct e_in6_addr *)ftp_ip_address.data); PROTO_ITEM_SET_GENERATED(addr_it); } diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 92596e394f..65cc9b27b3 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -1947,7 +1947,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree case 16: memset(&prefix, 0, sizeof(prefix)); tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, prefix.bytes); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, &prefix); SET_ADDRESS(&prefix_addr, AT_IPv6, 16, prefix.bytes); proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &prefix_addr), prefix_len); opt_offset += 8; @@ -2246,7 +2246,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree break; case 16: tvb_memcpy(tvb, (guint8 *)&context_prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, context_prefix.bytes); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, &context_prefix); SET_ADDRESS(&context_prefix_addr, AT_IPv6, 16, context_prefix.bytes); proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &context_prefix_addr), context_len); opt_offset += 8; @@ -2422,7 +2422,7 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree case 14: memset(&prefix, 0, sizeof(prefix)); tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, prefix.bytes); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, &prefix); SET_ADDRESS(&prefix_addr, AT_IPv6, 16, prefix.bytes); proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &prefix_addr), prefix_len); opt_offset += 8; @@ -2509,7 +2509,7 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree case 10: memset(&target_prefix, 0, sizeof(target_prefix)); tvb_memcpy(tvb, (guint8 *)&target_prefix.bytes, opt_offset, 8); - proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, target_prefix.bytes); + proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, &target_prefix); SET_ADDRESS(&target_prefix_addr, AT_IPv6, 16, target_prefix.bytes); proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &target_prefix_addr), prefix_len); opt_offset += 8; @@ -2735,7 +2735,7 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree while (num_of_addr--) { memset(addr, 0, sizeof(addr)); memcpy(addr + compr, tvb_get_ptr(tvb, opt_offset, addr_len), addr_len); - proto_tree_add_ipv6(flag_tree, hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr, tvb, opt_offset, addr_len, addr); + proto_tree_add_ipv6(flag_tree, hf_icmpv6_rpl_opt_route_discovery_addr_vec_addr, tvb, opt_offset, addr_len, (struct e_in6_addr *)addr); opt_offset += addr_len; } diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 5391ecf79d..bd5fe6b7cd 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -966,7 +966,7 @@ dissect_routing6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data /* Display Full Address */ memcpy((guint8 *)addr, (guint8 *)&dstAddr, sizeof(dstAddr)); tvb_memcpy(tvb, (guint8 *)addr + cmprI, offset, (16-cmprI)); - ti = proto_tree_add_ipv6(rthdr_tree, hf_ipv6_routing_rpl_fulladdr, tvb, offset, (16-cmprI), (guint8 *)addr); + ti = proto_tree_add_ipv6(rthdr_tree, hf_ipv6_routing_rpl_fulladdr, tvb, offset, (16-cmprI), addr); PROTO_ITEM_SET_GENERATED(ti); offset += (16-cmprI); segments--; @@ -1025,7 +1025,7 @@ dissect_routing6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data /* Display Full Address */ memcpy((guint8 *)addr, (guint8 *)&dstAddr, sizeof(dstAddr)); tvb_memcpy(tvb, (guint8 *)addr + cmprE, offset, (16-cmprE)); - ti = proto_tree_add_ipv6(rthdr_tree, hf_ipv6_routing_rpl_fulladdr, tvb, offset, (16-cmprE), (guint8 *)addr); + ti = proto_tree_add_ipv6(rthdr_tree, hf_ipv6_routing_rpl_fulladdr, tvb, offset, (16-cmprE), addr); PROTO_ITEM_SET_GENERATED(ti); /* offset += (16-cmprE); */ @@ -2090,7 +2090,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset + IP6H_SRC, 16, ENC_NA); ti = proto_tree_add_ipv6(ipv6_tree, hf_ipv6_addr, tvb, offset + IP6H_SRC, - 16, (guint8 *)&ipv6->ip6_src); + 16, &ipv6->ip6_src); PROTO_ITEM_SET_HIDDEN(ti); name = address_to_display(wmem_packet_scope(), &pinfo->src); if (ipv6_summary_in_tree) { @@ -2178,7 +2178,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset + IP6H_DST, 16, ENC_NA); ti = proto_tree_add_ipv6(ipv6_tree, hf_ipv6_addr, tvb, offset + IP6H_DST, - 16, (guint8 *)&ipv6->ip6_dst); + 16, &ipv6->ip6_dst); PROTO_ITEM_SET_HIDDEN(ti); name = address_to_display(wmem_packet_scope(), &pinfo->dst); if (ipv6_summary_in_tree) { diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c index 3a0be0aa33..32e43c1463 100644 --- a/epan/dissectors/packet-isis-clv.c +++ b/epan/dissectors/packet-isis-clv.c @@ -309,7 +309,7 @@ void isis_dissect_ipv6_int_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, expert_field* expert, int offset, int length, int tree_id) { - guint8 addr [16]; + struct e_in6_addr addr; if ( length <= 0 ) { return; @@ -321,9 +321,9 @@ isis_dissect_ipv6_int_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb, e "Short IPv6 interface address (%d vs 16)",length ); return; } - tvb_memcpy(tvb, addr, offset, sizeof(addr)); + tvb_get_ipv6(tvb, offset, &addr); if ( tree ) { - proto_tree_add_ipv6(tree, tree_id, tvb, offset, 16, addr); + proto_tree_add_ipv6(tree, tree_id, tvb, offset, 16, &addr); } offset += 16; length -= 16; diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index 4fb134621a..b3ab3e47e4 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -1458,7 +1458,7 @@ dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree SET_ADDRESS(&prefix_addr, AT_IPv6, 16, prefix.bytes); proto_tree_add_ipv6_format_value(subtree, hf_isis_lsp_ipv6_reachability_ipv6_prefix, tvb, offset+6, byte_length, - (guint8*)&prefix, "IPv6 prefix: %s/%u", address_to_str(wmem_packet_scope(), &prefix_addr), bit_length); + &prefix, "IPv6 prefix: %s/%u", address_to_str(wmem_packet_scope(), &prefix_addr), bit_length); proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_metric, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_distribution, tvb, offset+4, 1, ENC_NA); diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index caa1e113ae..433408bc2a 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -7389,7 +7389,7 @@ dissect_nfs4_clientaddr(tvbuff_t *tvb, int offset, proto_tree *tree) ipv6.bytes[0] = b1; ipv6.bytes[1] = b2; ipv6.bytes[2] = b3; ipv6.bytes[3] = b4; ipv6.bytes[4] = b5; ipv6.bytes[5] = b6; ipv6.bytes[6] = b7; ipv6.bytes[7] = b8; SET_ADDRESS(&addr, AT_IPv6, 16, &ipv6); - ti = proto_tree_add_ipv6_format(tree, hf_nfs4_universal_address_ipv6, tvb, addr_offset, offset-addr_offset, ipv6.bytes, "IPv6 address %s, protocol=%s, port=%u", + ti = proto_tree_add_ipv6_format(tree, hf_nfs4_universal_address_ipv6, tvb, addr_offset, offset-addr_offset, &ipv6, "IPv6 address %s, protocol=%s, port=%u", address_to_str(wmem_packet_scope(), &addr), protocol, port); PROTO_ITEM_SET_GENERATED(ti); } else { diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c index 1d6b8fb37b..acce333471 100644 --- a/epan/dissectors/packet-nsip.c +++ b/epan/dissectors/packet-nsip.c @@ -542,7 +542,7 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { tvb_get_ipv6(bi->tvb, bi->offset+1, &ip6_addr); proto_tree_add_ipv6(bi->nsip_tree, hf_nsip_ip_address_ipv4, bi->tvb, ie_start_offset, ie->total_length, - (guint8 *)&ip6_addr); + &ip6_addr); break; default: return; /* error */ diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c index 655ee1fe9b..29caa62b36 100644 --- a/epan/dissectors/packet-ospf.c +++ b/epan/dissectors/packet-ospf.c @@ -3066,7 +3066,7 @@ static void dissect_ospf_v3_address_prefix(tvbuff_t *tvb, packet_info *pinfo, in } if (address_family == OSPF_AF_6) { proto_tree_add_ipv6(tree, hf_ospf_v3_address_prefix_ipv6, tvb, offset, bytes_to_process, - prefix.bytes); + &prefix); } else { proto_tree_add_item(tree, hf_ospf_v3_address_prefix_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); } diff --git a/epan/dissectors/packet-packetbb.c b/epan/dissectors/packet-packetbb.c index 400c6510e3..8b8b9bcea9 100644 --- a/epan/dissectors/packet-packetbb.c +++ b/epan/dissectors/packet-packetbb.c @@ -470,7 +470,7 @@ static int dissect_pbb_addressblock(tvbuff_t *tvb, packet_info *pinfo, proto_tre break; case 1: addrValue_item = proto_tree_add_ipv6(addr_tree, hf_packetbb_addr_value[addressType], - tvb, mid_index, block_index + block_length - mid_index, addr); + tvb, mid_index, block_index + block_length - mid_index, (struct e_in6_addr *)addr); break; case 2: addrValue_item = proto_tree_add_ether(addr_tree, hf_packetbb_addr_value[addressType], diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c index f77af445ce..bf5617e012 100644 --- a/epan/dissectors/packet-pim.c +++ b/epan/dissectors/packet-pim.c @@ -691,11 +691,11 @@ dissect_pim_addr(proto_tree* tree, tvbuff_t *tvb, int offset, enum pimv2_addrtyp if (label) { ti = proto_tree_add_ipv6_format(tree, hf_ip6, tvb, offset, 2 + len, - (guint8 *)&ipv6, "%s: %s", label, tvb_ip6_to_str(tvb, offset + 2)); + &ipv6, "%s: %s", label, tvb_ip6_to_str(tvb, offset + 2)); } else { - ti = proto_tree_add_ipv6(tree, hf_ip6, tvb, offset, 2 + len, (guint8 *)&ipv6); + ti = proto_tree_add_ipv6(tree, hf_ip6, tvb, offset, 2 + len, &ipv6); } break; } @@ -727,11 +727,11 @@ dissect_pim_addr(proto_tree* tree, tvbuff_t *tvb, int offset, enum pimv2_addrtyp if (label) { ti = proto_tree_add_ipv6_format(tree, hf_ip6, tvb, offset, 4 + len, - (guint8 *)&ipv6, "%s: %s", label, tvb_ip6_to_str(tvb, offset + 4)); + &ipv6, "%s: %s", label, tvb_ip6_to_str(tvb, offset + 4)); } else { - ti = proto_tree_add_ipv6(tree, hf_ip6, tvb, offset, 4 + len, (guint8 *)&ipv6); + ti = proto_tree_add_ipv6(tree, hf_ip6, tvb, offset, 4 + len, &ipv6); } proto_item_append_text(ti, "/%u", mask_len); break; @@ -765,11 +765,11 @@ dissect_pim_addr(proto_tree* tree, tvbuff_t *tvb, int offset, enum pimv2_addrtyp if (label) { ti = proto_tree_add_ipv6_format(tree, hf_ip6, tvb, offset, 4 + len, - (guint8 *)&ipv6, "%s: %s", label, tvb_ip6_to_str(tvb, offset + 4)); + &ipv6, "%s: %s", label, tvb_ip6_to_str(tvb, offset + 4)); } else { - ti = proto_tree_add_ipv6_format_value(tree, hf_ip6, tvb, offset, 4 + len, (guint8 *)&ipv6, + ti = proto_tree_add_ipv6_format_value(tree, hf_ip6, tvb, offset, 4 + len, &ipv6, "%s", tvb_ip6_to_str(tvb, offset + 4)); } proto_item_append_text(ti, "/%u", mask_len); diff --git a/epan/dissectors/packet-ppcap.c b/epan/dissectors/packet-ppcap.c index fb400a6490..9b62ef12a6 100644 --- a/epan/dissectors/packet-ppcap.c +++ b/epan/dissectors/packet-ppcap.c @@ -312,7 +312,7 @@ dissect_ppcap_source_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree * ppc { struct e_in6_addr value; tvb_get_ipv6(tvb, offset, &value); - proto_tree_add_ipv6(ppcap_tree1, hf_ppcap_source_ip_address2, tvb, offset, msg_len, (guint8*)&value); + proto_tree_add_ipv6(ppcap_tree1, hf_ppcap_source_ip_address2, tvb, offset, msg_len, &value); TVB_SET_ADDRESS(&pinfo->net_src, AT_IPv6, tvb, offset, 6); COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->net_src); } @@ -405,7 +405,7 @@ dissect_ppcap_destination_address(tvbuff_t *tvb, packet_info * pinfo, proto_tree struct e_in6_addr value; tvb_get_ipv6(tvb, offset,&value); - proto_tree_add_ipv6(ppcap_tree1, hf_ppcap_destination_ip_address2, tvb, offset, msg_len, (guint8*)&value); + proto_tree_add_ipv6(ppcap_tree1, hf_ppcap_destination_ip_address2, tvb, offset, msg_len, &value); TVB_SET_ADDRESS(&pinfo->net_dst, AT_IPv6, tvb, offset, 6); COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->net_dst); } diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c index 1dd0713dd8..ef29818ffb 100644 --- a/epan/dissectors/packet-ppp.c +++ b/epan/dissectors/packet-ppp.c @@ -3598,7 +3598,7 @@ dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, tvb_memcpy(tvb, &ad->bytes[8], offset + 3, 8); SET_ADDRESS(&addr, AT_IPv6, 16, ad->bytes); - proto_tree_add_ipv6_format(field_tree, hf_vsncp_pdn_ipv6, tvb, offset + 3, length - 3, ad->bytes, + proto_tree_add_ipv6_format(field_tree, hf_vsncp_pdn_ipv6, tvb, offset + 3, length - 3, ad, "%s: %s", val_to_str_const(pdnaddtype, vsncp_pdntype_vals, "Unknown"), address_to_str(wmem_packet_scope(), &addr)); break; @@ -3611,7 +3611,7 @@ dissect_vsncp_pdnaddress_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset, tvb_memcpy(tvb, &ad->bytes[8], offset + 3, 8); SET_ADDRESS(&addr, AT_IPv6, 16, ad->bytes); - proto_tree_add_ipv6_format(field_tree, hf_vsncp_pdn_ipv6, tvb, offset + 3, length - 3, ad->bytes, + proto_tree_add_ipv6_format(field_tree, hf_vsncp_pdn_ipv6, tvb, offset + 3, length - 3, ad, "%s: %s", val_to_str_const(pdnaddtype, vsncp_pdntype_vals, "Unknown"), address_to_str(wmem_packet_scope(), &addr)); proto_tree_add_ipv4_format(field_tree, hf_vsncp_pdn_ipv4, tvb, offset + 11, length - 11, diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c index 4668752832..263647ac60 100644 --- a/epan/dissectors/packet-rtpproxy.c +++ b/epan/dissectors/packet-rtpproxy.c @@ -496,7 +496,7 @@ rtpproxy_add_notify_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy /* We have ip:port */ if(ipv6){ if(str_to_ip6((char*)tvb_get_string_enc(wmem_packet_scope(), tvb, begin, offset - begin, ENC_ASCII), ipaddr)) - proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, offset - begin, (const guint8 *)ipaddr); + proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, offset - begin, (const struct e_in6_addr*)ipaddr); else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv6, tvb, begin, offset - begin); } @@ -515,7 +515,7 @@ rtpproxy_add_notify_addr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy if (pinfo->src.type == AT_IPv4) ti = proto_tree_add_ipv4(rtpproxy_tree, hf_rtpproxy_notify_ipv4, tvb, begin, 0, ((guint32*)(pinfo->src.data))[0]); else - ti = proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, 0, (const guint8 *)(pinfo->src.data)); + ti = proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_notify_ipv6, tvb, begin, 0, (const struct e_in6_addr *)(pinfo->src.data)); PROTO_ITEM_SET_GENERATED(ti); proto_tree_add_uint(rtpproxy_tree, hf_rtpproxy_notify_port, tvb, begin, end - begin, (guint16) g_ascii_strtoull((gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, begin, end - begin, ENC_ASCII), NULL, 10)); @@ -705,7 +705,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data } else{ if(str_to_ip6((char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, new_offset - offset, ENC_ASCII), ipaddr)) - proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, new_offset - offset, (const guint8 *)ipaddr); + proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, new_offset - offset, (const struct e_in6_addr *)ipaddr); else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv6, tvb, offset, new_offset - offset); } @@ -874,7 +874,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data addr.type = AT_IPv6; addr.len = 16; addr.data = wmem_memdup(wmem_packet_scope(), ipaddr, 16); - proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, tmp, (const guint8 *)ipaddr); + proto_tree_add_ipv6(rtpproxy_tree, hf_rtpproxy_ipv6, tvb, offset, tmp, (const struct e_in6_addr *)ipaddr); } else proto_tree_add_expert(rtpproxy_tree, pinfo, &ei_rtpproxy_bad_ipv6, tvb, offset, tmp); diff --git a/epan/dissectors/packet-sasp.c b/epan/dissectors/packet-sasp.c index ac3f4fd824..ccbccede06 100644 --- a/epan/dissectors/packet-sasp.c +++ b/epan/dissectors/packet-sasp.c @@ -658,7 +658,7 @@ static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 lab_len = tvb_get_guint8(tvb, offset+23); memdatacomp = proto_tree_add_ipv6_format(pay_load, hf_sasp_memdatacomp_ip, - tvb, offset, 24+lab_len, (guint8*)&ipv6_address, + tvb, offset, 24+lab_len, &ipv6_address, "Member Data Comp (%s)", ip_str); memdatacomp_tree = proto_item_add_subtree(memdatacomp, ett_sasp_memdatacomp); diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c index 55a2aa2af7..01f67fb9f8 100644 --- a/epan/dissectors/packet-socks.c +++ b/epan/dissectors/packet-socks.c @@ -1114,7 +1114,7 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { PROTO_ITEM_SET_GENERATED(ti); } else if (hash_info->dst_addr.type == AT_IPv6) { ti = proto_tree_add_ipv6( socks_tree, hf_socks_ip6_dst, tvb, - offset, 0, (const guint8*)hash_info->dst_addr.data); + offset, 0, (const struct e_in6_addr *)hash_info->dst_addr.data); PROTO_ITEM_SET_GENERATED(ti); } diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index 930c2b9f88..f92334a549 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -1090,7 +1090,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole IPv6[2] = IPv6[2] ^ g_htonl(transaction_id[1]); IPv6[3] = IPv6[3] ^ g_htonl(transaction_id[2]); ti = proto_tree_add_ipv6(att_tree, hf_stun_att_ipv6, tvb, offset+4, 16, - (const guint8 *)IPv6); + (const struct e_in6_addr *)IPv6); PROTO_ITEM_SET_GENERATED(ti); } diff --git a/epan/dissectors/packet-wccp.c b/epan/dissectors/packet-wccp.c index 31d38b96db..3e6d046273 100644 --- a/epan/dissectors/packet-wccp.c +++ b/epan/dissectors/packet-wccp.c @@ -679,7 +679,7 @@ static proto_item* wccp_add_ipaddress_item(proto_tree* tree, int hf_index, int h /* IPv6 */ /* special case: index 0 -> undefined IP */ if (addr_index == 0) { - return proto_tree_add_ipv6(tree, hf_ipv6, tvb, offset, length, ipv6_zero.bytes); + return proto_tree_add_ipv6(tree, hf_ipv6, tvb, offset, length, &ipv6_zero); } /* are we be beyond the end of the table? */ @@ -690,7 +690,7 @@ static proto_item* wccp_add_ipaddress_item(proto_tree* tree, int hf_index, int h /* ok get the IP */ if (addr_table->table_ipv6 != NULL) { - return proto_tree_add_ipv6(tree, hf_ipv6, tvb, offset, length, addr_table->table_ipv6[addr_index-1].bytes); + return proto_tree_add_ipv6(tree, hf_ipv6, tvb, offset, length, &(addr_table->table_ipv6[addr_index-1])); } return proto_tree_add_uint_format_value(tree, hf_index, tvb, offset, length, host_addr, diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c index 447daca03c..d1475c5c02 100644 --- a/epan/dissectors/packet-wsp.c +++ b/epan/dissectors/packet-wsp.c @@ -4015,7 +4015,7 @@ dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo, if (tree) { proto_tree_add_ipv6 (addr_tree, hf_address_ipv6_addr, - tvb, offset, 16, (guint8 *)&address_ipv6); + tvb, offset, 16, &address_ipv6); } /* diff --git a/epan/dissectors/packet-zebra.c b/epan/dissectors/packet-zebra.c index 1492196f98..68bc820aff 100644 --- a/epan/dissectors/packet-zebra.c +++ b/epan/dissectors/packet-zebra.c @@ -370,7 +370,7 @@ zebra_route(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 len, tvb_memcpy(tvb, buffer6, offset, MIN((unsigned) PSIZE(prefixlen), sizeof buffer6)); proto_tree_add_ipv6(tree, hf_zebra_prefix6, - tvb, offset, PSIZE(prefixlen), buffer6); + tvb, offset, PSIZE(prefixlen), (struct e_in6_addr *)buffer6); }else { prefix4 = 0; tvb_memcpy(tvb, (guint8 *)&prefix4, offset, |