Date: Fri, 4 Jun 1999 16:18:45 +0400 (MSD) From: "Pavel V. Antipov" <pavel@ikar.elect.ru> To: Riccardo Veraldi <riccardo@righi.ml.org> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Ethernet-level connection Message-ID: <Pine.BSF.3.96.990604161331.13837B-100000@ikar.elect.ru> In-Reply-To: <Pine.BSF.4.10.9906041357530.18044-100000@righi.ml.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 4 Jun 1999, Riccardo Veraldi wrote:
>
>
> Hello.
> I did a FreeBSD port called sniff. and to have access to ethernet packets
> I just used tcpdump. AS well tcpdump is written using libpcap.
> I wanted to access directly to the ethernet device without using libpcap
> or tcpdump but since now noone could answer to my question.
> Do u have any clue about it ?
> thanks
>
> Rick
>
Hi !
I saw PF_PACKET parameter for system call "socket" in linux. In FreeBSD
thare is PF_LINK (see <sys/sockst.h>).
I tried to execute this program:
#include <sys/types.h>
#include <sys/socket.h>
#include <iostream.h>
#include <errno.h>
main(){
cout << socket(AF_LINK, SOCK_RAW, 0)<<endl;
cout<<errno<<endl;
}
As a result errno == 43. I use 2.2.5 and hope that in latest versions of
FreeBSD I'll find direct access to Ethernet packets via
socket & recvfrom & sendto system calls.
Pavel
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990604161331.13837B-100000>
