From owner-freebsd-net Wed Dec 2 07:51:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA05896 for freebsd-net-outgoing; Wed, 2 Dec 1998 07:51:36 -0800 (PST) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from rerun.lucentctc.com (Rerun.Lucentctc.com [199.93.237.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA05887 for ; Wed, 2 Dec 1998 07:51:32 -0800 (PST) (envelope-from mcambria@lucent.com) Received: by Rerun.Lucentctc.com with Internet Mail Service (5.5.2232.9) id ; Wed, 2 Dec 1998 10:42:40 -0500 Message-ID: <75ADD7496F0BD211ADC000104B8846CF056ADC@Rerun.Lucentctc.com> From: "Cambria, Mike" To: "FreeBSD-Net (FreeBSD.Org) List" Subject: RE: How can I write a packet directly to an Ethernet NIC ?layer Date: Wed, 2 Dec 1998 10:42:40 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I use BPF to do this. On FreeBSD, BPF makes use of libpcap. You will need to rebuild libpcap to allow you to write. libpcap ships with the socket being open read only. Detailed instructions on what to do can be found at W. Richard Stevens web site, as part of the source code for the 2ed edition of Unix Network Programming Volume 1. See: http://www.kohala.com/~rstevens/unpv12e.html for specifics on the book. On that page, near the bottom, he has an example of how to write raw frames using libpcap. I use it to write SNA frames. MikeC Michael C. Cambria Lucent Technologies SNA Product Development Bell Labs Innovations Voice: (978) 287 - 2807 300 Baker Avenue Fax: (978) 287 - 2810 Concord, Massachusetts 01742 Internet: mcambria@lucent.com -----Original Message----- From: owner-freebsd-net@FreeBSD.ORG [SMTP:owner-freebsd-net@FreeBSD.ORG] Sent: Wednesday, December 02, 1998 7:47 AM To: FreeBSD-Net (FreeBSD.Org) List Subject: FW: How can I write a packet directly to an Ethernet NIC ?layer ____________________________________________________________________________ ___ To: 'net@FreeBSD.ORG' From: Caroline Beauchamps on Wed, Dec 2, 1998 1:11 pm Hello, I have a program made for Linux, and I want to transform it for FreeBSD. The problem is that some of the options don't exist in FreeBSD. What I want to do is to send an ethernet packet, so I open the following socket: sockid=socket (AF_INET, SOCK_PACKET, htons(ETH_P_802_3)) But SOCK_PACKET does not exist. Do you have an idea what I could use instead ? Thanks in advance. Caroline Beauchamps >Mobility Research Unit >caroline.beauchamps@bt-sys.bt.co.uk >B55-131B >BT Laboratories >Martlesham Heath tel : +44 1473 649 115 >IPSWICH IP5 3RE (UK) fax : +44 1473 646 885 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message