aboutsummaryrefslogtreecommitdiffstats
path: root/packet-nfs.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-13 07:19:37 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-13 07:19:37 +0000
commit99c98f9e74d8d812e0e87c960970116bf149434b (patch)
treed3b2949261e9970321c2a8fac4be3d2baaeb63c1 /packet-nfs.c
parent796997a538eede8129af9fbb938b3b1cc8bc719d (diff)
downloadwireshark-99c98f9e74d8d812e0e87c960970116bf149434b.tar.gz
wireshark-99c98f9e74d8d812e0e87c960970116bf149434b.tar.bz2
wireshark-99c98f9e74d8d812e0e87c960970116bf149434b.zip
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-nfs.c')
-rw-r--r--packet-nfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packet-nfs.c b/packet-nfs.c
index 7a6c93fa02..17f623f837 100644
--- a/packet-nfs.c
+++ b/packet-nfs.c
@@ -2,7 +2,7 @@
* Routines for nfs dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-nfs.c,v 1.37 2000/08/27 02:03:31 guy Exp $
+ * $Id: packet-nfs.c,v 1.38 2000/11/13 07:18:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -416,7 +416,7 @@ dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, proto_tree *tree, int fhlen)
hash_item = proto_tree_add_text(tree, tvb, 4, hashlen + 1,
"hash path: %s",
- bytes_to_str(tvb_get_ptr(tvb,5,hashlen),hashlen));
+ tvb_bytes_to_str(tvb,5,hashlen));
if (hash_item) {
hash_tree = proto_item_add_subtree(hash_item,
ett_nfs_fh_hp);
@@ -425,7 +425,7 @@ dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, proto_tree *tree, int fhlen)
hf_nfs_fh_hp_len, tvb, 4, 1, hashlen);
proto_tree_add_text(hash_tree, tvb, 5, hashlen,
"key: %s",
- bytes_to_str(tvb_get_ptr(tvb,5,hashlen),hashlen));
+ tvb_bytes_to_str(tvb,5,hashlen));
}
}
}
@@ -454,7 +454,7 @@ dissect_fhandle_data_unknown(tvbuff_t *tvb, proto_tree *tree, int fhlen)
"%s%s",
first_line ? "data: " :
" ",
- bytes_to_str(tvb_get_ptr(tvb,offset,sublen),sublen));
+ tvb_bytes_to_str(tvb,offset,sublen));
bytes_left -= sublen;
offset += sublen;
first_line = FALSE;