Obtain hostnames, IP addresses, and MAC addresses from Swift

Asked 2 years ago, Updated 2 years ago, 105 views

I would like to create and obtain software for MacOSX by using Swift in Xcode for the hostname, IP address, and MAC address of the communication device that exists on the same LAN, such as arp-a at the command line.
What can you think of?
I would appreciate it if you could let me know.

swift macos swift3

2022-09-30 21:20

2 Answers

Why don't you look at the source of arp-scan and refer to it?
Around here.
https://github.com/royhills/arp-scan


2022-09-30 21:20

IP addresses and MAC addresses are associated using a protocol called ARP.
MAC addresses are kept semi-permanently on the communication board of each machine, but IP addresses are subject to change.(In the past, the MAC address of the communication board was fixed in hardware, but recently some communication boards are rewritten in software.)

The IP address and hostname associations can be from the hosts file that each machine has and from DNS.

So, if you know how ARP, hosts, and DNS work, you should be able to create a program.


2022-09-30 21:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.