From owner-freebsd-net@FreeBSD.ORG Fri Mar 21 18:16:51 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797EF106566C for ; Fri, 21 Mar 2008 18:16:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outN.internet-mail-service.net (outN.internet-mail-service.net [216.240.47.237]) by mx1.freebsd.org (Postfix) with ESMTP id 54E7D8FC1E for ; Fri, 21 Mar 2008 18:16:51 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Fri, 21 Mar 2008 11:16:57 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 111B12D600E; Fri, 21 Mar 2008 11:16:50 -0700 (PDT) Message-ID: <47E3FB93.1080501@elischer.org> Date: Fri, 21 Mar 2008 11:16:51 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Alireza Torabi References: <20080321063517.GK85901@server.vk2pj.dyndns.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Peter Jeremy , freebsd-net@freebsd.org Subject: Re: bpf packet capture and SOCK_STREAM socket redirects... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2008 18:16:51 -0000 Alireza Torabi wrote: > On Fri, Mar 21, 2008 at 6:35 AM, Peter Jeremy > wrote: >> On Thu, Mar 20, 2008 at 11:27:53AM +0000, Alireza Torabi wrote: >> >Imagine this: >> > >> > | (1) >> > packets >> > | | (4) >> > [nic1] [nic2] >> > bpf SOCK_STREAM >> > | (2) | >> > --------------------------------------- >> > [FreeBSD] (3) >> > >> >1) all user traffic are being monitored >> >2) bpf on [nic] is capturing these packets >> >3) after processing we know a connection is about to be established from A to B >> > >> >NOW: >> >4) I want to deliver this packet to the socket on [nic2] >> >and as this is a tcp socket it'll take care of it from there >> >(my code here for this sockets sends and arbitary data to A making it >> >think it came from B) >> >> Have a look at divert(4). I suspect it comes closest to what you want. >> >> -- >> Peter Jeremy >> Please excuse any delays as the result of my ISP's inability to implement >> an MTA that is either RFC2821-compliant or matches their claimed behaviour. >> > > Yes. It sounds promising. I was reading natd and planning to read ipfw > source interestingly! also I think you may want the 'fwd' call in ipfw... I don't quite understand your question.. (despite the picture) where ia A and where is B? and why 2 nics? User traffic where? on a switch? coming in and out of this machine? you need to define a little more of the picture.. Julian > Thanks > > Alireza > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"