Ethereal-dev: RE: [ethereal-dev] Re-work of display filter routines

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Peter Kjellerstedt <peter.kjellerstedt@xxxxxxxx>
Date: Fri, 7 Apr 2000 18:26:59 +0200
> -----Original Message-----
> From: Ashok Narayanan [mailto:ashokn@xxxxxxxxx]
> Sent: 07 April 2000 17:57
> To: gram@xxxxxxxxxx
> Cc: ethereal-dev@xxxxxxxx
> Subject: Re: [ethereal-dev] Re-work of display filter routines
> 
> > Someone asked for using the name of stored filters inside a filter.
> > Say you have a filter called "firewall". Then you could use it
> > in a filter via some syntax. Let's say the ampersand, like the
> > syntax for a Perl subroutine:
> > 
> > 	tcp.port == 22 && &firewall
> > 
> > (I'm open to suggestions on the syntax)
> 
> I like the idea - maybe $firewall would be slightly more intuitive for
> Perl programmers. Also, how about not having any disambiguating prefix
> character at all? You could forbid filter names that are known
> keywords (tcp, rsvp etc.) and then have a parse state at the end that
> attempts to match any unmatched keyword against a list of filter
> strings. So it would look something like this
> 
> 	 tcp.port == 22 && firewall

This might seem like a good idea at first, but I am not too sure it
would work out in the end. Consider the case where a user has a couple
of saved filters, then he updates his version of ethereal which has a
number of new protocols. One of these protocols uses a name which is
the same as one of the saved filters... What should happen now?
Should ethereal force the user to rename his filter (and in that case
all references to it from other saved filters)? Or will ethereal all
of a sudden start to use the new keyword instead of the old filter?
Neither seems like a good idea.

Can you have spaces in a filter name? In that case maybe simply
saying that a string surrounded by quotes is a filter name. This
could be combined with the idea of no prefix character to allow you
to quote a filter name that clashes, and leave it be if you know
that there is no problem.

> -Ashok

//Peter