2 * $Id: ftype-tvbuff.c,v 1.6 2002/01/21 07:37:39 guy Exp $
4 * Ethereal - Network traffic analyzer
5 * By Gerald Combs <gerald@ethereal.com>
6 * Copyright 2001 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #include <ftypes-int.h>
28 #include <epan/gdebug.h>
31 value_new(fvalue_t *fv)
38 value_set(fvalue_t *fv, gpointer value, gboolean already_copied)
40 g_assert(already_copied);
41 fv->value.tvb = value;
45 value_get(fvalue_t *fv)
54 return tvb_length(fv->value.tvb);
60 slice(fvalue_t *fv, GByteArray *bytes, guint offset, guint length)
66 data = tvb_get_ptr(fv->value.tvb, offset, length);
67 g_byte_array_append(bytes, data, length);
78 ftype_register_tvbuff(void)
81 static ftype_t protocol_type = {
110 ftype_register(FT_PROTOCOL, &protocol_type);