From owner-freebsd-usb@FreeBSD.ORG Wed Nov 24 18:54:14 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12864106566C; Wed, 24 Nov 2010 18:54:14 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 327938FC0A; Wed, 24 Nov 2010 18:54:12 +0000 (UTC) Received: by fxm19 with SMTP id 19so63119fxm.13 for ; Wed, 24 Nov 2010 10:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent:organization:x-operation-sytem; bh=Jc8pmiF4ZHxyJXck3AR7b+Thmj+vpwUhp03VoQXncjg=; b=Z4fnPngfg/HZJ26/QYX42QQq+J2ZpjMQZcrvd3vdRHc9/ATkoBBteXaI2fZTzyJiie FqymNGW58JyMQoLkK9IIAPWIgDnufrJBjx1FEXfPiYjmOcNvz3ZOqYaZmvPcFg1pGov7 RjOC3CGPJ6p33MjYr5VunFdARb4ydyHLXErxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent:organization:x-operation-sytem; b=BX6DCDUuG/6f1nn6KB6ymqmkY++Ds7tF1u24d3qxkkH9BtlNAp5V3pLQIGtYLdw9W6 zViUPKHt04CWozF63RPvQCN5C4+VVriq/qT/B2PfEuNc15iV93d68PstEagc6DM2nT8L 3zOnGbpNI8WjHtmudZJIBmp1mHbJi2glj6LcM= Received: by 10.223.120.84 with SMTP id c20mr1810875far.102.1290624851964; Wed, 24 Nov 2010 10:54:11 -0800 (PST) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id c11sm1411673fav.26.2010.11.24.10.54.08 (version=SSLv3 cipher=RC4-MD5); Wed, 24 Nov 2010 10:54:10 -0800 (PST) Received: by weongyo (sSMTP sendmail emulation); Wed, 24 Nov 2010 10:54:38 -0800 From: Weongyo Jeong Date: Wed, 24 Nov 2010 10:54:38 -0800 To: Andrew Thompson Message-ID: <20101124185438.GM92881@weongyo> References: <201011231852.40484.jkim@FreeBSD.org> <20101124001832.GI92881@weongyo> <201011231936.57818.jkim@FreeBSD.org> <20101124054659.GL92881@weongyo> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: freebsd-usb@FreeBSD.org, Jung-uk Kim Subject: Re: [RFC] USBdump patches X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2010 18:54:14 -0000 On Wed, Nov 24, 2010 at 07:35:30PM +1300, Andrew Thompson wrote: > On 24 November 2010 18:46, Weongyo Jeong wrote: > > On Wed, Nov 24, 2010 at 01:59:47PM +1300, Andrew Thompson wrote: > >> On 24 November 2010 13:36, Jung-uk Kim wrote: > >> > On Tuesday 23 November 2010 07:18 pm, Weongyo Jeong wrote: > >> >>    - BPF was normally for ethernet frames (most operations were > >> >> based on mbuf including the machine filter and there were a lot of > >> >> assumptions the input buffer is mbuf type.  For example, handling > >> >> BPF_LD|BPF_W|BPF_ABS).  However the USB packet isn't like mbuf > >> >> style that it's just a linear buffer.  So the most important code > >> >> or assumption wasn't compatible. > >> > > >> > BPF can deal with linear buffer just fine.  For example, ng_bpf(4) > >> > does it.  Please see sys/netgraph/ng_bpf.c. > >> > > >> >>    - Just making the patch for BPF code, it looked like a trick or > >> >> a hack to me because I couldn't define what BPF should be. > >> > > >> > If you don't want to touch bpf.c for some reason, netgraph(4) (-> > >> > ng_bpf) may be an alternate solution for you. > >> > > >> >>    - I could not define BPF exactly myself that what BPF should > >> >> cover. I agreed with that BPF is for ethernet packet filtering but > >> >> could not make sure myself that BPF could cover USB packets. > >> > > >> > BPF is a generic packet filter machine, i.e., bytecode is generic > >> > enough for any type of data stream. > >> > >> I agree that this is the best way forward, if it can be achieved. > > > > Attached is what I really wanted to do.  USB pf is greatly simplified > > and perfectly satisfy me.  It'll fully benefit from changes of BPF code. > > > > I'll commit this version into HEAD if no objections. > > Looks good. Is this compatible with the wireshark pcap format? Not yet. I think it could happen soon. regards, Weongyo Jeong