From owner-freebsd-net Tue Jul 27 11: 5:18 1999 Delivered-To: freebsd-net@freebsd.org Received: from ryouko.nas.nasa.gov (ryouko.nas.nasa.gov [129.99.34.113]) by hub.freebsd.org (Postfix) with ESMTP id A1573152E9 for ; Tue, 27 Jul 1999 11:05:04 -0700 (PDT) (envelope-from greg@ryouko.nas.nasa.gov) Received: from ryouko.nas.nasa.gov (localhost [127.0.0.1]) by ryouko.nas.nasa.gov (8.9.3/NAS8.8.7n) with ESMTP id LAA09269; Tue, 27 Jul 1999 11:02:18 -0700 (PDT) Message-Id: <199907271802.LAA09269@ryouko.nas.nasa.gov> To: waskita adijarto Cc: freebsd-net@freebsd.org Subject: Re: writing raw ethernet packet in FreeBSD. In-reply-to: Your message of "Tue, 27 Jul 1999 11:44:33 +0700." Date: Tue, 27 Jul 1999 11:02:18 -0700 From: "Gregory P. Smith" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I want to read & write raw ethernet packet. I can read raw ethernet > packet with bpf, but writing to bpf device is not so successful. the > ethernet source address always follow the interface's address. Is this the > normal behavior of bpf ? I am thinking that I should look at > /usr/src/sys/net/bridge.c to create raw ethernet packet ... > > My FreeBSD box is 2.2.8, my interface card is 3C509 (ep0) & ed0 (some > NE2000 compatible) It sounds like you want to write a -completely- raw packet using your own ethernet address? If so, look in the NetBSD bpf.h/bpf.c sources for the BIOC{S,G}HDRCMPLT ioctls. (it doesn't look like anyone ever added this to FreeBSD; its real simple to apply) It allows you to tell the Ethernet driver not to rewrite the device's hardware address into the packet before sending it to the card. Greg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message