Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi all,
I'm developing a new application for iPhone/iPod and I have the necessity to use RAW Socket to send custom packets (in really, I need to send ARP packet to get MAC address of hosts in the same network). I know that using RAW Socket requires root privilege but I don't know if this could be possible on iPhone/iPod. For the Apple documentation seems that RAW Socket are supported on iPhone (...and in App Store there are some network applications I think that they use RAW sockets).
I tried to use setuid, seteuid...but this did not work in my iPhone Simulator (Snow Leopard - Xcode 3.2 - firmware 3.1).
1) Do you know if it is really possible to use RAW Socket on iPhone? If so, can you suggest some specific documentation?
2) Do you know alternative solutions to send ARP packet from iPhone or to get MAC address of remote machines?
Imported from the Apple Support Forums via the Wayback Machine 🔗
I answer myself... 🙂
1) At the moment, it seems impossible to use PF_INET and SOCK_RAW on iPhone.
2) Instead sending ARP packet, I read the ARP table after having interacted with the interested machine (e.g. by ping).
Bye, Mik.
Message was edited by: NuMik78
0
iStruppie·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi Mik,
I'm searching for the same functionality, did you take a look at ioctl / SIOCGARP ? Unfortunately I don't get it work on the iPhone.
How did you read the ARP table ? Is there an API ?
Thx,
Stefan
0
NuMik78·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi,
I played a bit with "ioctl" and "SIOCGARP" but it seems does not work. Let me know if you will find some solutions for using ioctl, please. For the ARP table, there are no API. I used some C socket functions, starting from an example which I found on the web...but I didn't test it on a real iPhone device yet (on the iPhone simulator it seems to work).
Bye,
Mik.
0
iShin·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi,
I need to access arp table to get Mac addresses also. do you mind giving me the link to that website that gives example to do that?