From: Werner Almesberger <wa@almesberger.net>
To: Ethan Sommer <sommere@ethanet.com>
Cc: Philippe Biondi <biondi@cartel-securite.fr>,
Jamal Hadi <hadi@shell.cyberus.ca>,
Martin Josefsson <gandalf@wlug.westbo.se>,
"David S. Miller" <davem@redhat.com>,
linux-net@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [Fwd: [ANNOUNCE] Layer-7 Filter for Linux QoS]
Date: Sat, 24 May 2003 01:11:48 -0300 [thread overview]
Message-ID: <20030524011148.A29146@almesberger.net> (raw)
In-Reply-To: <3ECC0B14.7020105@ethanet.com>; from sommere@ethanet.com on Wed, May 21, 2003 at 06:26:12PM -0500
Ethan Sommer wrote:
> I take it back, it is regular (kinda) but you can't to it with a
> deterministic finite atomaton. If there is a cycle in pattern1, off of
> which pattern2 has a branch, then you would need to count how many times
> you have gone around the cycle to know where to jump to in pattern2 if
> it fails to match pattern1
You mean things like
a*b -> 1
ac -> 2
? You can still express this with a DFA, i.e.
a(c|a*b)
Of course, if you have patterns that match the same string, you
need to decide at some point whether you want longest or shortest
match.
For the idea of using regexps for all types of classification:
this is definitely something I'd love to see. The problem I've
encountered is that it seems prohibitively expensive to
construct an efficient DFA from human-friendly input.
I experimented a bit with this in tcng, but never got to a
usable solution. (tcng can handle arbitrary expressions, but
it does this by following a collection of rules for rewriting
the expression into a canonical and possibly redundant form.
Basically, it does what a human being would do if given the
task of simplifying a Boolan expression. This is usually quick,
but has very ugly worst-case overhead.)
I never thought of viewing this as a regexp, though. For this,
one would need to be able to introduce positions, e.g. through
the ability of putting "^" in the middle of an expression.
Example:
^(A|B|C)(^D)|^(E|D)
where A ... E would be strings containing 0, 1, or .
Example:
ip_tos == 0xb8: ^........10111000
Now, how to turn such expressions with embedded ^ efficiently
into a DFA ?
- Werner
--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
next prev parent reply other threads:[~2003-05-24 4:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-19 3:01 [Fwd: [ANNOUNCE] Layer-7 Filter for Linux QoS] David S. Miller
2003-05-20 0:38 ` Jamal Hadi
2003-05-20 5:07 ` Ethan Sommer
2003-05-20 12:14 ` Jamal Hadi
2003-05-20 14:39 ` Ethan Sommer
2003-05-20 15:00 ` Jamal Hadi
2003-05-20 15:15 ` Martin Josefsson
2003-05-21 12:39 ` Jamal Hadi
2003-05-21 13:20 ` Philippe Biondi
2003-05-21 15:46 ` Ethan Sommer
2003-05-21 23:11 ` Philippe Biondi
2003-05-21 23:26 ` Ethan Sommer
2003-05-22 8:26 ` Philippe Biondi
2003-05-22 14:40 ` Ethan Sommer
2003-05-24 7:22 ` Werner Almesberger
2003-05-24 4:11 ` Werner Almesberger [this message]
2003-05-24 4:23 ` Werner Almesberger
2003-05-21 15:42 ` Ethan Sommer
2003-05-20 19:50 ` Ethan Sommer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030524011148.A29146@almesberger.net \
--to=wa@almesberger.net \
--cc=biondi@cartel-securite.fr \
--cc=davem@redhat.com \
--cc=gandalf@wlug.westbo.se \
--cc=hadi@shell.cyberus.ca \
--cc=linux-net@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=sommere@ethanet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).