Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 1999 17:00:04 -0500 (EST)
From:      Bosko Milekic <bmilekic@oracle.dsuper.net>
To:        Donn Miller <dmmiller@cvzoom.net>
Cc:        net@FreeBSD.ORG
Subject:   Re: FreeBSD equiv. of this Linux socket call...
Message-ID:  <Pine.OSF.4.05.9903291656170.23874-100000@oracle.dsuper.net>
In-Reply-To: <36FF11E2.4B661EED@cvzoom.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <bmilekic@supernet.ca>  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 <dmmiller@cvzoom.net>
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.05.9903291656170.23874-100000>