Date: Wed, 24 Nov 2010 19:35:30 +1300 From: Andrew Thompson <thompsa@FreeBSD.org> To: Weongyo Jeong <weongyo@freebsd.org> Cc: freebsd-usb@freebsd.org, Jung-uk Kim <jkim@freebsd.org> Subject: Re: [RFC] USBdump patches Message-ID: <AANLkTi==szVY%2B=ForwwYxqL1fE7CG9pecYiDAx4Gtw5-@mail.gmail.com> In-Reply-To: <20101124054659.GL92881@weongyo> References: <AANLkTinaUNi3FGRiOkeTN2FKx3ybqE=F3W6%2BsV8qVCTf@mail.gmail.com> <201011231852.40484.jkim@FreeBSD.org> <20101124001832.GI92881@weongyo> <201011231936.57818.jkim@FreeBSD.org> <AANLkTi=D5Spta67JfA%2BSXh2VF8dDV_aKN%2BgHYF01Znb4@mail.gmail.com> <20101124054659.GL92881@weongyo>
next in thread | previous in thread | raw e-mail | index | archive | help
On 24 November 2010 18:46, Weongyo Jeong <weongyo.jeong@gmail.com> wrote: > On Wed, Nov 24, 2010 at 01:59:47PM +1300, Andrew Thompson wrote: >> On 24 November 2010 13:36, Jung-uk Kim <jkim@freebsd.org> wrote: >> > On Tuesday 23 November 2010 07:18 pm, Weongyo Jeong wrote: >> >> =A0 =A0- 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. =A0For example, handling >> >> BPF_LD|BPF_W|BPF_ABS). =A0However the USB packet isn't like mbuf >> >> style that it's just a linear buffer. =A0So the most important code >> >> or assumption wasn't compatible. >> > >> > BPF can deal with linear buffer just fine. =A0For example, ng_bpf(4) >> > does it. =A0Please see sys/netgraph/ng_bpf.c. >> > >> >> =A0 =A0- Just making the patch for BPF code, it looked like a trick o= r >> >> 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. >> > >> >> =A0 =A0- 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. =A0USB pf is greatly simplified > and perfectly satisfy me. =A0It'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? Andrew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi==szVY%2B=ForwwYxqL1fE7CG9pecYiDAx4Gtw5->