• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to read/write raw ether packet in application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read/write raw ether packet in application?


  • Subject: Re: How to read/write raw ether packet in application?
  • From: Josh Graessley <email@hidden>
  • Date: Tue, 22 Aug 2006 11:22:37 -0700


Hi Justin,

Wanted to give you a quick PF_NDRV update. PF_NDRV has had a lot of work done to it a few releases ago. I think we fixed it up so it works well as of 10.2, but I could be mistaken. At any rate, you can open a PF_NDRV socket now and register a demux to receive specific 802.3 frames from user space without writing a line of kernel code. PF_NDRV is a little better than BPF. It is based on a socket so there is less copying and it doesn't have some of the buffer problems you can run in to with BPF. It also makes use of the system's demux layer instead of filtering packets a second time at the BPF layer.

-josh

On Aug 21, 2006, at 10:30 PM, Justin C. Walker wrote:


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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: How to read/write raw ether packet in application?
      • From: "Justin C. Walker" <email@hidden>
References: 
 >How to read/write raw ether packet in application? (From: "Robin" <email@hidden>)
 >Re: How to read/write raw ether packet in application? (From: "Justin C. Walker" <email@hidden>)

  • Prev by Date: Re: How to read/write raw ether packet in application?
  • Next by Date: Re: How to read/write raw ether packet in application?
  • Previous by thread: Re: How to read/write raw ether packet in application?
  • Next by thread: Re: How to read/write raw ether packet in application?
  • Index(es):
    • Date
    • Thread