Can libpcap be compiled for iPhone/armv6?

后端 未结 1 821
太阳男子
太阳男子 2021-01-16 13:23

Trying to compile a basic program which uses pcap.h. I\'ve set up the environment on my Mac OSX box which uses the iPhone 3.1.3 SDK for an iPhone 3GS. I\'ve also installed l

相关标签:
1条回答
  • 2021-01-16 14:10

    pcap.c isn't the source to libpcap, it's one of the source files to libpcap. You'd have to compile all the source files and build them into a library.

    Doing

    CFLAGS="-I /Users/abnev/libpcap/include -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk" ./configure
    

    might produce a Makefile that would cross-compile libpcap for iOS.

    I presume you will be installing libpcap, or the application built using it, on a jailbroken iPhone, at least if you're going to be capturing packets, because you would need root access in order for libpcap to be able to open a BPF device in order to be able to capture.

    0 讨论(0)
提交回复
热议问题