• 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 can I know a packet destination?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I know a packet destination?


  • Subject: Re: How can I know a packet destination?
  • From: Justin Walker <email@hidden>
  • Date: Thu, 2 Dec 2004 14:49:54 -0800


On Dec 2, 2004, at 14:33, Vincent Pottier wrote:

Currently I'm using this method (lsof -nPi looks quicker), but it don't looks very "fair" and it's a bit slow, so if someone have another method...

Fair? I don't understand what you mean.

There really is no better method than what 'lsof' uses. Because socket/file descriptors are shared between processes, there is no way to know what process will get a given packet, or partial packet (note that the distinction between packets may be gone by the time the data is queued on the sockbuf).

Since the OS really doesn't care what process gets a chunk of data, it does not do bookkeeping in a way that will work as you want. Therefore, you have to look through kernel data structures and match socket structures with per-process file descriptor entries to see what processes are possible recipients. I don't believe there is any other way.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics        |    Men are from Earth.
                                       |    Women are from Earth.
                                       |       Deal with it.
*--------------------------------------*-------------------------------*

_______________________________________________
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 can I know a packet destination?
      • From: Vincent Pottier <email@hidden>
References: 
 >How can I know a packet destination? (From: Vincent Pottier <email@hidden>)
 >Re: How can I know a packet destination? (From: Justin Walker <email@hidden>)

  • Prev by Date: Re: How can I know a packet destination?
  • Next by Date: Re: How can I know a packet destination?
  • Previous by thread: Re: How can I know a packet destination?
  • Next by thread: Re: How can I know a packet destination?
  • Index(es):
    • Date
    • Thread