From owner-freebsd-net@FreeBSD.ORG Thu Mar 20 11:27:54 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 885BC1065673 for ; Thu, 20 Mar 2008 11:27:54 +0000 (UTC) (envelope-from alireza.torabi@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by mx1.freebsd.org (Postfix) with ESMTP id 69A1F8FC1F for ; Thu, 20 Mar 2008 11:27:54 +0000 (UTC) (envelope-from alireza.torabi@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so962626waf.3 for ; Thu, 20 Mar 2008 04:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=SWcJpgSwigaBHmKYhe5uKjE+SohH5S9Y+vQfrtybEHM=; b=nRaUd6IgxR23LVic0xN6tIycfjqFD8KjWKTZ+jZ19aIR/XuLicb0xKaD0NgOCFqb6ijwuNqNuXdQSNT6TTbUdv76H3IEUImaOULZZwfChynMgX4oKh08vJrUJHy6INiPRodxyvZ90tfAJNL1g3H2N0pZTTu3AaDiN9FxxuYBAhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=msSEgk2TrpfDHdWqjkGx7qhKDeTq48Q8sfV+EtjcUZc96DW0Ap9XR+vT7y7HBL0J9X7Nje2UY6Txh4Ffa3eh1uu8L2VL8V6AF8e7AdPn4DxSaxjklT0oaCEniW/Zunj8eLJclHO2zJnhD+wkI5vxK6PErxGidqW3hjxb3ugwvpI= Received: by 10.114.89.1 with SMTP id m1mr3298986wab.77.1206012473640; Thu, 20 Mar 2008 04:27:53 -0700 (PDT) Received: by 10.115.78.3 with HTTP; Thu, 20 Mar 2008 04:27:53 -0700 (PDT) Message-ID: Date: Thu, 20 Mar 2008 11:27:53 +0000 From: "Alireza Torabi" To: vadim_nuclight@mail.ru In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: 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: Thu, 20 Mar 2008 11:27:54 -0000 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) hope this helps. On 3/20/08, Vadim Goncharov wrote: > Hi Alireza Torabi! > > On Thu, 20 Mar 2008 10:57:39 +0000; Alireza Torabi wrote about 'Re: bpf packet capture and SOCK_STREAM socket redirects...': > > > That's sort of the problem. I've got a data link capture of the packet > > (bpf) and let say I redirect this packet to a SOCK_STREAM on another > > machine and the whole thing will work fine (OK after rewritting some > > mac and ip and checksums...). > > > I just need to do this on the SOCK_STREAM of the same machine. If I > > try to put it in another way: > > > Is it possible to do a bpf write of a packet that can be seen by the > > interface the bpf is bound to? > > AFAIK, no. > > > This means that the interface does it's normal work and the packet > > will be deliverd to SOCK_STREAM bound to it. > > What exactly is your task? May be it is worth consider some other ways if > additional details are known. > > -- > WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru > [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight] > > _______________________________________________ > 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" >