Re: How to read/write raw ether packet in application?
Re: How to read/write raw ether packet in application?
- Subject: Re: How to read/write raw ether packet in application?
- From: "Justin C. Walker" <email@hidden>
- Date: Mon, 21 Aug 2006 22:30:09 -0700
On Aug 21, 2006, at 20:06 , Robin wrote:
Hi , all
Is there any way to read/write raw ethernet(802.3) data packets
in user application layer on OSX ?
We have developed a tartget embended platform with Linux, and
we want to communicate with it by ethernet port, I think we can run
a Carbon application in our iMac host to do this, is it possible?
Or we need write a application/kext pair to realize it?
If by this, you mean "raw ethernet packets with a new type", then you
can do this in a couple of ways: BPF or raw ethernet (PF_NDRV).
FWIW, the system does not take kindly to you siphoning off TCP
packets. I suspect that isn't what you want to do, however.
The BPF approach is probably simplest and most portable, and there
are several applications in the darwin source tree that show how it's
done (see the bootp project, for example).
I don't know what shape the PF_NDRV code is in now. This is a
"protocol" handler that is a kext, and so requires kernel
programming. The SharedIP kext uses this to get ethernet packets to
and from the Classic Mac OS environment.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
Experience is what you get
when you don't get what you want.
--------
_______________________________________________
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