diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-08-27 15:23:11 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-08-27 15:23:11 +0000 |
commit | 4b4dbe764347321194707636ab09615ebb881dab (patch) | |
tree | a4104c638529709d8c4f8b869d76c7f5253c6d16 /epan/tvbuff.h | |
parent | 484f50b40509458e48c37f5620093a82452e5324 (diff) |
Add a "contains" operator for byte-strings, strings, and tvbuffs (protocols).
The search uses a naive approach; more work is required to add a
Boyer-Moore Search algorithm.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8280 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 6dd756a03c..156de931fa 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.33 2003/06/12 08:33:31 guy Exp $ + * $Id: tvbuff.h,v 1.34 2003/08/27 15:23:03 gram Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -435,6 +435,13 @@ extern gchar *tvb_bytes_to_str(tvbuff_t *tvb, gint offset, gint len); extern tvbuff_t *tvb_get_ds_tvb(tvbuff_t *tvb); +/* Locate a sub-tvbuff within another tvbuff, starting at position + * 'haystack_offset'. Returns the index of the beginning of 'needle' within + * 'haystack', or -1 if 'needle' is not found. The index is relative + * to the start of 'haystack', not 'haystack_offset'. */ +extern gint tvb_find_tvb(tvbuff_t *haystack_tvb, tvbuff_t *needle_tvb, + gint haystack_offset); + /************** END OF ACCESSORS ****************/ #endif /* __TVBUFF_H__ */ |