0

I am dealing with socket programming with C language and Xcode. I can open socket, server and client. I need to learn my machine's Mac address and then, I will send Arp request for server machine.

Almost all examples had been written for linux. I need to solve it in Mac OS.

Currently, I am using these codes with opening two projects and they are able to communicate.

https://www.geeksforgeeks.org/socket-programming-cc/

Could you give some example or information about this problem?

  • Check out this: https://stackoverflow.com/questions/10593736/mac-address-from-interface-on-os-x-c and if it helped you, close this question as duplicate – Ishay Peled Apr 03 '18 at 18:44
  • I checked it before asking, It is not working. –  Apr 03 '18 at 18:49
  • You do realise a machine may have multiple network interfaces (e.g. wired and wifi) and each will have a distinct MAC address... – Mark Setchell Apr 03 '18 at 19:43
  • its argc is different than 2. Thus, program is exiting at the begining. If I turn these lines to comment line, it returns the Mac value 00:00:00:00:00:00 –  Apr 03 '18 at 20:12
  • What happens if you give it an interface name, as designed? You can find out which are available with the `ifconfig` command. (I think - I don't have a Mac to test on right now.) – Arndt Jonasson Apr 04 '18 at 12:42

0 Answers0