Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 1999 11:02:18 -0700
From:      "Gregory P. Smith" <greg@nas.nasa.gov>
To:        waskita adijarto <waskita@ee.itb.ac.id>
Cc:        freebsd-net@freebsd.org
Subject:   Re: writing raw ethernet packet in FreeBSD. 
Message-ID:  <199907271802.LAA09269@ryouko.nas.nasa.gov>
In-Reply-To: Your message of "Tue, 27 Jul 1999 11:44:33 %2B0700." <Pine.BSF.3.96.990727113713.4710C-100000@elka.ee.itb.ac.id> 

next in thread | previous in thread | raw e-mail | index | archive | help

> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907271802.LAA09269>