Reputation: 413
How to get a list of all local IP addresses connected to the LAN using WINAPI? I searched through netapi32.dll and haven't been successful. Any thoughts ?
Upvotes: 0
Views: 1412
Reputation: 24303
There is no guaranteed way to get the addresses of all devices connected to your local segment. Machines may be firewalled and dropping requets, or have IP addresses in different subnets that the checking machine isn;t configured to access.
You can find all devices on the subnet that respond to a ping by sending a ping request (using ICMPSendEcho()
in the IP Helper library) to every IP address on the local subnet and check for responses.
Upvotes: 2