From owner-freebsd-ipfw@FreeBSD.ORG Mon Dec 3 08:11:43 2012 Return-Path: Delivered-To: freebsd-ipfw@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 707C02E6; Mon, 3 Dec 2012 08:11:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id DC12E8FC15; Mon, 3 Dec 2012 08:11:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qB38BZHS040405; Mon, 3 Dec 2012 12:11:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qB38BYgH040404; Mon, 3 Dec 2012 12:11:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 3 Dec 2012 12:11:34 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: [CFT] Virtual BPF interfaces (was: CFR: ipfw0 pseudo-interface clonable) Message-ID: <20121203081134.GO14202@glebius.int.ru> References: <4F96D11B.2060007@FreeBSD.org> <20120425.020518.406495893112283552.hrs@allbsd.org> <4F96E71B.9020405@FreeBSD.org> <20120427.084414.1142593201575277510.hrs@allbsd.org> <4FD4AD29.3040204@FreeBSD.org> <50BAA552.1010707@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50BAA552.1010707@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-ipfw@FreeBSD.org, Hiroki Sato , delphij@FreeBSD.org, "freebsd-net@freebsd.org" X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 08:11:43 -0000 On Sun, Dec 02, 2012 at 04:48:18AM +0400, Alexander V. Chernikov wrote: A> On 10.06.2012 18:20, Alexander V. Chernikov wrote: A> > On 27.04.2012 03:44, Hiroki Sato wrote: A> >> "Alexander V. Chernikov" wrote A> >> in<4F96E71B.9020405@FreeBSD.org>: A> >> A> >> me> On 24.04.2012 21:05, Hiroki Sato wrote: A> > A> > Proof-of-concept patch attached. A> A> Hopefully, libcap code is easily extendable. A> New version attached: A> * BPF code is now able to use 'virtual' interfaces without real ifnet A> * New bpfattach3() / bpfdetach3() routines were added to attach virtual A> ifaces A> * New BIOCGIFLIST ioctl is added to permit userland to retrieve A> available virtual interfaces A> * freebsd-specific 'platform_finddevs' version is added to libpcap code A> (new file) A> A> There are some rough edges (conditional code in pcap-bpf.c, lack of A> documentation, maybe some style issues), but generally it seems to work A> and does not interfere with contrib/ code much (from my point of view). A> A> ipfw log device was converted to use new bpf(4) api, see attached patch. Nice proof of concept, Alexander! What does prevent us from unifing all bpf providers to be "virtual" in current terms? I think if we finish divorce between ifnet and bpf, the code would get simplier and you can proceed further with reducing locking overhead. -- Totus tuus, Glebius.