Re: The methods to receive/send ethernet raw packet
Re: The methods to receive/send ethernet raw packet
- Subject: Re: The methods to receive/send ethernet raw packet
- From: "Chen-Hai Teng" <email@hidden>
- Date: Thu, 6 Dec 2007 20:27:00 +0800
Hi Quinn,
Thanks for your advice.
I had run and red the BSDLLCTest. It uses socket API to send raw packet.
According to following thread, I finally select pcap and bpf to implement my code.
http://lists.apple.com/archives/darwin-development/2002/May/msg00279.htmlI choose pcap to receive raw packet because it's more portable.
I choose bpf to send raw packet because the function pcap_inject is not allowed on Mac OS X
10.4.
My problem is not to send/receive raw packet, it's how many methods that can send/receive raw packet on Mac OS X.
I summary some results following:
1. BPF
2. pcap (it can receive raw packet, but can't send raw packet at
10.4)
3. socket API (open with the PF_NDRV)
4. IOKit (in kernel mode)
If there are more methods can send/receive raw packet, please tell me.
I would be happy to try it.
--
Chen-Hai, Teng
Three-Headed Monkey
Mac OS X Software Development Group
http://tthm.group.googlepages.comhttp://thedoublee.blogspot.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden