From owner-freebsd-net@FreeBSD.ORG Thu Mar 20 10:12:19 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 03B19106564A for ; Thu, 20 Mar 2008 10:12:19 +0000 (UTC) (envelope-from alireza.torabi@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by mx1.freebsd.org (Postfix) with ESMTP id DA7AE8FC24 for ; Thu, 20 Mar 2008 10:12:18 +0000 (UTC) (envelope-from alireza.torabi@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so933540waf.3 for ; Thu, 20 Mar 2008 03:12:18 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=IrMaK8UrRApa/vfmHHfaLKttHNM6v8ESZ0cNdFC3kEA=; b=pSZgHUmuB69ZBKNEknuxHYVJ5gV+Hm9T7BjvT0BCXzQNOdClAJ0y8TxwRbQq7/WgiHJST6MsIuyOFd7ZZyWEDZBegaBKk3vpFmXD+uqcU8vPazoIXI1pDxmwbW+Z6tCK29HMZlm51VRLNdrS/fq5kl22uVzj1vU7GY5JFjosLKc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RQ9Z7to8gtT4/vSzYhpLbwZa3s30mZgqpo3fXYKu0QW5d1d5bz0NI2Ir5eNdKXPsuYBUs19UL/lvpM5ljrYF7rYBaxdWUNkrUYQ/2I2NqdTv8A0ehp18Bdka6fFxZaNBNJbpzZhT0jB65SmlCdaPVDjTogvRvpS+hUUQhjKtsDQ= Received: by 10.114.13.1 with SMTP id 1mr3146593wam.60.1206006232730; Thu, 20 Mar 2008 02:43:52 -0700 (PDT) Received: by 10.115.78.3 with HTTP; Thu, 20 Mar 2008 02:43:52 -0700 (PDT) Message-ID: Date: Thu, 20 Mar 2008 09:43:52 +0000 From: "Alireza Torabi" To: freebsd-net@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Subject: 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 10:12:19 -0000 Hi All, Is it possible to redirect/send/divert a bpf packet capture of one interface to a listening tcp socket on another interface of the same machine? Here is my problem: I'm capturing packets on one interface but for some specific tcp packets let's say from host A to host B on port P, I want to hijack the packet and send it to a listening tcp socket on the other interface and reply an "Access Denied" message. I'd like to use the tcp socket on the other interface as it's not possible to communicate over the interface that's doing the packet capture and I don't want to invent the wheel by doing all the tcp/tcb states hence using a tcp socket. Thanks a lot Alireza PS. I've posted this to freebsd-questions too. My apologies.