Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jun 1999 18:08:54 +0200 (CEST)
From:      Riccardo Veraldi <riccardo@righi.ml.org>
To:        Ladavac Marino <mladavac@metropolitan.at>
Cc:        "'Pavel V. Antipov'" <pavel@ikar.elect.ru>, freebsd-questions@FreeBSD.ORG
Subject:   RE: Ethernet-level connection
Message-ID:  <Pine.BSF.4.10.9906041808120.19306-100000@righi.ml.org>
In-Reply-To: <55586E7391ACD211B9730000C110027617963C@r-lmh-wi-100.corpnet.at>

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

do u know how I can access to raw ethernet data without using bpf and pcap
??? how I have to do??

ther si some way to look inside kernel buffer for ether device ?
thanks

Rick

On Fri, 4 Jun 1999, Ladavac Marino wrote:

> > -----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?Pine.BSF.4.10.9906041808120.19306-100000>