Re: How can I know a packet destination?
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