Skip site navigation (1)Skip section navigation (2)
Date:      02 Sep 1999 08:53:23 -0500
From:      Dave Marquardt <marquard@austin.ibm.com>
To:        freebsd-net@freebsd.org
Subject:   Re: Reading and writing raw Ethernet frames
Message-ID:  <v5taer5xvvw.fsf@mojave.austin.ibm.com>
In-Reply-To: "Cain, Michael E."'s message of "Wed, 1 Sep 1999 15:43:58 -0400"
References:  <B147CE8D09F1D111BD7100805F19B1C04D8E43@coexch01.mediaone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Cain, Michael E." <mcain@mediaone.com> writes:
> I have an existing application, developed for Linux, that emulates various
> IP network impairments.  One of the key enablers for the app is the ability
> to read and write raw Ethernet frames (sometimes after making appropriate
> changes in the source and destination addresses at both the IP and Ethernet
> level).  On Linux, accessing the raw frames was easily accomplished by
> opening a socket of type SOCK_PACKET instead of SOCK_STREAM or SOCK_DGRAM.
> In the case of a Linux box with multiple Ethernet interfaces, it is
> straightforward to know the interface on which the frame was received or to
> specify the interface on which it should be written.
> 
> I'm interested in porting the application to FreeBSD, and was wondering if
> there was an equivalent mechanism.  To summarize, I need to be able to read
> and write raw Ethernet frames (arbitrarily constructed by me in the worst
> case) and support for multiple Ethernet interfaces while doing so.

Others have recommended bpf, but I recommend libpcap instead.

-Dave


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?v5taer5xvvw.fsf>