Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  3 Dec 1998 10:37:45 -0800 (PST)
From:      eddy@isi.edu
To:        Graeme Brown <graeme.brown@bt-sys.bt.co.uk>
Cc:        "FreeBSD-Net (FreeBSD.Org) List" <freebsd-net@FreeBSD.ORG>
Subject:   Re: FW: How can I write a packet directly to an Ethernet NIC ?layer
Message-ID:  <13926.55771.693473.242719@kit.isi.edu>
In-Reply-To: <n1299516076.75931@maczebedee>
References:  <n1299516076.75931@maczebedee>

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

Graeme Brown states:
> 
> _______________________________________________________________________________
> To: 'net@FreeBSD.ORG'
> From: Caroline Beauchamps on Wed, Dec 2, 1998 1:11 pm
> 
> Hello,
> 
> I have a program made for Linux, and I want to transform it for FreeBSD.
> The problem is that some of the options don't exist in FreeBSD.
> What I want to do is to send an ethernet packet, so I open the following
> socket:
> 
> sockid=socket (AF_INET, SOCK_PACKET, htons(ETH_P_802_3))
> 
> But SOCK_PACKET does not exist.
> Do you have an idea what I could use instead ?
> Thanks in advance.

you have to use bpf(4), if you wan't read packets as well, with
filtering you may consider pcap(3), however, you'll have to overide
pcap_open_live() with your own since pcap will open read only.

- rusty

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?13926.55771.693473.242719>