From owner-freebsd-hackers Sun Jul 9 23:33:22 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id XAA27265 for hackers-outgoing; Sun, 9 Jul 1995 23:33:22 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id XAA27258 for ; Sun, 9 Jul 1995 23:33:17 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.11/8.6.9) id XAA10744; Sun, 9 Jul 1995 23:33:08 -0700 From: "Rodney W. Grimes" Message-Id: <199507100633.XAA10744@gndrsh.aac.dev.com> Subject: Re: Suggestion for inplementation of bpf To: candy@fct.kgc.co.jp (Toshihiro Kanda) Date: Sun, 9 Jul 1995 23:33:08 -0700 (PDT) Cc: freebsd-hackers@freebsd.org In-Reply-To: <199507100440.NAA25423@xxx.fct.kgc.co.jp> from "Toshihiro Kanda" at Jul 10, 95 01:40:13 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1645 Sender: hackers-owner@freebsd.org Precedence: bulk > > Hi, hackers. I'm using > >$ uname -mrs > >FreeBSD 2.0-RELEASE i386 > > I found that when I write to bpf(4), the frame-length/frame-type > field of ethernet header (offset 12 and 13) must be orderd in little > endian. > Should this be in network byte order? Because the data read from > bpf is orderd in network byte order. In fact, "NetBSD 1.0 i386" is > implemeted in this way. > > I thought /usr/src/sys/net/if_ethersubr.c should be changed: > > case AF_UNSPEC: > eh = (struct ether_header *)dst->sa_data; > bcopy((caddr_t)eh->ether_dhost, (caddr_t)edst, sizeof (edst)); > type = eh->ether_type; > ^^^^^^^^^^^^^^^^^^^^^^ type = htons(eh->ether_type); > break; > > Is this correct? I'll let David answer that one, as I know he has changed some things with respect to this to minimize the number of times we flip eh->ether_type between network and host byte order. > > And one more thing. Why manual pages for bpf is lost from FreeBSD > 2.0? FreeBSD 1.1.5.1 had that. Does 2.0.5 have that? Because at FreeBSD 2.0 we started with a fresh new empty cvs repository and brought in the BSD 4.4 Lite release which did not have bpf.4 in it. This was also true at FreeBSD 1.0 when we started with 386BSD 0.1. bpf.4 is back in the repository, it was in the 2.0.5 release, and will be in the 2.1.0 and all future releases. [Well, unless for some reason we start over again :-)] -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Reliable computers for FreeBSD