Re: How to get a socket's PID ?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Le 12 janv. 2010 à 18:18, Matthew Mashyna a écrit :
I'm working on a project that attempts to monitor some net activity. I'm using libpcap to watch http packets on port 80, for instance. When we see a particular type of http header we want to see what application made the request. pcap will give me the packet, socket, to and from addresses and more.
I know I can use lsof but that might not be fast enough. I'm looking for a way to do it in C or ObjC.
I don't think this is possible without privilege (and I don't know how to do it either), but as you mention lsof, why did you not download lsof source and look how it does it ? -- Jean-Daniel _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jean-Daniel Dupas