Getting ARP table on iPhone/iPad

前端 未结 2 388
抹茶落季
抹茶落季 2020-11-30 08:32

I am trying to get the ARP entries on my iPad like here.

When compiling the code to run on my iPad (so not the simulator) I am getting missing header error messages.

相关标签:
2条回答
  • 2020-11-30 08:51

    After importing <netinet/if_ether.h>, you should edit it and change the line

    #include <net/if_arp.h>
    

    to

    #include "if_arp.h"
    

    and then import <net/if_arp.h> in your project as well. This should fix that error.

    Anyway the headers you need to import to compile the code you posted are:

    #include "if_ether.h"
    #include "route.h"
    #include "if_arp.h"
    #include "if_dl.h"
    

    Hope this helps =)

    EDIT:

    You need to "Add files to project", not simply importing it with #import or #include. You can find above files from following links: Files under "netinet" Files under "net"

    0 讨论(0)
  • 2020-11-30 08:58
    #include <net/ethernet.h>
    

    instead of messing with the original headers. More info here: Implicit declaration of function 'ether_ntoa' is invalid in C99

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