Sending raw frames (PF_PACKET) to a host-ap device?

Ben Greear greearb at
Thu Mar 13 00:49:32 EST 2003

Pedro Estrela wrote:
> the best way to do this and a lot more, is to use the libpcap packet
> capture/generation library that tcpdump uses.
> using this library, you can most definitly:
> - put a interface into promiscuous mode;
> - receive all packets, with all headers up to level 2, including (later
> versions of etheral pcap) prism2 headers;
> - send any possible packets, including layer 2 headers. (for exemple, custum
> ARP packets)
> it's more complicated than a PF_packet socket, which also works, but its
> MUCH more flexible.

Actually, I will be sending these packets from a kernel module, for
the most part.  However, if libpcap can send it, then it will be fine.

My main concern was whether or not I could send a pkt with a src address
other than that of the wlan device, and whether or not I could put it in
promisc mode.

Thanks for the response!


> please reply to:
> pedro.estrela at
> ----- Original Message -----
> From: "Ben Greear" <greearb at>
> To: <hostap at>
> Sent: Thursday, March 13, 2003 4:58 AM
> Subject: Sending raw frames (PF_PACKET) to a host-ap device?
>>Is it possible to build packets (including any source MAC addr I wish)
>>and send them with a PF_SOCKET socket?  Anything special I need to do
>>to make this work (if it can be done?)
>>And if that works, I am assuming I can put the wlan device in
>>promiscious mode so that I can receive an answer to whatever MAC
>>I just created?
>>Ben Greear <greearb at>       <Ben_Greear AT>
>>President of Candela Technologies Inc
>>HostAP mailing list
>>HostAP at
> _______________________________________________
> HostAP mailing list
> HostAP at

Ben Greear <greearb at>       <Ben_Greear AT>
President of Candela Technologies Inc

More information about the HostAP mailing list