2 * Wireshark - Network traffic analyzer
3 * By Gerald Combs <gerald@wireshark.org>
4 * Copyright 2001 Gerald Combs
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <epan/packet.h>
29 ftype_register(enum ftenum ftype, ftype_t *ft);
31 /* These are the ftype registration functions that need to be called.
32 * This list and the initialization function could be produced
33 * via a script, like the dissector registration, but there's so few
34 * that I don't mind doing it by hand for now. */
35 void ftype_register_bytes(void);
36 void ftype_register_double(void);
37 void ftype_register_ieee_11073_float(void);
38 void ftype_register_fc(void);
39 void ftype_register_integers(void);
40 void ftype_register_ipv4(void);
41 void ftype_register_ipv6(void);
42 void ftype_register_guid(void);
43 void ftype_register_none(void);
44 void ftype_register_string(void);
45 void ftype_register_time(void);
46 void ftype_register_tvbuff(void);
47 void ftype_register_pcre(void);
49 typedef void (*FvalueNewFunc)(fvalue_t*);
50 typedef void (*FvalueFreeFunc)(fvalue_t*);
52 typedef gboolean (*FvalueFromUnparsed)(fvalue_t*, const char*, gboolean, gchar **);
53 typedef gboolean (*FvalueFromString)(fvalue_t*, const char*, gchar **);
54 typedef void (*FvalueToStringRepr)(fvalue_t*, ftrepr_t, int field_display, char*volatile, unsigned int);
55 typedef int (*FvalueStringReprLen)(fvalue_t*, ftrepr_t, int field_display);
57 typedef void (*FvalueSetByteArrayFunc)(fvalue_t*, GByteArray *);
58 typedef void (*FvalueSetBytesFunc)(fvalue_t*, const guint8 *);
59 typedef void (*FvalueSetGuidFunc)(fvalue_t*, const e_guid_t *);
60 typedef void (*FvalueSetTimeFunc)(fvalue_t*, const nstime_t *);
61 typedef void (*FvalueSetStringFunc)(fvalue_t*, const gchar *value);
62 typedef void (*FvalueSetProtocolFunc)(fvalue_t*, tvbuff_t *value, const gchar *name);
63 typedef void (*FvalueSetUnsignedIntegerFunc)(fvalue_t*, guint32);
64 typedef void (*FvalueSetSignedIntegerFunc)(fvalue_t*, gint32);
65 typedef void (*FvalueSetUnsignedInteger64Func)(fvalue_t*, guint64);
66 typedef void (*FvalueSetSignedInteger64Func)(fvalue_t*, gint64);
67 typedef void (*FvalueSetFloatingFunc)(fvalue_t*, gdouble);
69 typedef gpointer (*FvalueGetFunc)(fvalue_t*);
70 typedef guint32 (*FvalueGetUnsignedIntegerFunc)(fvalue_t*);
71 typedef gint32 (*FvalueGetSignedIntegerFunc)(fvalue_t*);
72 typedef guint64 (*FvalueGetUnsignedInteger64Func)(fvalue_t*);
73 typedef gint64 (*FvalueGetSignedInteger64Func)(fvalue_t*);
74 typedef double (*FvalueGetFloatingFunc)(fvalue_t*);
76 typedef gboolean (*FvalueCmp)(const fvalue_t*, const fvalue_t*);
78 typedef guint (*FvalueLen)(fvalue_t*);
79 typedef void (*FvalueSlice)(fvalue_t*, GByteArray *, guint offset, guint length);
84 const char *pretty_name;
86 FvalueNewFunc new_value;
87 FvalueFreeFunc free_value;
88 FvalueFromUnparsed val_from_unparsed;
89 FvalueFromString val_from_string;
90 FvalueToStringRepr val_to_string_repr;
91 FvalueStringReprLen len_string_repr;
94 FvalueSetByteArrayFunc set_value_byte_array;
95 FvalueSetBytesFunc set_value_bytes;
96 FvalueSetGuidFunc set_value_guid;
97 FvalueSetTimeFunc set_value_time;
98 FvalueSetStringFunc set_value_string;
99 FvalueSetProtocolFunc set_value_protocol;
100 FvalueSetUnsignedIntegerFunc set_value_uinteger;
104 FvalueSetSignedIntegerFunc set_value_sinteger;
105 FvalueSetUnsignedInteger64Func set_value_uinteger64;
106 FvalueSetSignedInteger64Func set_value_sinteger64;
107 FvalueSetFloatingFunc set_value_floating;
110 FvalueGetFunc get_value;
111 FvalueGetUnsignedIntegerFunc get_value_uinteger;
112 FvalueGetSignedIntegerFunc get_value_sinteger;
113 FvalueGetUnsignedInteger64Func get_value_uinteger64;
114 FvalueGetSignedInteger64Func get_value_sinteger64;
115 FvalueGetFloatingFunc get_value_floating;
123 FvalueCmp cmp_bitwise_and;
124 FvalueCmp cmp_contains;
125 FvalueCmp cmp_matches;
131 /* Free all memory used by an fvalue_t. With MSVC and a
132 * libwireshark.dll, we need a special declaration.
135 #define FVALUE_CLEANUP(fv) \
137 register FvalueFreeFunc free_value; \
138 free_value = (fv)->ftype->free_value; \
144 #define FVALUE_FREE(fv) \
147 g_slice_free(fvalue_t, fv); \
153 * Editor modelines - http://www.wireshark.org/tools/modelines.html
158 * indent-tabs-mode: t
161 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
162 * :indentSize=8:tabSize=8:noTabs=false: