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 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 wouldn't want to use the BPF approach for real, though, if the protocol you are implementing/supporting uses a fair amount of bandwidth. It tends to put a burden on the system if lots of incoming packets need to be processed.

What protocol are you handling, and what did you do on Linux to support the application?

Regards,

Justin

--
/~\ The ASCII Justin C. Walker, Curmudgeon-at-Large
\ / Ribbon Campaign
X Help cure HTML Email
/ \
_______________________________________________
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: 
 >Ethernet code (From: Nick Howes <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.