aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2018-10-20 17:46:34 -0400
committerAnders Broman <a.broman58@gmail.com>2018-10-21 07:55:40 +0000
commit7a4e9325718e13e5d977677032f211c93e91aba9 (patch)
tree202cbefec4c9a64ff6de997bf6554d36d5e35ec6 /epan/tvbuff.h
parent7ce9081fdcf48085611d2de6db0964dffd9ae700 (diff)
Add tvb_ascii_isprint API
This allows dissectors to check if a portion of the tvb is an ascii string while hiding the use of tvb_get_ptr. Change-Id: Iaec7559dcfdefb8a5ae23e099ced45e90e611f8f Reviewed-on: https://code.wireshark.org/review/30291 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r--epan/tvbuff.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h
index 2c4df952c1..e2ec44c083 100644
--- a/epan/tvbuff.h
+++ b/epan/tvbuff.h
@@ -732,6 +732,13 @@ WS_DLL_PUBLIC gint tvb_get_nstringz(tvbuff_t *tvb, const gint offset,
WS_DLL_PUBLIC gint tvb_get_nstringz0(tvbuff_t *tvb, const gint offset,
const guint bufsize, guint8 *buffer);
+/** Iterates over the provided portion of the tvb checking that each byte
+* is an ascii printable character.
+* Returns TRUE if all bytes are printable, FALSE otherwise
+*/
+WS_DLL_PUBLIC gboolean tvb_ascii_isprint(tvbuff_t *tvb, const gint offset,
+ const gint length);
+
/**
* Given a tvbuff, an offset into the tvbuff, and a length that starts
* at that offset (which may be -1 for "all the way to the end of the