diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-13 07:19:37 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-13 07:19:37 +0000 |
commit | 99c98f9e74d8d812e0e87c960970116bf149434b (patch) | |
tree | d3b2949261e9970321c2a8fac4be3d2baaeb63c1 /packet-atm.c | |
parent | 796997a538eede8129af9fbb938b3b1cc8bc719d (diff) |
Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just a
string formatter, like "format_text()", and, as "tvbuff.c" now calls it
(*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h"
in just to declare "bytes_to_str()". It's now declared in "strutil.h",
so include it in modules that use "bytes_to_str()" and weren't already
including it.
Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a
pointer to a chunk of N bytes at a given offset in a tvbuff and then
hands that chunk to "bytes_to_str()". Convert the code that was doing
that to use "tvb_bytes_to_str()" instead (which caught what I suspect is
a bug in the Q.2931 dissector, where it was handing an offset of 0 to
"tvb_get_ptr()" - a cut-and-pasteo, I think).
Tvbuffify the ARP dissector.
svn path=/trunk/; revision=2634
Diffstat (limited to 'packet-atm.c')
-rw-r--r-- | packet-atm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-atm.c b/packet-atm.c index 24b733172e..cb11f4ce34 100644 --- a/packet-atm.c +++ b/packet-atm.c @@ -1,7 +1,7 @@ /* packet-atm.c * Routines for ATM packet disassembly * - * $Id: packet-atm.c,v 1.24 2000/08/13 14:08:02 deniel Exp $ + * $Id: packet-atm.c,v 1.25 2000/11/13 07:18:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -328,7 +328,7 @@ dissect_le_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 8; proto_tree_add_text(lane_tree, tvb, offset, 20, "Source ATM Address: %s", - bytes_to_str(tvb_get_ptr(tvb, offset, 20), 20)); + tvb_bytes_to_str(tvb, offset, 20)); offset += 20; proto_tree_add_text(lane_tree, tvb, offset, 1, "LAN type: %s", @@ -350,11 +350,11 @@ dissect_le_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 1; proto_tree_add_text(lane_tree, tvb, offset, 20, "Target ATM Address: %s", - bytes_to_str(tvb_get_ptr(tvb, offset, 20), 20)); + tvb_bytes_to_str(tvb, offset, 20)); offset += 20; proto_tree_add_text(lane_tree, tvb, offset, 32, "ELAN name: %s", - bytes_to_str(tvb_get_ptr(tvb, offset, 32), 32)); + tvb_bytes_to_str(tvb, offset, 32)); offset += 32; while (num_tlvs != 0) { |