Date: Wed, 2 Dec 1998 10:42:40 -0500 From: "Cambria, Mike" <mcambria@lucent.com> To: "FreeBSD-Net (FreeBSD.Org) List" <freebsd-net@FreeBSD.ORG> Subject: RE: How can I write a packet directly to an Ethernet NIC ?layer Message-ID: <75ADD7496F0BD211ADC000104B8846CF056ADC@Rerun.Lucentctc.com>
next in thread | raw e-mail | index | archive | help
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 <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 <mailto: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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?75ADD7496F0BD211ADC000104B8846CF056ADC>