• 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: Vincent Pottier <email@hidden>
  • Date: Fri, 3 Dec 2004 00:15:31 +0100

Fair? I don't understand what you mean.
I don't mean a lot with "fair", in fact I'm french and my English isn't good.

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).
Concerning lsof, my probleme isn't the way information is get but the way I get information via lsof, for the moment I use a NSTask but it looks a bit slow so I search a way outpassing lsof, as I outpass tcpdump using libpcap. But it looks more difficult.

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.
All those concept looks a bit difficult for a newbie, i'll have a look to lsof source code but it looks complicate.

Thanks Vincent

_______________________________________________
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: Joshua Graessley <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>)
 >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