From owner-freebsd-emulation@FreeBSD.ORG Wed Aug 26 17:46:57 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80971106568B for ; Wed, 26 Aug 2009 17:46:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outD.internet-mail-service.net (outd.internet-mail-service.net [216.240.47.227]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6998FC29 for ; Wed, 26 Aug 2009 17:46:57 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 67C47B98AA for ; Wed, 26 Aug 2009 10:33:40 -0700 (PDT) X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 32C952D600F for ; Wed, 26 Aug 2009 10:33:40 -0700 (PDT) Message-ID: <4A9571F3.1010605@elischer.org> Date: Wed, 26 Aug 2009 10:33:39 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: freebsd-emulation@freebsd.org References: <20090826120020.27CAE106570D@hub.freebsd.org> In-Reply-To: <20090826120020.27CAE106570D@hub.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: freebsd-emulation Digest, Vol 330, Issue 3 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2009 17:46:57 -0000 ----- Robert said: > Hi Fredrik: > > The technical approach you've taken here is a bit unusual > and potentially quite fragile -- replacing the method pointers > on struct ifnet's maintained by other drivers and "borrowing" > spare fields is likely going to prove problematic in the future > (and, in fact, already). > > It looks like a lot of what the driver is trying to accomplish > can already be one entirely from userspace using bpf(4): taking > a tee of incoming frames arriving at the NIC, perhaps selecting > down to ones to specific ethernet addresses, taking the card into > and out of promiscuous mode, and injecting frames into the > output path, are exactly what BPF is designed to support. I > was wondering if you'd looked at this approach as an alternative > to a custom kernel driver? > > Robert -------------End quote---------- BPF is pretty lousy for that job.. Take a look at the netgraph hooks at interface level to divert packets to other destinations.