diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-11 21:25:37 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-11 21:25:37 +0000 |
commit | 8641192db38d14218994b79e3bd53d2066f74615 (patch) | |
tree | 802a39b3b32b8079ff58c90a7a4e4be6385eb515 /epan/dissectors/packet-cdp.c | |
parent | 86d831bcefb013befdd8d10d1780d4cbd83c42fa (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).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15758 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-cdp.c')
-rw-r--r-- | epan/dissectors/packet-cdp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c index ffcbf816ac..a24e485058 100644 --- a/epan/dissectors/packet-cdp.c +++ b/epan/dissectors/packet-cdp.c @@ -360,10 +360,10 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* proto_tree_add_text(tlv_tree, tvb, offset+9, length - 9, "Cluster Management"); */ - tvb_memcpy(tvb, (guint8 *)&ip_addr, offset+9, 4); + ip_addr = tvb_get_ipv4(tvb, offset+9); proto_tree_add_text(tlv_tree, tvb, offset+9, 4, "Cluster Master IP: %s",ip_to_str((guint8 *)&ip_addr)); - tvb_memcpy(tvb, (guint8 *)&ip_addr, offset+13, 4); + ip_addr = tvb_get_ipv4(tvb, offset+13); proto_tree_add_text(tlv_tree, tvb, offset+13, 4, "UNKNOWN (IP?): 0x%08X (%s)", ip_addr, ip_to_str((guint8 *)&ip_addr)); |