From owner-freebsd-net Thu Dec 3 10:38:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA05973 for freebsd-net-outgoing; Thu, 3 Dec 1998 10:38:05 -0800 (PST) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from kit.isi.edu (kit.isi.edu [128.9.160.207]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA05968 for ; Thu, 3 Dec 1998 10:38:03 -0800 (PST) (envelope-from eddy@kit.isi.edu) Received: (from eddy@localhost) by kit.isi.edu (8.8.8/8.8.7) id KAA01646; Thu, 3 Dec 1998 10:37:46 -0800 (PST) (envelope-from eddy) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 3 Dec 1998 10:37:45 -0800 (PST) From: eddy@isi.edu To: Graeme Brown Cc: "FreeBSD-Net (FreeBSD.Org) List" Subject: Re: FW: How can I write a packet directly to an Ethernet NIC ?layer In-Reply-To: References: X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <13926.55771.693473.242719@kit.isi.edu> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Graeme Brown states: > > _______________________________________________________________________________ > 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. you have to use bpf(4), if you wan't read packets as well, with filtering you may consider pcap(3), however, you'll have to overide pcap_open_live() with your own since pcap will open read only. - rusty To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message