diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-09-11 21:25:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-09-11 21:25:37 +0000 |
commit | 25c4bc9379996f934e7648f2ab8b8db3857439f6 (patch) | |
tree | 802a39b3b32b8079ff58c90a7a4e4be6385eb515 /epan/dissectors/packet-auto_rp.c | |
parent | 0bb7a6e0038f5e90851c6d866d3f4d2e75903ab2 (diff) |
Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,
and that extract IPv6 addresses into a "struct e_in6_addr", with
tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we
remove, by using proto_tree_add_item(), rather than replacing.
Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct
e_in6_addr" (not necessary to declare the tvbuff routines, but including
it there means "struct e_in6_addr" is guaranteed to be defined before
those declarations, so we don't get compiler complaints if we define it
*after* those declarations).
svn path=/trunk/; revision=15758
Diffstat (limited to 'epan/dissectors/packet-auto_rp.c')
-rw-r--r-- | epan/dissectors/packet-auto_rp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-auto_rp.c b/epan/dissectors/packet-auto_rp.c index 8033fac6f9..1064b1b648 100644 --- a/epan/dissectors/packet-auto_rp.c +++ b/epan/dissectors/packet-auto_rp.c @@ -252,7 +252,7 @@ static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree) guint32 rp_addr; /* In network byte order */ int i; - tvb_memcpy(tvb, (guint8 *)&rp_addr, offset, 4); + rp_addr = tvb_get_ipv4(tvb, offset); group_count = tvb_get_guint8(tvb, offset + 5); /* sizeof map header + n * sizeof encoded group addresses */ @@ -276,7 +276,7 @@ static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree) sign = tvb_get_guint8(tvb, offset); mask_len = tvb_get_guint8(tvb, offset + 1); - tvb_memcpy(tvb, (guint8 *)&group_addr, offset + 2, 4); + group_addr = tvb_get_ipv4(tvb, offset + 2); gi = proto_tree_add_text(map_tree, tvb, offset, 6, "Group %s/%u (%s)", ip_to_str((void *)&group_addr), mask_len, val_to_str(sign&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, "")); |