aboutsummaryrefslogtreecommitdiffstats
path: root/dfilter.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-08-03 15:04:33 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-08-03 15:04:33 +0000
commitaebcf2eb32cc8693056172c2ed7718880f2db85d (patch)
tree7e276869eedbacd669164d445e93812ee2402c62 /dfilter.c
parentfeaab633b56e6207a3d374a7a94defcd8bf42729 (diff)
Removed the "exists" keyword from the grammar. The name of a protocol or a
field by itself assumes you are checking for the existence of that protocol or field. Changed the format of the list of filterable fields in the man page. Developers: run "./configure" so that your configure script will re-create dfilter2pod from the new dfilter2pod.in svn path=/trunk/; revision=426
Diffstat (limited to 'dfilter.c')
-rw-r--r--dfilter.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/dfilter.c b/dfilter.c
index b5a79e5099..41587df426 100644
--- a/dfilter.c
+++ b/dfilter.c
@@ -1,7 +1,7 @@
/* dfilter.c
* Routines for display filters
*
- * $Id: dfilter.c,v 1.5 1999/08/01 04:28:07 gram Exp $
+ * $Id: dfilter.c,v 1.6 1999/08/03 15:04:25 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -158,7 +158,8 @@ clear_byte_array(gpointer data, gpointer user_data)
void
yyerror(char *s)
{
- fprintf(stderr, "%s\n", s);
+/* fprintf(stderr, "%s\n", s);
+ Do not report the error, just let yyparse() return 1 */
}
void
@@ -210,13 +211,10 @@ dfilter_apply_node(GNode *gnode, proto_tree *ptree, const guint8* pd)
switch(dnode->ntype) {
case variable:
- /* the only time we'll see a 'variable' at this point is if the display filter
- * checks the value of a single field: "tr.sr", for example. Inside a relation,
- * the relation code will retrieve the value of the variable
- */
- g_assert(!gnode_a && !gnode_b);
+ /* We'll never see this case because if the parser finds the name of
+ * a variable, it will cause it to be an 'existence' operation.
+ */
g_assert_not_reached();
- /*return check_single_variable(gnode, ptree, pd);*/
case logical:
return check_logical(dnode->value.logical, gnode_a, gnode_b, ptree, pd);
@@ -233,13 +231,13 @@ dfilter_apply_node(GNode *gnode, proto_tree *ptree, const guint8* pd)
case ipv4:
case boolean:
case ether:
- case ether_vendor:
case string:
case abs_time:
case bytes:
case ipxnet:
/* the only time we'll see these at this point is if the display filter
- * is really wacky. Just return TRUE */
+ * is really wacky. (like simply "192.168.1.1"). The parser as it stands
+ * now let these by. Just return TRUE */
g_assert(!gnode_a && !gnode_b);
return TRUE;
@@ -310,27 +308,6 @@ check_relation(gint operand, GNode *a, GNode *b, proto_tree *ptree, const guint8
return retval;
}
-#if 0
-static gboolean
-check_single_variable(GNode *gnode, proto_tree *ptree, guint8* pd)
-{
- dfilter_node *node = (dfilter_node*) (gnode->data);
- GArray *vals;
- gboolean retval;
-
-
- bytes_length = node->length;
- bytes_offset = node->offset;
- vals = get_values_from_ptree(node, ptree, pd);
-
- retval = node_a->check_relation_func(operand, vals_a, vals_b);
-
- g_array_free(vals, FALSE);
-
- return retval;
-}
-#endif
-
static gboolean
check_existence_in_ptree(dfilter_node *dnode, proto_tree *ptree)
{