From owner-freebsd-net@FreeBSD.ORG Mon Mar 21 13:40:18 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 029ED16A4CE for ; Mon, 21 Mar 2005 13:40:18 +0000 (GMT) Received: from mailserver.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D4B843D4C for ; Mon, 21 Mar 2005 13:40:17 +0000 (GMT) (envelope-from don@SANDVINE.com) X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Mar 2005 08:40:16 -0500 Message-ID: <2BCEB9A37A4D354AA276774EE13FB8C23A6720@mailserver.sandvine.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Sending Ethernet frames Thread-Index: AcUuFtflWRgkwcUBSneWea4ca83OhQABJBTg From: "Don Bowman" To: "Patrik Arlos" , Subject: RE: Sending Ethernet frames X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2005 13:40:18 -0000 From: owner-freebsd-net@freebsd.org On Behalf Of Patrik Arlos > Hi, >=20 > =20 >=20 > I'm trying to send 'raw' Ethernet frames. I have however not=20 > found any examples of how to do this in BSD.=20 >=20 > Is it possible to open a 'ethernet' socket, similar to a=20 > AF_INET? I need to be able to control the destination=20 > address and type/len field in the Ethernet header.=20 >=20 > In Linux it is possible open a SOCK_RAW and bind it to a=20 > particular interface, I've tried to use the sockadd_dl but in=20 > this case bind dies with error 22, any way to do this?=20 You can chmod +w on /dev/bpf* and then open & write to a bpf device.