From: Pablo Neira <pablo@eurodev.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: netdev@oss.sgi.com, jamal <hadi@cyberus.ca>
Subject: Re: [RFC] textsearch infrastructure + skb_find_text()
Date: Thu, 05 May 2005 19:02:26 +0200 [thread overview]
Message-ID: <427A51A2.8090600@eurodev.net> (raw)
In-Reply-To: <20050504234036.GH18452@postel.suug.ch>
Hi Thomas,
Thomas Graf wrote:
> The patch is separated into 3 parts, the first one being the textsearch
> infrastructure itself followed by a simple Knuth-Morris-Pratt
> implementation for reference. I'm also working on what could be called
> the smallest regular expression implementation ever but I left that
> out for now since it still has issues. Last but not least the
> function skb_find_text() written in a hurry and probably not yet
> correct but you should get the idea. From a userspace perspective
> the first user will be an ematch but writing it will be peanuts
> so I left it out for now.
>
> Basically what it looks like right now is:
>
> int pos;
> struct ts_state;
> struct ts_config *conf = textsearch_prepare("kmp", "hanky", 5, GFP_KERNEL, 1);
>
> /* search for "hanky" at offset 20 until end of packet */
> for (pos = skb_find_text(skb, 20, INT_MAX, conf, &state;
> pos >= 0;
> pos = textsearch_next(conf, &state)) {
> printk("Need a hanky? I found one at offset %d.\n", pos);
> }
>
> textsearch_put(conf);
> kfree(conf);
I haven't got too much time to review this stuff in deep though.
Impressive work, but I still miss something, some comments:
- A custom destroy function in ts_ops.
- I don't see a way to look for matches in fragments. I mean, say we've
got "dancing " in a fragment and "chicken" in the next one. Currently we
don't get a match.
- I particularly like Rusty's skb iterator, well you've refactored that
code anyway.
I've been reworking the framework for string matching that I sent you
two/three months ago, you've definitely worked on a good base. Since
then I've introduced a lot of changes and actually I've been testing it
(ick, that means that we've clashed!).
I think that I can merge both works and then roll on. I still need more
time to study more in deep your proposition.
--
Pablo
next prev parent reply other threads:[~2005-05-05 17:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-04 23:40 [RFC] textsearch infrastructure + skb_find_text() Thomas Graf
2005-05-05 12:42 ` jamal
2005-05-05 14:12 ` Thomas Graf
2005-05-05 17:02 ` Pablo Neira [this message]
2005-05-05 17:42 ` Thomas Graf
2005-05-06 1:33 ` Pablo Neira
2005-05-06 12:36 ` Thomas Graf
2005-05-06 13:04 ` jamal
2005-05-06 14:43 ` Thomas Graf
2005-05-07 13:03 ` Jamal Hadi Salim
2005-05-08 11:45 ` Thomas Graf
2005-05-06 21:44 ` Thomas Graf
2005-05-07 0:17 ` YOSHIFUJI Hideaki / 吉藤英明
2005-05-07 0:36 ` Thomas Graf
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=427A51A2.8090600@eurodev.net \
--to=pablo@eurodev.net \
--cc=hadi@cyberus.ca \
--cc=netdev@oss.sgi.com \
--cc=tgraf@suug.ch \
/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).