wireshark/epan/dfilter
Jörg Mayer b7803c8fc6 Make libethereal and libwiretap shared libs.
svn path=/trunk/; revision=10368
2004-03-13 10:15:36 +00:00
..
.cvsignore Forgot *.la 2004-02-09 17:23:59 +00:00
Makefile.am Make libethereal and libwiretap shared libs. 2004-03-13 10:15:36 +00:00
Makefile.nmake epan don't need GTK_CFLAGS as GTK isn't used, 2004-01-22 19:27:59 +00:00
README.dfilter First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
dfilter-int.h Use -1 rather than 0 as the SCAN_FAILED return value from the lexical 2004-02-11 22:52:54 +00:00
dfilter.c Use -1 rather than 0 as the SCAN_FAILED return value from the lexical 2004-02-11 22:52:54 +00:00
dfilter.h "dfilter_compile()" doesn't modify the string pointed to by its first 2002-12-02 23:28:16 +00:00
dfvm.c First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
dfvm.h First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
drange.c Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
drange.h Warning fix when compiling with -strict-prototypes 2004-01-18 15:34:23 +00:00
gencode.c First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
gencode.h Provide for per-protocol-tree data in the proto_tree code. 2001-12-18 19:09:08 +00:00
glib-util.c Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
glib-util.h Create a more modular type system for the FT_* types. Put them 2001-02-01 20:21:25 +00:00
grammar.lemon First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
scanner.l First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
semcheck.c First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
semcheck.h Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
sttype-integer.c Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
sttype-pointer.c Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
sttype-range.c Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
sttype-range.h Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
sttype-string.c Add to the fundamental types passed between the scanner and the parser. 2003-07-25 03:44:05 +00:00
sttype-test.c First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
sttype-test.h First attempt at "bitwise AND" display filter operator. 2004-02-27 12:00:32 +00:00
syntax-tree.c Removed trailing whitespaces from .h and .c files using the 2002-08-28 20:41:00 +00:00
syntax-tree.h Add to the fundamental types passed between the scanner and the parser. 2003-07-25 03:44:05 +00:00

README.dfilter

$Id: README.dfilter,v 1.1 2004/02/27 12:00:30 obiot Exp $

How to add an operator FOO to the display filter language?
==========================================================

Go to ethereal/epan/dfilter/

Edit grammar.lemon and add the operator. Add the operator FOO and the test logic (defining TEST_OP_FOO).

Edit scanner.l and add the operator name(s) hence defining TOKEN_TEST_FOO. Also update the simple() or add the new operand's code.

Edit sttype-test.h and add the TEST_OP_FOO to the list of test operations.

Edit sttype-test.c and add TEST_OP_FOO to the num_operands() method.

Edit gencode.c, add TEST_OP_FOO in the gen_test() method by defining ANY_FOO.

Edit dfvm.h and add ANY_FOO to the enum dfvm_opcode_t structure.

Edit dfvm.c and add ANY_FOO to dfvm_dump() (for the dftest display filter test binary), to dfvm_apply() hence defining the methods fvalue_foo().

Edit semcheck.c and look at the check_relation_XXX() methods if they still apply to the foo operator; if not, amend the code. Start from the check_test() method to discover the logic.

Go to ethereal/epan/ftypes/

Edit ftypes.h and declare the fvalue_foo(), ftype_can_foo() and fvalue_foo() methods. Add the cmp_foo() method to the struct _ftype_t.

This is the first time that a make in ethereal/epan/dfilter/ can succeed. If it fails, then some code in the previously edited files must be corrected.

Edit ftypes.c and define the fvalue_foo() method with its associated logic. Define also the ftype_can_foo() and fvalue_foo() methods.

Edit all ftype-*.c files and add the required fvalue_foo() methods.

This is the point where you should be able to compile without errors in ethereal/epan/ftypes/. If not, first fix the errors.

Go to ethereal/epan/ and run make. If this one succeeds, then we're almost done as no errors should occur here.

Go to ethereal/ and run make. One thing to do is make dftest and see if you can construct valid display filters with your new operator. Or you may want to move directly to the generation of ethereal.

Look also at ethereal/gtk/dfilter_expr_dlg.c and edit the display filter expression generator.