aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dfilter')
-rw-r--r--epan/dfilter/Makefile.am2
-rw-r--r--epan/dfilter/Makefile.nmake2
-rwxr-xr-xepan/dfilter/README.dfilter214
-rw-r--r--epan/dfilter/dfilter-int.h2
-rw-r--r--epan/dfilter/dfilter.c2
-rw-r--r--epan/dfilter/dfilter.h2
-rw-r--r--epan/dfilter/dfvm.c2
-rw-r--r--epan/dfilter/dfvm.h2
-rw-r--r--epan/dfilter/drange.c2
-rw-r--r--epan/dfilter/drange.h2
-rw-r--r--epan/dfilter/gencode.c2
-rw-r--r--epan/dfilter/glib-util.c2
-rw-r--r--epan/dfilter/glib-util.h2
-rw-r--r--epan/dfilter/grammar.lemon2
-rw-r--r--epan/dfilter/scanner.l2
-rw-r--r--epan/dfilter/semcheck.c2
-rw-r--r--epan/dfilter/semcheck.h2
-rw-r--r--epan/dfilter/sttype-integer.c2
-rw-r--r--epan/dfilter/sttype-pointer.c2
-rw-r--r--epan/dfilter/sttype-range.c2
-rw-r--r--epan/dfilter/sttype-range.h2
-rw-r--r--epan/dfilter/sttype-string.c2
-rw-r--r--epan/dfilter/sttype-test.c2
-rw-r--r--epan/dfilter/sttype-test.h2
-rw-r--r--epan/dfilter/syntax-tree.c2
-rw-r--r--epan/dfilter/syntax-tree.h2
26 files changed, 132 insertions, 132 deletions
diff --git a/epan/dfilter/Makefile.am b/epan/dfilter/Makefile.am
index 13567f10f4..dae7fe7a78 100644
--- a/epan/dfilter/Makefile.am
+++ b/epan/dfilter/Makefile.am
@@ -1,6 +1,6 @@
# Makefile.am
#
-# $Id: Makefile.am,v 1.11 2004/03/24 21:27:44 obiot Exp $
+# $Id$
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/Makefile.nmake b/epan/dfilter/Makefile.nmake
index 5e0f6bcdef..21038114aa 100644
--- a/epan/dfilter/Makefile.nmake
+++ b/epan/dfilter/Makefile.nmake
@@ -1,7 +1,7 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
-# $Id: Makefile.nmake,v 1.14 2004/06/26 02:16:16 guy Exp $
+# $Id$
include ..\..\config.nmake
diff --git a/epan/dfilter/README.dfilter b/epan/dfilter/README.dfilter
index fc45380dff..4c2cb69cf9 100755
--- a/epan/dfilter/README.dfilter
+++ b/epan/dfilter/README.dfilter
@@ -1,107 +1,107 @@
-$Id: README.dfilter,v 1.2 2004/05/08 11:40:29 obiot Exp $
-
-How does the display filter logic work?
-=======================================
-
-scanner.l looks at the display filter string and finds reserved words,
-punctuation, etc. This information gets passed to the parser produced by
-grammar.lemon. The grammar's job is to create a syntax-tree out of the
-information provided by the scanner. The syntax tree organizes the
-information from the scanner into something that is grammatical in the
-dfilter language.
-
-The routines in semcheck.c then check the semantics of the syntax tree, and do
-any modifications necessary to the syntax tree to make the dfilter work....
-things like converting val_strings to integers, etc.
-
-Then gencode.c converts the syntax tree into a list of "dfvm" (display filter
-virtual machine) instructions. These dfvm instructions are what runs the
-display filter engine.
-
-Example: add an 'in' display filter operation
-=============================================
-
-This example has been discussed on ethereal-dev in April 2004. It illustrates
-how a more complex operation can be added to the display filter language.
-
-Question:
-
- If I want to add an 'in' display filter operation, I need to define
- several things. This can happen in different ways. For instance,
- every value from the "in" value collection will result in a test.
- There are 2 options here, either a test for a single value:
-
- (x in {a b c})
-
- or a test for a value in a given range:
-
- (x in {a ... z})
-
- or even a combination of both. The former example can be reduced to:
-
- ((x == a) or (x == b) or (x == c))
-
- while the latter can be reduced to
-
- ((x >= MIN(a, z)) and (x <= MAX(a, z)))
-
- I understand that I can replace "x in {" with the following steps:
- first store x in the "in" test buffer, then add "(" to the display
- filter expression internally.
-
- Similarly I can replace the closing brace "}" with the following steps:
- release x from the "in" test buffer and then add ")" to the display
- filter expression internally.
-
- How could I do this?
-
-Answer:
-
- This could be done in grammar.lemon. The grammar would produce syntax
- tree nodes, combining them with "or", when it is given tokens that
- represent the "in" syntax.
-
- It could also be done later in the process, maybe in semcheck.c. But
- if you can do it earlier, in grammar.lemon, then you shouldn't have to
- worry about modifying anything in semcheck.c, as the syntax tree that
- is passed to semcheck.c won't contain any new type of operators... just
- lots of nodes combined with "or".
-
-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.
+$Id$
+
+How does the display filter logic work?
+=======================================
+
+scanner.l looks at the display filter string and finds reserved words,
+punctuation, etc. This information gets passed to the parser produced by
+grammar.lemon. The grammar's job is to create a syntax-tree out of the
+information provided by the scanner. The syntax tree organizes the
+information from the scanner into something that is grammatical in the
+dfilter language.
+
+The routines in semcheck.c then check the semantics of the syntax tree, and do
+any modifications necessary to the syntax tree to make the dfilter work....
+things like converting val_strings to integers, etc.
+
+Then gencode.c converts the syntax tree into a list of "dfvm" (display filter
+virtual machine) instructions. These dfvm instructions are what runs the
+display filter engine.
+
+Example: add an 'in' display filter operation
+=============================================
+
+This example has been discussed on ethereal-dev in April 2004. It illustrates
+how a more complex operation can be added to the display filter language.
+
+Question:
+
+ If I want to add an 'in' display filter operation, I need to define
+ several things. This can happen in different ways. For instance,
+ every value from the "in" value collection will result in a test.
+ There are 2 options here, either a test for a single value:
+
+ (x in {a b c})
+
+ or a test for a value in a given range:
+
+ (x in {a ... z})
+
+ or even a combination of both. The former example can be reduced to:
+
+ ((x == a) or (x == b) or (x == c))
+
+ while the latter can be reduced to
+
+ ((x >= MIN(a, z)) and (x <= MAX(a, z)))
+
+ I understand that I can replace "x in {" with the following steps:
+ first store x in the "in" test buffer, then add "(" to the display
+ filter expression internally.
+
+ Similarly I can replace the closing brace "}" with the following steps:
+ release x from the "in" test buffer and then add ")" to the display
+ filter expression internally.
+
+ How could I do this?
+
+Answer:
+
+ This could be done in grammar.lemon. The grammar would produce syntax
+ tree nodes, combining them with "or", when it is given tokens that
+ represent the "in" syntax.
+
+ It could also be done later in the process, maybe in semcheck.c. But
+ if you can do it earlier, in grammar.lemon, then you shouldn't have to
+ worry about modifying anything in semcheck.c, as the syntax tree that
+ is passed to semcheck.c won't contain any new type of operators... just
+ lots of nodes combined with "or".
+
+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.
diff --git a/epan/dfilter/dfilter-int.h b/epan/dfilter/dfilter-int.h
index 51e3a4b530..00a03d07f5 100644
--- a/epan/dfilter/dfilter-int.h
+++ b/epan/dfilter/dfilter-int.h
@@ -1,5 +1,5 @@
/*
- * $Id: dfilter-int.h,v 1.9 2004/06/15 10:38:14 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/dfilter.c b/epan/dfilter/dfilter.c
index 35efd9a8fb..08a4b55a66 100644
--- a/epan/dfilter/dfilter.c
+++ b/epan/dfilter/dfilter.c
@@ -1,5 +1,5 @@
/*
- * $Id: dfilter.c,v 1.18 2004/06/16 07:33:46 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/dfilter.h b/epan/dfilter/dfilter.h
index 764876223b..f2f16d783f 100644
--- a/epan/dfilter/dfilter.h
+++ b/epan/dfilter/dfilter.h
@@ -1,5 +1,5 @@
/*
- * $Id: dfilter.h,v 1.9 2004/05/09 10:03:40 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/dfvm.c b/epan/dfilter/dfvm.c
index 8d4b9fa6f6..ee99069603 100644
--- a/epan/dfilter/dfvm.c
+++ b/epan/dfilter/dfvm.c
@@ -1,5 +1,5 @@
/*
- * $Id: dfvm.c,v 1.15 2004/02/27 12:00:30 obiot Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/dfvm.h b/epan/dfilter/dfvm.h
index 16292b03ce..862bb0a313 100644
--- a/epan/dfilter/dfvm.h
+++ b/epan/dfilter/dfvm.h
@@ -1,5 +1,5 @@
/*
- * $Id: dfvm.h,v 1.11 2004/02/27 12:00:30 obiot Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/drange.c b/epan/dfilter/drange.c
index 7e03790434..5a374ea786 100644
--- a/epan/dfilter/drange.c
+++ b/epan/dfilter/drange.c
@@ -1,7 +1,7 @@
/* drange.c
* Routines for providing general range support to the dfilter library
*
- * $Id: drange.c,v 1.4 2002/08/28 20:40:55 jmayer Exp $
+ * $Id$
*
* Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
*
diff --git a/epan/dfilter/drange.h b/epan/dfilter/drange.h
index a0d1f3bf4c..6a139681fc 100644
--- a/epan/dfilter/drange.h
+++ b/epan/dfilter/drange.h
@@ -1,7 +1,7 @@
/* drange.h
* Routines for providing general range support to the dfilter library
*
- * $Id: drange.h,v 1.4 2004/01/18 15:34:23 jmayer Exp $
+ * $Id$
*
* Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
*
diff --git a/epan/dfilter/gencode.c b/epan/dfilter/gencode.c
index 281d676cc6..1c56896311 100644
--- a/epan/dfilter/gencode.c
+++ b/epan/dfilter/gencode.c
@@ -1,5 +1,5 @@
/*
- * $Id: gencode.c,v 1.13 2004/02/27 12:00:30 obiot Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/glib-util.c b/epan/dfilter/glib-util.c
index 880e91eb29..6e2e5f8f25 100644
--- a/epan/dfilter/glib-util.c
+++ b/epan/dfilter/glib-util.c
@@ -1,4 +1,4 @@
-/* $Id: glib-util.c,v 1.2 2002/08/28 20:40:55 jmayer Exp $ */
+/* $Id$ */
#include <string.h>
#include <glib.h>
diff --git a/epan/dfilter/glib-util.h b/epan/dfilter/glib-util.h
index 90a81f7eed..1460bdee1c 100644
--- a/epan/dfilter/glib-util.h
+++ b/epan/dfilter/glib-util.h
@@ -1,4 +1,4 @@
-/* $Id: glib-util.h,v 1.1 2001/02/01 20:21:18 gram Exp $ */
+/* $Id$ */
char*
g_substrdup(const char *s, int start, int len);
diff --git a/epan/dfilter/grammar.lemon b/epan/dfilter/grammar.lemon
index 76bab3c851..c9d66fba2b 100644
--- a/epan/dfilter/grammar.lemon
+++ b/epan/dfilter/grammar.lemon
@@ -1,4 +1,4 @@
-/* $Id: grammar.lemon,v 1.10 2004/06/03 07:36:24 guy Exp $ */
+/* $Id$ */
%include {
#ifdef HAVE_CONFIG_H
diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l
index e4fdaca5c6..10d3f19b28 100644
--- a/epan/dfilter/scanner.l
+++ b/epan/dfilter/scanner.l
@@ -1,6 +1,6 @@
%{
/*
- * $Id: scanner.l,v 1.20 2004/06/03 07:36:24 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/semcheck.c b/epan/dfilter/semcheck.c
index 20e933e5a9..8672e07906 100644
--- a/epan/dfilter/semcheck.c
+++ b/epan/dfilter/semcheck.c
@@ -1,5 +1,5 @@
/*
- * $Id: semcheck.c,v 1.28 2004/06/15 10:16:10 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/semcheck.h b/epan/dfilter/semcheck.h
index ddd44a89b4..fec5d80e96 100644
--- a/epan/dfilter/semcheck.h
+++ b/epan/dfilter/semcheck.h
@@ -1,5 +1,5 @@
/*
- * $Id: semcheck.h,v 1.3 2002/08/28 20:40:56 jmayer Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/sttype-integer.c b/epan/dfilter/sttype-integer.c
index f046b65cfd..c8765dac0f 100644
--- a/epan/dfilter/sttype-integer.c
+++ b/epan/dfilter/sttype-integer.c
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-integer.c,v 1.2 2002/08/28 20:40:56 jmayer Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/sttype-pointer.c b/epan/dfilter/sttype-pointer.c
index aaaa0dd9d4..3879fdae14 100644
--- a/epan/dfilter/sttype-pointer.c
+++ b/epan/dfilter/sttype-pointer.c
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-pointer.c,v 1.3 2002/08/28 20:40:56 jmayer Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/sttype-range.c b/epan/dfilter/sttype-range.c
index a87c3e99b7..c1be33af6c 100644
--- a/epan/dfilter/sttype-range.c
+++ b/epan/dfilter/sttype-range.c
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-range.c,v 1.5 2002/08/28 20:40:56 jmayer Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/sttype-range.h b/epan/dfilter/sttype-range.h
index 3b11fd6543..b4fc480148 100644
--- a/epan/dfilter/sttype-range.h
+++ b/epan/dfilter/sttype-range.h
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-range.h,v 1.4 2002/08/28 20:40:56 jmayer Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/sttype-string.c b/epan/dfilter/sttype-string.c
index 160fce82d7..bc92d8ae8b 100644
--- a/epan/dfilter/sttype-string.c
+++ b/epan/dfilter/sttype-string.c
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-string.c,v 1.4 2003/07/25 03:44:01 gram Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/sttype-test.c b/epan/dfilter/sttype-test.c
index 930cf1121c..9a0408efaf 100644
--- a/epan/dfilter/sttype-test.c
+++ b/epan/dfilter/sttype-test.c
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-test.c,v 1.6 2004/02/27 12:00:31 obiot Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/sttype-test.h b/epan/dfilter/sttype-test.h
index 1814b8c236..ad615f0a4d 100644
--- a/epan/dfilter/sttype-test.h
+++ b/epan/dfilter/sttype-test.h
@@ -1,5 +1,5 @@
/*
- * $Id: sttype-test.h,v 1.6 2004/02/27 12:00:31 obiot Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
diff --git a/epan/dfilter/syntax-tree.c b/epan/dfilter/syntax-tree.c
index 53c9b31259..00dae06dd5 100644
--- a/epan/dfilter/syntax-tree.c
+++ b/epan/dfilter/syntax-tree.c
@@ -1,5 +1,5 @@
/*
- * $Id: syntax-tree.c,v 1.6 2004/06/03 07:36:25 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
diff --git a/epan/dfilter/syntax-tree.h b/epan/dfilter/syntax-tree.h
index 121e32e6f3..15c8d18745 100644
--- a/epan/dfilter/syntax-tree.h
+++ b/epan/dfilter/syntax-tree.h
@@ -1,5 +1,5 @@
/*
- * $Id: syntax-tree.h,v 1.6 2004/06/03 07:36:25 guy Exp $
+ * $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>