From owner-freebsd-net Mon Mar 29 14: 0:53 1999 Delivered-To: freebsd-net@freebsd.org Received: from oracle.dsuper.net (oracle.dsuper.net [205.205.255.1]) by hub.freebsd.org (Postfix) with ESMTP id 6C12715540 for ; Mon, 29 Mar 1999 14:00:40 -0800 (PST) (envelope-from bmilekic@oracle.dsuper.net) Received: from localhost (bmilekic@localhost) by oracle.dsuper.net (Delphi 1.3/8.6.9) with ESMTP id RAA25754; Mon, 29 Mar 1999 17:00:17 -0500 (EST) Date: Mon, 29 Mar 1999 17:00:04 -0500 (EST) From: Bosko Milekic To: Donn Miller Cc: net@FreeBSD.ORG Subject: Re: FreeBSD equiv. of this Linux socket call... In-Reply-To: <36FF11E2.4B661EED@cvzoom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org After open()ing your bpf device file, there are several ioctl()s that need to be called to set the different characteristics of the device. These ioctl()s will basically allow you to load the actual filter, enable promiscuous mode, etc. Only after these ioctl()s, you can perform (and later interpret) I/O with, obviously, read() and write(). I strongly recommend reading the bpf man page, if you haven't done so already, for more information about the ioctl()s. Regards, Bosko. -- Bosko Milekic http://www.supernet.ca/~bmilekic/ Delphi SuperNet voice: (+1) 514 281-7500 fax: (+1) 514 281-6599 PGP Key available upon request. On Mon, 29 Mar 1999, Donn Miller wrote: > Date: Mon, 29 Mar 1999 05:38:42 +0000 > From: Donn Miller > To: net@FreeBSD.ORG > Subject: FreeBSD equiv. of this Linux socket call... > > I'm looking for the FreeBSD equivalent of this Linux socket call: > > dhcpSocket = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_ALL)); > > So far, I think "SOCK_PACKET" can be replaced by a call to /dev/bpf0. > How should /dev/bpf be opened? Should it be by the regular libc open() > command, which returns a file descriptor, that is later used to bind > this file descriptor to a device interface? What is AF_PACKET; I don't > think FreeBSD supports that either. > > Thanks, this is a tough one. > > Donn > > > > > 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