Change proto_tree_add_ipv6() to take a struct e_in6_addr pointer
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>
Mon, 5 Oct 2015 21:43:46 +0000 (22:43 +0100)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Wed, 14 Oct 2015 12:18:00 +0000 (12:18 +0000)
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>
28 files changed:
epan/dissectors/packet-6lowpan.c
epan/dissectors/packet-bgp.c
epan/dissectors/packet-dcerpc.c
epan/dissectors/packet-diameter.c
epan/dissectors/packet-dns.c
epan/dissectors/packet-eigrp.c
epan/dissectors/packet-ftp.c
epan/dissectors/packet-icmpv6.c
epan/dissectors/packet-ipv6.c
epan/dissectors/packet-isis-clv.c
epan/dissectors/packet-isis-lsp.c
epan/dissectors/packet-nfs.c
epan/dissectors/packet-nsip.c
epan/dissectors/packet-ospf.c
epan/dissectors/packet-packetbb.c
epan/dissectors/packet-pim.c
epan/dissectors/packet-ppcap.c
epan/dissectors/packet-ppp.c
epan/dissectors/packet-rtpproxy.c
epan/dissectors/packet-sasp.c
epan/dissectors/packet-socks.c
epan/dissectors/packet-stun.c
epan/dissectors/packet-wccp.c
epan/dissectors/packet-wsp.c
epan/dissectors/packet-zebra.c
epan/proto.c
epan/proto.h
plugins/wimaxasncp/packet-wimaxasncp.c

index 61e19855581fe4dd17a1237dc311907a4547817c..6028f215db8739db7148533aafab390a8001ede2 100644 (file)
@@ -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);
index 09a88901dd80ce8dd8fe40d50c2f17cf3ec149ef..140496fff82e54a5108978d4a03b034316602070 100644 (file)
@@ -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;
index 6553d28d0ef98184a2048034f7d20926b0ad070b..b5258d43f9d01397f167d132fcfb134bfd97dcc8 100644 (file)
@@ -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;
             }
index 8c6f93a4fb463a27bf82498fe30ee84562ac998a..f855bdb54560a3a3f2ef3b1c9089245dbdb45ba5 100644 (file)
@@ -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);
        }
index 748b39347e486bb5237f14bf9d7d68d5e294b6d3..ddb90c2158744eb1106a1379748c85be0657624d 100644 (file)
@@ -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);
         }
index 04e841ef7fd1970dcc52bb4b2406b465d24a4f6a..75c61e49dd087ef4750e5c00638ec17acceccceb 100644 (file)
@@ -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 ? '=':',',
index ec26f1a6b6ac997f9b707d8a5e7f82de28da23b7..9c10089a69ada85a91b05050d1ab87072fd68c55 100644 (file)
@@ -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);
                 }
 
index 92596e394f1474183203244f12cc6d747f555d3a..65cc9b27b3a2f892cf438f3e36a654fc84a7bf62 100644 (file)
@@ -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;
                 }
 
index 5391ecf79dc0f194e08ade890f4d81068a6c40dd..bd5fe6b7cd803b271deaeae8216d33f4bb86035c 100644 (file)
@@ -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) {
index 3a0be0aa33c53585e7ea55b02e691d45ee41292f..32e43c1463eb9f4a1c113e281a419ffa72e29833 100644 (file)
@@ -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;
index 4fb134621a15fab74ada09b6bf9600f436eccf4e..b3ab3e47e428135e99136643b19f3694aeb198b2 100644 (file)
@@ -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);
index caa1e113ae0b43616480ef8855ee124cfe67ccf8..433408bc2a5622eaf55affdfb96a5e2afa8afc5b 100644 (file)
@@ -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 {
index 1d6b8fb37bf96600132b84ab2fc1d5a84ffbdc8c..acce333471b0f7fae9342bc368f9fa45034aa71e 100644 (file)
@@ -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 */
index 655ee1fe9b87be20dc0e1777990076a3c0d2f259..29caa62b36d7f394e12524a70d569745977a15e0 100644 (file)
@@ -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);
     }
index 400c6510e37b4cfaa67d434075f54b3e9d3d8285..8b8b9bcea99c19bd0bf0f38089e4b205230e996c 100644 (file)
@@ -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],
index f77af445ceba55c586ef4ab30e48d8e5b4094940..bf5617e012394398efd9788c6028e921f63e9d02 100644 (file)
@@ -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);
index fb400a6490e6d2dfc3f6f4e76df12ab550a0cc8f..9b62ef12a626639474382f36413b56d8a21d9b4c 100644 (file)
@@ -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);
                }
