From owner-cvs-all@FreeBSD.ORG Tue Jul 25 19:20:17 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 812E016A4DD; Tue, 25 Jul 2006 19:20:17 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id C75D543D62; Tue, 25 Jul 2006 19:20:05 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id D6D0A170C5; Tue, 25 Jul 2006 19:20:02 +0000 (UTC) To: David Malone From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 25 Jul 2006 20:01:10 +0100." <200607252001.aa18647@salmon.maths.tcd.ie> Date: Tue, 25 Jul 2006 19:20:01 +0000 Message-ID: <11633.1153855201@critter.freebsd.dk> Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, "Christian S.J. Peron" , cvs-all@FreeBSD.org, Sam Leffler , Jung-uk Kim Subject: Re: cvs commit: src/sys/net bpf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2006 19:20:17 -0000 In message <200607252001.aa18647@salmon.maths.tcd.ie>, David Malone writes: >> > libpcap does not need to be modified; it works already for >> > wireless. The fact that the DLT is named DLT_IEEE802_11_RADIO is a >> > bit of a misnomer; it's not entirely 802.11-specific. > >> Ah, you mean we just exploit DLT_IEEE802_11_RADIO. Hmm... How about >> processing overhead? Can we synchronize the timestamping with system >> time? > >It sounds to me like a reasonable thing to do would be to pass up >a raw version of the timestamp (as returned by the hardware). You can only do that for a very limited time. To make it work for more than a fraction of a second you would need to grab the following data: timecounter reading timehands->th_counter->tc_gettimecount() timecounter width timehands->th_counter->tc_counter_mask reference count timehands->th_offset_count reference timestamp timehands->th_offset scaling factor timehands->th_scale UTC offset boottimebin In total we're talking 4+4+4+12+8+12 bytes = 44 bytes. At the expense of a subtraction and an AND, you can save 8 bytes by storing only the masked counter delta instead of the raw values. At the expense of a 96 bit addition, you can add the utc offset to the boottimebin, and save another 12 bytes. That would bring it down to 4+12+8 = 24 bytes. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.