aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorOlivier Biot <obiot.ethereal@gmail.com>2004-01-01 17:02:56 +0000
committerOlivier Biot <obiot.ethereal@gmail.com>2004-01-01 17:02:56 +0000
commit8775850e3bec7ce73c66e89736c1fee2008c4949 (patch)
treea232181b41fbbc76d873bcb5c18e0b8251c15ccc /epan
parentef485047692fabb030ebdc9ddb54086107bff878 (diff)
downloadwireshark-8775850e3bec7ce73c66e89736c1fee2008c4949.tar.gz
wireshark-8775850e3bec7ce73c66e89736c1fee2008c4949.tar.bz2
wireshark-8775850e3bec7ce73c66e89736c1fee2008c4949.zip
Add support of contains operator in slices.
svn path=/trunk/; revision=9512
Diffstat (limited to 'epan')
-rw-r--r--epan/ftypes/ftype-bytes.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c
index 0bf67035ee..908f49722e 100644
--- a/epan/ftypes/ftype-bytes.c
+++ b/epan/ftypes/ftype-bytes.c
@@ -1,5 +1,5 @@
/*
- * $Id: ftype-bytes.c,v 1.21 2003/12/29 04:07:06 gerald Exp $
+ * $Id: ftype-bytes.c,v 1.22 2004/01/01 17:02:56 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -91,7 +91,6 @@ bytes_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
if (i == 0) {
sprintf(write_cursor, "%02x", *c++);
write_cursor += 2;
-
}
else {
sprintf(write_cursor, ":%02x", *c++);
@@ -138,6 +137,22 @@ value_get(fvalue_t *fv)
}
static gboolean
+bytes_from_string(fvalue_t *fv, char *s, LogFunc logfunc _U_)
+{
+ GByteArray *bytes;
+
+ bytes = g_byte_array_new();
+
+ g_byte_array_append(bytes, (guint8 *)s, strlen(s));
+
+ /* Free up the old value, if we have one */
+ bytes_fvalue_free(fv);
+ fv->value.bytes = bytes;
+
+ return TRUE;
+}
+
+static gboolean
bytes_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFunc logfunc)
{
GByteArray *bytes;
@@ -587,7 +602,7 @@ ftype_register_bytes(void)
bytes_fvalue_new, /* new_value */
bytes_fvalue_free, /* free_value */
bytes_from_unparsed, /* val_from_unparsed */
- NULL, /* val_from_string */
+ bytes_from_string, /* val_from_string */
bytes_to_repr, /* val_to_string_repr */
bytes_repr_len, /* len_string_repr */