From owner-freebsd-questions Fri Jun 4 5:57:35 1999 Delivered-To: freebsd-questions@freebsd.org Received: from titan.metropolitan.at (mail.metropolitan.at [195.212.98.131]) by hub.freebsd.org (Postfix) with ESMTP id 291E715259 for ; Fri, 4 Jun 1999 05:57:29 -0700 (PDT) (envelope-from mladavac@metropolitan.at) Received: by TITAN with Internet Mail Service (5.0.1458.49) id ; Fri, 4 Jun 1999 15:00:23 +0200 Message-ID: <55586E7391ACD211B9730000C110027617963C@r-lmh-wi-100.corpnet.at> From: Ladavac Marino To: "'Pavel V. Antipov'" , Riccardo Veraldi Cc: freebsd-questions@FreeBSD.ORG Subject: RE: Ethernet-level connection Date: Fri, 4 Jun 1999 14:55:07 +0200 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -----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 ). > I tried to execute this program: > > #include > #include > #include > #include > > main(){ > cout << socket(AF_LINK, SOCK_RAW, 0)< cout< } > > 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