Date: Fri, 4 Jun 1999 14:55:07 +0200 From: Ladavac Marino <mladavac@metropolitan.at> To: "'Pavel V. Antipov'" <pavel@ikar.elect.ru>, Riccardo Veraldi <riccardo@righi.ml.org> Cc: freebsd-questions@FreeBSD.ORG Subject: RE: Ethernet-level connection Message-ID: <55586E7391ACD211B9730000C110027617963C@r-lmh-wi-100.corpnet.at>
next in thread | raw e-mail | index | archive | help
> -----Original Message----- > From: Pavel V. Antipov [SMTP:pavel@ikar.elect.ru] > Sent: Friday, June 04, 1999 2:19 PM > To: Riccardo Veraldi > Cc: freebsd-questions@FreeBSD.ORG > Subject: Re: Ethernet-level connection > > 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. > [ML] I don't think you ever will. Use bpf instead. I don't think PF_PACKET will ever be in BSD because IIRC it is only a subset of bpf functionality. It either gets none or all packets whereas bpf is capable of programming the NIC for packet filtering (i.e. filtering is done in hardware, if the hardware supports it, and many cards do, otherwise in driver). AFAIK PF_PACKET is a Linuxism. Most other unices have bpf. /Marino > Pavel > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message 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?55586E7391ACD211B9730000C110027617963C>