aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-isup.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-09-11 21:25:37 +0000
committerGuy Harris <guy@alum.mit.edu>2005-09-11 21:25:37 +0000
commit25c4bc9379996f934e7648f2ab8b8db3857439f6 (patch)
tree802a39b3b32b8079ff58c90a7a4e4be6385eb515 /epan/dissectors/packet-isup.c
parent0bb7a6e0038f5e90851c6d866d3f4d2e75903ab2 (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-isup.c')
-rw-r--r--epan/dissectors/packet-isup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index a83f58b88b..8e8e20ca14 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -47,7 +47,6 @@
#include <glib.h>
#include <epan/packet.h>
-#include <epan/ipv6-utils.h>
#include <epan/stats_tree.h>
#include <prefs.h>
#include "packet-q931.h"
@@ -1970,7 +1969,7 @@ dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter
icp = tvb_get_ntohs(parameter_tvb, offset);
proto_tree_add_uint(parameter_tree, hf_iana_icp, parameter_tvb, offset, 1, icp );
if ( icp == 0 ){ /* IPv6 addr */
- tvb_memcpy(parameter_tvb, (guint8 *)&ipv6_addr,( offset + 2 ), 16);
+ tvb_get_ipv6(parameter_tvb, ( offset + 2 ), &ipv6_addr);
proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2 , 3,
"DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
proto_tree_add_ipv6(parameter_tree, hf_nsap_ipv6_addr, parameter_tvb, offset,
@@ -1978,7 +1977,7 @@ dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter
}
else { /* IPv4 addr */
- tvb_memcpy(parameter_tvb,(guint8 *) &addr, ( offset + 2 ), 4);
+ addr = tvb_get_ipv4(parameter_tvb, ( offset + 2 ));
proto_tree_add_text(parameter_tree, parameter_tvb, offset + 2 , 3,
"DSP = %s", tvb_bytes_to_str(parameter_tvb, offset + 2, 17));
proto_tree_add_ipv4(parameter_tree, hf_nsap_ipv4_addr, parameter_tvb, offset + 2, 4, addr);