index 1dd0713dd83002f955d06f15c8567a1743d61825..ef29818ffb55a23e4f6fbb91dcbaab8a3438396d 100644 (file)
@@ -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,
index 46687528328346e6b9942ee3d18e50b22544af1b..263647ac6061a425221dbcf15537f12565576d72 100644 (file)
@@ -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);
index ac3f4fd82471c30e7bbf4e06a13be757c9f4bb0f..ccbccede06b22b2229552da69fe28b813565bce8 100644 (file)
@@ -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);
index 55a2aa2af705148accb1117bdaa479a2d1bc883b..01f67fb9f892ec10a31e5efdc68cc1b077ca6375 100644 (file)
@@ -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);
             }
 
index 930c2b9f88ba2dad0180c890e0393705140e1a98..f92334a549cf6e6599a8f0d57d37a951aef1660a 100644 (file)
@@ -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);
                     }
 
index 31d38b96dbaae78710a16552f53c3846ff7639c8..3e6d0462734972992048af2541f897fdc269df0a 100644 (file)
@@ -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,
index 447daca03c3c05c6254be889d753903d275a0e52..d1475c5c0259c35cd4e0baac9d4d5dc81de8bb73 100644 (file)
@@ -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);
             }
 
             /*
index 1492196f981c80ea8f3d84de2448e793ab257b9a..68bc820affb8249be993315eaf7a0d0fab223b62 100644 (file)
@@ -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,
index e5f38d98d6b17e17ebd333ee69fb7caa3a459a1c..a5e20566a4195a8b2c95e23e051470d31678593c 100644 (file)
@@ -2922,7 +2922,7 @@ proto_tree_set_ipv4(field_info *fi, guint32 value)
 /* Add a FT_IPv6 to a proto_tree */
 proto_item *
 proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
-                   gint length, const guint8* value_ptr)
+                   gint length, const struct e_in6_addr *value_ptr)
 {
        proto_item        *pi;
        header_field_info *hfinfo;
@@ -2932,7 +2932,7 @@ proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
        DISSECTOR_ASSERT_FIELD_TYPE(hfinfo, FT_IPv6);
 
        pi = proto_tree_add_pi(tree, hfinfo, tvb, start, &length);
-       proto_tree_set_ipv6(PNODE_FINFO(pi), value_ptr);
+       proto_tree_set_ipv6(PNODE_FINFO(pi), value_ptr->bytes);
 
        return pi;
 }
@@ -2940,7 +2940,7 @@ proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
 proto_item *
 proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
                                 gint start, gint length,
-                                const guint8* value_ptr,
+                                const struct e_in6_addr *value_ptr,
                                 const char *format, ...)
 {
        proto_item        *pi;
@@ -2958,7 +2958,8 @@ proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
 
 proto_item *
 proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb,
-                          gint start, gint length, const guint8* value_ptr,
+                          gint start, gint length,
+                          const struct e_in6_addr *value_ptr,
                           const char *format, ...)
 {
        proto_item        *pi;
index 45d1435a64bcbd34b4fc208d741c77fab266f902..61003f374332ee249e610e0578ca9bb85c7421c3 100644 (file)
@@ -1396,7 +1396,7 @@ proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st
  @return the newly created item */
 WS_DLL_PUBLIC proto_item *
 proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
-       gint length, const guint8* value_ptr);
+       gint length, const struct e_in6_addr *value_ptr);
 
 /** Add a formatted FT_IPv6 to a proto_tree, with the format generating
     the string for the value and with the field name being included
@@ -1412,7 +1412,7 @@ proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
  @return the newly created item */
 WS_DLL_PUBLIC proto_item *
 proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
-       gint start, gint length, const guint8* value_ptr, const char *format,
+       gint start, gint length, const struct e_in6_addr *value_ptr, const char *format,
        ...) G_GNUC_PRINTF(7,8);
 
 /** Add a formatted FT_IPv6 to a proto_tree, with the format generating
@@ -1428,7 +1428,7 @@ proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
  @return the newly created item */
 WS_DLL_PUBLIC proto_item *
 proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
-       gint length, const guint8* value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
+       gint length, const struct e_in6_addr *value_ptr, const char *format, ...) G_GNUC_PRINTF(7,8);
 
 /** Add a FT_ETHER to a proto_tree.
  @param tree the tree to append this item to
index 0d9e4db7ba6b8a136da5c626d5ca39917233e3fb..64c5cb36eec0affd241407d8829e712a497bfa51 100644 (file)
@@ -632,7 +632,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
 
     proto_tree_add_ipv6_format(
         tree, hf_value,
-        tvb, offset, 16, (guint8 *)&ip,
+        tvb, offset, 16, &ip,
         "Value: %s", addr_res);
 
     proto_item_append_text(