From owner-freebsd-net Thu Sep 2 6:53:28 1999 Delivered-To: freebsd-net@freebsd.org Received: from ausmail2.austin.ibm.com (ausmail2.austin.ibm.com [192.35.232.11]) by hub.freebsd.org (Postfix) with ESMTP id 6E07114E76 for ; Thu, 2 Sep 1999 06:53:25 -0700 (PDT) (envelope-from marquard@austin.ibm.com) Received: from netmail.austin.ibm.com (netmail.austin.ibm.com [9.53.250.98]) by ausmail2.austin.ibm.com (8.9.1/8.8.5) with ESMTP id IAA61666 for ; Thu, 2 Sep 1999 08:49:48 -0500 Received: from mojave.austin.ibm.com (mojave.austin.ibm.com [9.53.150.76]) by netmail.austin.ibm.com (8.8.5/8.8.5) with ESMTP id IAA23962 for ; Thu, 2 Sep 1999 08:53:26 -0500 Received: (from marquard@localhost) by mojave.austin.ibm.com (AIX4.3/8.9.3/8.7-client1.01) id IAA33676; Thu, 2 Sep 1999 08:53:23 -0500 To: freebsd-net@freebsd.org Subject: Re: Reading and writing raw Ethernet frames References: From: Dave Marquardt Date: 02 Sep 1999 08:53:23 -0500 In-Reply-To: "Cain, Michael E."'s message of "Wed, 1 Sep 1999 15:43:58 -0400" Message-ID: Lines: 19 X-Mailer: Gnus v5.6.45/XEmacs 21.1 - "20 Minutes to Nikko" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org "Cain, Michael E." 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