Reputation: 1866
In the Apple doc for pcap they have used
#include <pcap.h>
but #include <pcap.h>
in my project gives error that "file not found".
Is there any library need to be imported to include pcap.h in my project? However apple man page has not mentioned it. Question is, how do I include pcap.h in my project?
Thanks.
Upvotes: 1
Views: 1008
Reputation: 271
I checked out the iPhone app -NetStat- you were mentioning. As I understood it opens up listeners for all ports.
You could use a socket helper class and setup listeners for necessary ports.
Here is an example http://code.google.com/p/entropydb/wiki/SocketWrapper
Upvotes: 0
Reputation: 94654
The library libpcap
is not available on the iPhone OS platform, but is only available on the Mac OS X platform.
Short answer, you can't use this library as-is on the iPhone, but you may be able to port some of the functionality to the iPhone. You will not be able to perform packet capture on the iPhone because of security restrictions unless the system is jailbroken.
Upvotes: 2