From owner-freebsd-questions Mon Feb 4 19:42:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by hub.freebsd.org (Postfix) with ESMTP id 1252037B425 for ; Mon, 4 Feb 2002 19:42:21 -0800 (PST) Received: from k7.mavetju.org (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id D3BD42B78A; Tue, 5 Feb 2002 04:42:07 +0100 (CET) Received: by k7.mavetju.org (Postfix, from userid 1001) id 8947A5B3; Tue, 5 Feb 2002 14:41:42 +1100 (EST) Date: Tue, 5 Feb 2002 14:41:42 +1100 From: Edwin Groothuis To: "Ronald F. Guilmette" Cc: freebsd-questions@freebsd.org Subject: Re: Need a simple Berkeley Packet Filter state machine `program' Message-ID: <20020205144142.R1599@k7.mavetju.org> Mail-Followup-To: Edwin Groothuis , "Ronald F. Guilmette" , freebsd-questions@freebsd.org References: <8743.1012876193@monkeys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <8743.1012876193@monkeys.com>; from rfg@monkeys.com on Mon, Feb 04, 2002 at 06:29:53PM -0800 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 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 Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: ------------------+ http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message