From owner-freebsd-questions Mon Feb 4 20:43:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from segfault.monkeys.com (246.dsl6660157.rstatic.surewest.net [66.60.157.246]) by hub.freebsd.org (Postfix) with ESMTP id BB9ED37B422 for ; Mon, 4 Feb 2002 20:42:41 -0800 (PST) Received: from monkeys.com (localhost [127.0.0.1]) by segfault.monkeys.com (Postfix) with ESMTP id BD3E5660B; Mon, 4 Feb 2002 20:42:40 -0800 (PST) To: Edwin Groothuis Cc: freebsd-questions@freebsd.org Subject: Re: Need a simple Berkeley Packet Filter state machine `program' In-reply-to: Your message of Tue, 05 Feb 2002 14:41:42 +1100. <20020205144142.R1599@k7.mavetju.org> Date: Mon, 04 Feb 2002 20:42:40 -0800 Message-ID: <9583.1012884160@monkeys.com> From: "Ronald F. Guilmette" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20020205144142.R1599@k7.mavetju.org>, you wrote: >On Mon, Feb 04, 2002 at 06:29:53PM -0800, Ronald F. Guilmette wrote: >> I could probably figure out how to do this all myself, but my sense >> of it is that it would take me some time, and I'd have to look at a LOT >> of other BPF examples first. >> >> If somebody who is already fluent in the BPF state machine language >> could just give me the appropriate state-machine code, that would >> probably save me quite a lot of time. > >If you like, you can use the ngrep-lib there is in the ports-collection. >It uses the same syntax as you can use with tcpdump for its filter >and has callback functions for when it receives data. See >/usr/ports/net/ngrep-lib or http://www.mavetju.org/networking/programming.php Thank you! Thanks you! Thanks you! I think this will fit the bill nicely. (I have to confess that I didn't even know about the tcpdump language that can be used to specify a filter until about 5 minutes _after_ I made my earlier post. But as soon as I saw the part of the tcpdump man page describeing that, I said to myself ``Yea! _THAT'S_ what I need!'' Now you tell me that that's available in a library form. That's _perfect_ for what I want to do.) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message