diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-11-13 07:19:37 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-11-13 07:19:37 +0000 |
commit | 401c68ff147a95f12cd0386ed37894b410a1fc05 (patch) | |
tree | d3b2949261e9970321c2a8fac4be3d2baaeb63c1 /epan/tvbuff.h | |
parent | 25a7934bd5cd4316c41286871b1771d9160b9da1 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2634 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 43b32c4074..5d43a0b4c4 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -9,7 +9,7 @@ * the data of a backing tvbuff, or can be a composite of * other tvbuffs. * - * $Id: tvbuff.h,v 1.5 2000/11/11 19:55:48 guy Exp $ + * $Id: tvbuff.h,v 1.6 2000/11/13 07:19:37 guy Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org> * @@ -325,6 +325,12 @@ gint tvb_strneql(tvbuff_t *tvb, gint offset, const guint8 *str, gint size); /* Call strncasecmp after checking if enough chars left, otherwise return -1 */ gint tvb_strncaseeql(tvbuff_t *tvb, gint offset, const guint8 *str, gint size); +/* + * Format a bunch of data from a tvbuff as bytes, returning a pointer + * to the string with the formatted data. + */ +gchar *tvb_bytes_to_str(tvbuff_t *tvb, gint offset, gint len); + /************** END OF ACCESSORS ****************/ /* Sets pd and offset so that tvbuff's can be used with code |