aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftypes-int.h
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2001-02-01 20:21:25 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2001-02-01 20:21:25 +0000
commit8f1fff2e6a5c114c6beafd2983afb55acd3d66ae (patch)
treee33c08662c708dcfe71591897fe6ffab53bce135 /epan/ftypes/ftypes-int.h
parent07a925ef8b0568a2c5b8098d5734364a40eeb2f6 (diff)
Create a more modular type system for the FT_* types. Put them
into epan/ftypes. Re-write display filter routines using Lemon parser instead of yacc. Besides using a different tool, the new grammar is much simpler, while the display filter engine itself is more powerful and more easily extended. Add dftest executable, to test display filter "bytecode" generation. Add option to "configure" to build dftest or randpkt, both of which are not built by default. Implement Ed Warnicke's ideas about dranges in the new display filter and ftype code. Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree, while FT_PROTOCOL is used for protocols. This was necessary for being able to make byte slices (ranges) out of protocols, like "frame[0:3]" Win32 Makefile.nmake's will be added tonight. svn path=/trunk/; revision=2967
Diffstat (limited to 'epan/ftypes/ftypes-int.h')
-rw-r--r--epan/ftypes/ftypes-int.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/epan/ftypes/ftypes-int.h b/epan/ftypes/ftypes-int.h
new file mode 100644
index 0000000000..4e6ce75bee
--- /dev/null
+++ b/epan/ftypes/ftypes-int.h
@@ -0,0 +1,60 @@
+#ifndef FTYPES_INT_H
+#define FTYPES_INT_H
+
+#include "packet.h"
+#include "ftypes.h"
+
+typedef void (*FtypeFromTvbuffFunc)(field_info*, tvbuff_t*, int, int, gboolean);
+typedef void (*FvalueNewFunc)(fvalue_t*);
+typedef void (*FvalueFreeFunc)(fvalue_t*);
+
+typedef gboolean (*FvalueFromString)(fvalue_t*, char*, LogFunc);
+
+typedef void (*FvalueSetFunc)(fvalue_t*, gpointer, gboolean);
+typedef void (*FvalueSetIntegerFunc)(fvalue_t*, guint32);
+typedef void (*FvalueSetFloatingFunc)(fvalue_t*, gdouble);
+
+typedef gpointer (*FvalueGetFunc)(fvalue_t*);
+typedef guint32 (*FvalueGetIntegerFunc)(fvalue_t*);
+typedef double (*FvalueGetFloatingFunc)(fvalue_t*);
+
+typedef gboolean (*FvalueCmp)(fvalue_t*, fvalue_t*);
+
+typedef guint (*FvalueLen)(fvalue_t*);
+typedef void (*FvalueSlice)(fvalue_t*, GByteArray *, guint, guint);
+
+struct _ftype_t {
+ const char *name;
+ const char *pretty_name;
+ int wire_size;
+ FvalueNewFunc new_value;
+ FvalueFreeFunc free_value;
+ FtypeFromTvbuffFunc from_tvbuff;
+ FvalueFromString val_from_string;
+
+ /* could be union */
+ FvalueSetFunc set_value;
+ FvalueSetIntegerFunc set_value_integer;
+ FvalueSetFloatingFunc set_value_floating;
+
+ /* could be union */
+ FvalueGetFunc get_value;
+ FvalueGetIntegerFunc get_value_integer;
+ FvalueGetFloatingFunc get_value_floating;
+
+ FvalueCmp cmp_eq;
+ FvalueCmp cmp_ne;
+ FvalueCmp cmp_gt;
+ FvalueCmp cmp_ge;
+ FvalueCmp cmp_lt;
+ FvalueCmp cmp_le;
+
+ FvalueLen len;
+ FvalueSlice slice;
+};
+
+
+void
+ftype_register(enum ftenum ftype, ftype_t *ft);
+
+#endif