From owner-freebsd-hackers Wed Mar 31 10:26:11 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from relay.veriguard.com (relay.veriguard.com [207.5.63.61]) by hub.freebsd.org (Postfix) with ESMTP id 4686C15432 for ; Wed, 31 Mar 1999 10:26:09 -0800 (PST) (envelope-from tomb@heliox.com) Received: by relay.veriguard.com; id CAA02082; Wed, 31 Mar 1999 02:26:49 -0800 (PST) Received: from unknown(10.5.63.100) by relay.veriguard.com via smap (4.1) id xma002065; Wed, 31 Mar 99 02:25:53 -0800 Message-ID: <370268D7.68012311@heliox.com> Date: Wed, 31 Mar 1999 10:26:31 -0800 From: Tom Brown X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Christopher Sedore Cc: Graham Wheeler , hackers@FreeBSD.ORG Subject: Re: How do I write to the /dev/bpf0 interface? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG So my supposition that I could write to it like any other file handle was correct ? So I can just write the following to the interface for example: ddddddddddddXXXXXXXXXXXXiiiiiiiiiiiiiiiiiiiiiiiiiii..... d=destination address X=don't care i=information Bash# ethergenerator.pl>/dev/bpf0 Is that correct? What happens if I want to put in a source MAC address? You also mentioned that it might be a bug with 2.2.8, which combination's of card / operating systems might work? Thanks again for your time. Tom Brown Christopher Sedore wrote: > > On Wed, 31 Mar 1999, Graham Wheeler wrote: > > > Christopher Sedore wrote: > > > > > > On Wed, 31 Mar 1999, Graham Wheeler wrote: > > > > > > > Tom Brown wrote: > > > > > > > > > Can anyone please tell me how to post a packet onto my LAN via this > > > > > interface. > > > > > > > > You should just be able to write the frame. Make sure everything is in > > > > network-byte order. You needn't put in a source Ethernet address as that > > > > will get filled in, but you do need to put in a destination. > > > > > > Note that this is probably a bug in the bpf implementation. BPF/the > > > kernel shouldn't be messing with the packet on a write to a bpf > > > descriptor. I've filed a bug report (with patch) that addresses this. > > > > > > > It probably isn't the bpf code that is doing this, but the NIC driver > > code... > > Actually, its a cooperative effort by bpfwrite() and ether_output(). > > -Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message