Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ethernet code



On Wednesday, March 13, 2002, at 05:47 PM, Josh Graessley wrote:

On 3/13/02 3:57 PM, "Justin C. Walker" <email@hidden> wrote:

On Wednesday, March 13, 2002, at 03:27 PM, Nick Howes wrote:

This is a bit of a long shot, but here goes: I want to prototype some
code for an embedded java project on Mac OS X - I can use J2SE for the
prototype, so that's not a problem. However, I need to be able to send
and receive ethernet packets, not TCP/IP packets, ethernet packets with
a particular protocol number. A while ago, I did a project using JNI
on Linux, but I'm guessing this puts me into the driver code, maybe
even the kernel - places where I'm not too comfortable! I'm hoping
that someone might point me to some example code or have done a similar
project and be willing to share their code.

There are a couple of alternatives, none that should force you into the
kernel. Probably the easiest is to use BPF (q.v.). You can check the
bootp project to find code that reads and writes from one of the bpf
devices. In addition, you can get on the bleeding edge and use a
PF_NDRV socket. Check the SharedIP module for details on how to use
this one.

I would recommend PF_NDRV, it isn't the bleeding edge it used to be.
Internally we've used it for something that hasn't been released yet and
ironed out the problems.

Cool!

If you need some sample code, let me know, I think I can dig some up
somewhere.

I'd like some, please...

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | It's not whether you win or lose...
| It's whether *I* win or lose.
*--------------------------------------*-------------------------------*
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: Ethernet code (From: Josh Graessley <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.