diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 03:35:29 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 03:35:29 +0000 |
commit | f36e2be2874db3eb3917e2b9299509725d483ce3 (patch) | |
tree | 9659b266111b939e5e8ec48e927fd36978e40e88 /epan/dissectors/packet-dsi.c | |
parent | 067a0761790aabf2d6a829c59dbdac4c2d0fccdf (diff) | |
download | wireshark-f36e2be2874db3eb3917e2b9299509725d483ce3.tar.gz |
Use tvb_memeql() and tvb_memcpy().
Use tvb_ip_to_str() and tvb_ip6_to_str().
There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().
Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the
return string is NULL terminated.
svn path=/trunk/; revision=35546
Diffstat (limited to 'epan/dissectors/packet-dsi.c')
-rw-r--r-- | epan/dissectors/packet-dsi.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c index 6449f40dd0..4beb4dc7e8 100644 --- a/epan/dissectors/packet-dsi.c +++ b/epan/dissectors/packet-dsi.c @@ -405,7 +405,6 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset) if (adr_ofs) { proto_tree *adr_tree; unsigned char *tmp; - const guint8 *ip; guint16 net; guint8 node; guint16 port; @@ -422,13 +421,11 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset) type = tvb_get_guint8(tvb, ofs +1); switch (type) { case 1: /* IP */ - ip = tvb_get_ptr(tvb, ofs+2, 4); - ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip: %s", ip_to_str(ip)); + ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip: %s", tvb_ip_to_str(tvb, ofs+2)); break; case 2: /* IP + port */ - ip = tvb_get_ptr(tvb, ofs+2, 4); port = tvb_get_ntohs(tvb, ofs+6); - ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s:%d",ip_to_str(ip),port); + ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip %s:%d", tvb_ip_to_str(tvb, ofs+2), port); break; case 3: /* DDP, atalk_addr_to_str want host order not network */ net = tvb_get_ntohs(tvb, ofs+2); @@ -450,15 +447,13 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset) } break; case 6: /* IP6 */ - ip = tvb_get_ptr(tvb, ofs+2, INET6_ADDRLEN); ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip6: %s", - ip6_to_str((const struct e_in6_addr *)ip)); + tvb_ip6_to_str(tvb, ofs+2)); break; case 7: /* IP6 + 2bytes port */ - ip = tvb_get_ptr(tvb, ofs+2, INET6_ADDRLEN); port = tvb_get_ntohs(tvb, ofs+ 2+INET6_ADDRLEN); ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip6 %s:%d", - ip6_to_str((const struct e_in6_addr *)ip),port); + tvb_ip6_to_str(tvb, ofs+2), port); break; default: ti = proto_tree_add_text(adr_tree, tvb, ofs, len,"Unknown type : %d", type); |