From owner-svn-src-all@FreeBSD.ORG Thu Dec 2 20:24:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B172E106564A; Thu, 2 Dec 2010 20:24:11 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id D66888FC1C; Thu, 2 Dec 2010 20:24:10 +0000 (UTC) Received: by eyb7 with SMTP id 7so4789414eyb.13 for ; Thu, 02 Dec 2010 12:24:09 -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:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:organization:x-operation-sytem; bh=7pvPorq+PaA3/oMaHLuJ1DppZ1yFGbj/qm6Y3PtBavw=; b=CNSA4ARSfxERcyscMmkVYNSo6VFBWDOty/mwqrhr0HRrf/AJ8ZSj7Ou4bHmFzkMW5C +UOwfcWIg6bIDc+DxSffTnA+Wj01wG4reBiYpK1hiyebx1wIx7LYCj2qh3gUW1sKX2HL QNSMUN8/DTIYNxTPDwR3SSk9ph2GdrjKZiKZ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:organization:x-operation-sytem; b=YtecrKBXAKn99nOmf5E6TpnL8nLadUqDg+0aF1vTf+I9ecbiPi6qD3lnYCrPk5lkfm Gc+8M9PhwGzhE1kDyxNp1sHgOwEV+l8VBtxe8wDRkYbxDoTyE8W5APxv1AKytGtfc7DJ J3p3muoybrn0yuFy3zoXuiQykReIZWF49INjU= Received: by 10.223.101.196 with SMTP id d4mr1092312fao.23.1291319841758; Thu, 02 Dec 2010 11:57:21 -0800 (PST) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id f24sm358003fak.24.2010.12.02.11.57.17 (version=SSLv3 cipher=RC4-MD5); Thu, 02 Dec 2010 11:57:20 -0800 (PST) Received: by weongyo (sSMTP sendmail emulation); Thu, 02 Dec 2010 11:57:22 -0800 From: Weongyo Jeong Date: Thu, 2 Dec 2010 11:57:22 -0800 To: Jung-uk Kim Message-ID: <20101202195722.GD2033@weongyo> Mail-Followup-To: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201012010351.oB13p6du062509@svn.freebsd.org> <201012011858.19748.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012011858.19748.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216091 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 20:24:11 -0000 On Wed, Dec 01, 2010 at 06:58:18PM -0500, Jung-uk Kim wrote: > On Tuesday 30 November 2010 10:51 pm, Weongyo Jeong wrote: > > Author: weongyo > > Date: Wed Dec 1 03:51:06 2010 > > New Revision: 216091 > > URL: http://svn.freebsd.org/changeset/base/216091 > > > > Log: > > Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's > > attached or detached. Normally it should be changed through user > > land ioctl(2) system calls but it looks there's no apps for USB and > > no need. > > > > With this patch, libpcap would detect the usbus interfaces > > correctly and tcpdump(1) could dump the USB packets into PCAP > > format with -w option. However it couldn't print the output to > > console because there's no printer-routine at tcpdump(1). > > I have written a very hackish USB packet printer for tcpdump based on > Linux version. > > http://people.freebsd.org/~jkim/tcpdump-usb.diff Looks good to me. > Note we can only print headers as Linux version does. > > Are you planning on adopting DLT_USB_LINUX or DLT_USB_LINUX_MMAPPED or > applying for our own DLT, BTW? Frankly speaking, not sure yet. As you know, DLT_USB_LINUX and DLT_USB_LINUX_MMAPPED types are very specific only for Linux and each types has different structure size (48 bytes and 64 bytes). IMHO linux thought their own format only instead of thinking/defining a generic format. I think we have some cases we could select as follows: 1) Define a generic USB packet header form and make a consensus with linux guys then uses DLT_USB type. 2) Define DLT_USB_BSD and write our own code. 3) Changes `struct usbpf_pkthdr' to be compatible with linux format though it's expected to have some wasted variables (e.g. time stamp). regards, Weongyo Jeong